Renamed test methods as per naming convention

This commit is contained in:
priyeshmashelkar 2018-07-12 12:11:00 +01:00
parent a3f6ad6d88
commit 0522b91f3d
2 changed files with 3 additions and 3 deletions

View File

@ -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();

View File

@ -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();