diff --git a/mockito/src/test/java/org/baeldung/mockito/MockitoConfigExamplesTest.java b/mockito/src/test/java/org/baeldung/mockito/MockitoConfigExamplesTest.java index de6e7fca72..5050a2d6bc 100644 --- a/mockito/src/test/java/org/baeldung/mockito/MockitoConfigExamplesTest.java +++ b/mockito/src/test/java/org/baeldung/mockito/MockitoConfigExamplesTest.java @@ -2,8 +2,6 @@ package org.baeldung.mockito; import org.junit.Test; import org.mockito.Mockito; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; import static org.hamcrest.Matchers.equalTo; @@ -69,7 +67,7 @@ public class MockitoConfigExamplesTest { } @Test - public final void whenMockMethodCallIsConfiguredToCallTheRealMethod_thenRealMetehodIsCalled() { + public final void whenMockMethodCallIsConfiguredToCallTheRealMethod_thenRealMethodIsCalled() { final MyList listMock = Mockito.mock(MyList.class); when(listMock.size()).thenCallRealMethod(); @@ -77,14 +75,9 @@ public class MockitoConfigExamplesTest { } @Test - public final void whenMockMethodCallIsConfiguredWithCustomAnswer_thenRealMetehodIsCalled() { + public final void whenMockMethodCallIsConfiguredWithCustomAnswer_thenRealMethodIsCalled() { final MyList listMock = Mockito.mock(MyList.class); - doAnswer(new Answer() { - @Override - public final String answer(final InvocationOnMock invocation) { - return "Always the same"; - } - }).when(listMock).get(anyInt()); + doAnswer(invocation -> "Always the same").when(listMock).get(anyInt()); final String element = listMock.get(1); assertThat(element, is(equalTo("Always the same"))); diff --git a/spring-all/pom.xml b/spring-all/pom.xml index eb7a573c89..1b12d7e42c 100644 --- a/spring-all/pom.xml +++ b/spring-all/pom.xml @@ -302,7 +302,7 @@ 3.1.3 3.4 3.6.1 - 6.4.0 + 6.4.0