-
How can we simulate if then behavior in Junits?
-
- Mockito.if(..).then(..);
- Mockito.when(…).thenReturn(…);
- if(..){..} else{..}
- if{..} else{..}
- None of these
Correct Option: B
Mockito.when(mockList.size()).thenReturn(100); assertEquals(100, mockList.size()); is the usage to implement if and then behavior.