Renamed test methods as per naming convention
This commit is contained in:
parent
a3f6ad6d88
commit
0522b91f3d
|
@ -15,7 +15,7 @@ public class MockAnnotationUnitTest {
|
|||
UserRepository mockRepository;
|
||||
|
||||
@Test
|
||||
public void testMockAnnotation() {
|
||||
public void whenCountMethodIsMocked_ThenMockedValueIsReturned() {
|
||||
Mockito.when(mockRepository.count()).thenReturn(123L);
|
||||
long userCount = mockRepository.count();
|
||||
Assert.assertEquals(123L, userCount);
|
||||
|
@ -23,7 +23,7 @@ public class MockAnnotationUnitTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testMockitoMockMethod() {
|
||||
public void whenLocalMockVariableIsUsed_ThenMockedValueFromLocalMockVariableIsReturned() {
|
||||
UserRepository localMockRepository = Mockito.mock(UserRepository.class);
|
||||
Mockito.when(localMockRepository.count()).thenReturn(111L);
|
||||
long userCount = localMockRepository.count();
|
||||
|
|
|
@ -20,7 +20,7 @@ public class MockBeanAnnotationIntegrationTest {
|
|||
ApplicationContext context;
|
||||
|
||||
@Test
|
||||
public void testMockBean() {
|
||||
public void whenCountMethodIsMocked_ThenMockedValueIsReturned() {
|
||||
Mockito.when(mockRepository.count()).thenReturn(123L);
|
||||
UserRepository userRepoFromContext = context.getBean(UserRepository.class);
|
||||
long userCount = userRepoFromContext.count();
|
||||
|
|
Loading…
Reference in New Issue