diff --git a/aws-lambda/todo-reminder/ToDoFunction/pom.xml b/aws-lambda/todo-reminder/ToDoFunction/pom.xml index c17ff8bf15..c847907c9b 100644 --- a/aws-lambda/todo-reminder/ToDoFunction/pom.xml +++ b/aws-lambda/todo-reminder/ToDoFunction/pom.xml @@ -111,7 +111,7 @@ 11.2 5.0.1 1.2.0 - 3.3.0 + 4.1.0 3.19.0 5.8.1 diff --git a/aws/pom.xml b/aws/pom.xml index 7c363eb400..a57dd6690e 100644 --- a/aws/pom.xml +++ b/aws/pom.xml @@ -20,12 +20,6 @@ aws-java-sdk ${aws-java-sdk.version} - - org.mockito - mockito-core - ${mockito-core.version} - test - com.amazonaws aws-lambda-java-core @@ -111,7 +105,6 @@ 1.1.0 2.8.0 1.11.290 - 2.21.0 1.11.86 https://s3-us-west-2.amazonaws.com/dynamodb-local/release 1.10.L001 diff --git a/core-java-modules/core-java-time-measurements/pom.xml b/core-java-modules/core-java-time-measurements/pom.xml index 28959d0938..cb2fd9fb40 100644 --- a/core-java-modules/core-java-time-measurements/pom.xml +++ b/core-java-modules/core-java-time-measurements/pom.xml @@ -43,12 +43,6 @@ ${mockito-inline.version} test - - org.mockito - mockito-core - ${mockito-inline.version} - test - org.jmockit jmockit @@ -85,7 +79,7 @@ 1.18.22 1.8.9 1.44 - 4.0.0 + 4.1.0 \ No newline at end of file diff --git a/ddd/pom.xml b/ddd/pom.xml index cc5a173e85..3beb43bb35 100644 --- a/ddd/pom.xml +++ b/ddd/pom.xml @@ -86,11 +86,6 @@ spring-boot-starter-test test - - org.mockito - mockito-core - test - de.flapdoodle.embed de.flapdoodle.embed.mongo diff --git a/ethereum/pom.xml b/ethereum/pom.xml index d2b05222c3..6c1a0e900f 100644 --- a/ethereum/pom.xml +++ b/ethereum/pom.xml @@ -191,7 +191,6 @@ 1.5.0-RELEASE 3.3.1 1.5.6.RELEASE - 2.21.0 2.4.0 2.0.4.RELEASE 3.1 diff --git a/patterns/clean-architecture/pom.xml b/patterns/clean-architecture/pom.xml index 7b244e4a5e..5938b0e596 100644 --- a/patterns/clean-architecture/pom.xml +++ b/patterns/clean-architecture/pom.xml @@ -40,11 +40,6 @@ - - org.mockito - mockito-core - test - org.junit.platform junit-platform-engine diff --git a/patterns/hexagonal-architecture/pom.xml b/patterns/hexagonal-architecture/pom.xml index 9dfc113d03..b18bd49aec 100644 --- a/patterns/hexagonal-architecture/pom.xml +++ b/patterns/hexagonal-architecture/pom.xml @@ -36,11 +36,6 @@ - - org.mockito - mockito-core - test - diff --git a/persistence-modules/spring-boot-persistence/pom.xml b/persistence-modules/spring-boot-persistence/pom.xml index deac0c2a57..58b4dd8b9e 100644 --- a/persistence-modules/spring-boot-persistence/pom.xml +++ b/persistence-modules/spring-boot-persistence/pom.xml @@ -37,11 +37,6 @@ org.springframework.boot spring-boot-starter-test - - org.mockito - mockito-core - test - com.h2database h2 diff --git a/persistence-modules/spring-persistence-simple/pom.xml b/persistence-modules/spring-persistence-simple/pom.xml index ec7c8bd3a0..d9b832df2d 100644 --- a/persistence-modules/spring-persistence-simple/pom.xml +++ b/persistence-modules/spring-persistence-simple/pom.xml @@ -76,12 +76,6 @@ test ${spring-boot-starter.version} - - org.mockito - mockito-core - ${mockito.version} - test - @@ -94,8 +88,6 @@ 2.2.7.RELEASE 0.23.0 - - 3.3.3 \ No newline at end of file diff --git a/pom.xml b/pom.xml index ad002650d7..b7c4efa421 100644 --- a/pom.xml +++ b/pom.xml @@ -1416,7 +1416,7 @@ 3.21.0 2.2 1.3 - 3.3.0 + 4.1.0 1.11.20 diff --git a/quarkus/pom.xml b/quarkus/pom.xml index 22f5e0e991..9342b1a4af 100644 --- a/quarkus/pom.xml +++ b/quarkus/pom.xml @@ -37,6 +37,12 @@ pom import + + org.mockito + mockito-core + ${mockito.version} + test + @@ -94,6 +100,11 @@ rest-assured test + + org.mockito + mockito-core + test + @@ -172,6 +183,7 @@ 1.7.0.Final 1.18.6 + 3.3.0 \ No newline at end of file diff --git a/spring-5-reactive-client/pom.xml b/spring-5-reactive-client/pom.xml index f665d5c9a6..5fb41a7d6b 100644 --- a/spring-5-reactive-client/pom.xml +++ b/spring-5-reactive-client/pom.xml @@ -94,7 +94,7 @@ com.github.tomakehurst wiremock-standalone - 2.26.0 + ${wiremock-standalone.version} test @@ -110,13 +110,13 @@ org.mockito mockito-junit-jupiter - 2.23.0 + ${mockito.version} test io.projectreactor reactor-test - 3.2.10.RELEASE + ${reactor-test.version} test @@ -192,5 +192,7 @@ 1.0 1.1.6 4.0.1 + 3.2.10.RELEASE + 2.26.0 \ No newline at end of file diff --git a/spring-aop/pom.xml b/spring-aop/pom.xml index cbec4ef35b..0d48c479ca 100644 --- a/spring-aop/pom.xml +++ b/spring-aop/pom.xml @@ -32,11 +32,6 @@ spring-boot-starter-test test - - org.mockito - mockito-core - test - diff --git a/spring-boot-modules/spring-boot-crud/pom.xml b/spring-boot-modules/spring-boot-crud/pom.xml index 0a8e57be17..7acaa49e87 100644 --- a/spring-boot-modules/spring-boot-crud/pom.xml +++ b/spring-boot-modules/spring-boot-crud/pom.xml @@ -33,11 +33,6 @@ org.springframework.boot spring-boot-starter-test - - org.mockito - mockito-core - test - com.h2database h2 diff --git a/spring-cloud/spring-cloud-zuul/spring-zuul-ui/pom.xml b/spring-cloud/spring-cloud-zuul/spring-zuul-ui/pom.xml index c071b8863a..3e32a91a41 100644 --- a/spring-cloud/spring-cloud-zuul/spring-zuul-ui/pom.xml +++ b/spring-cloud/spring-cloud-zuul/spring-zuul-ui/pom.xml @@ -27,11 +27,6 @@ spring-test test - - org.mockito - mockito-core - test - diff --git a/spring-core-2/pom.xml b/spring-core-2/pom.xml index 19e7fb5f28..a4cae17c20 100644 --- a/spring-core-2/pom.xml +++ b/spring-core-2/pom.xml @@ -129,11 +129,6 @@ spring-test test - - org.mockito - mockito-core - test - net.javacrumbs.shedlock diff --git a/spring-mockito/pom.xml b/spring-mockito/pom.xml index 0753935d0c..e0d7bee6f3 100644 --- a/spring-mockito/pom.xml +++ b/spring-mockito/pom.xml @@ -28,8 +28,4 @@ - - 2.24.0 - - \ No newline at end of file diff --git a/spring-security-modules/spring-security-web-rest-custom/pom.xml b/spring-security-modules/spring-security-web-rest-custom/pom.xml index 1403154767..f435a4204e 100644 --- a/spring-security-modules/spring-security-web-rest-custom/pom.xml +++ b/spring-security-modules/spring-security-web-rest-custom/pom.xml @@ -115,12 +115,6 @@ commons-lang3 ${commons-lang3.version} - - - org.mockito - mockito-core - test - diff --git a/spring-web-modules/spring-rest-query-language/pom.xml b/spring-web-modules/spring-rest-query-language/pom.xml index 65f28f5be0..c200852e27 100644 --- a/spring-web-modules/spring-rest-query-language/pom.xml +++ b/spring-web-modules/spring-rest-query-language/pom.xml @@ -181,11 +181,6 @@ spring-test test - - org.mockito - mockito-core - test - diff --git a/spring-web-modules/spring-rest-simple/pom.xml b/spring-web-modules/spring-rest-simple/pom.xml index 2f8d6eac27..21c607ea1a 100644 --- a/spring-web-modules/spring-rest-simple/pom.xml +++ b/spring-web-modules/spring-rest-simple/pom.xml @@ -119,12 +119,6 @@ okhttp ${com.squareup.okhttp3.version} - - - org.mockito - mockito-core - test - org.springframework spring-test diff --git a/spring-web-modules/spring-rest-testing/pom.xml b/spring-web-modules/spring-rest-testing/pom.xml index 93942e97b6..4fc484d1d1 100644 --- a/spring-web-modules/spring-rest-testing/pom.xml +++ b/spring-web-modules/spring-rest-testing/pom.xml @@ -165,11 +165,6 @@ spring-test test - - org.mockito - mockito-core - test - diff --git a/spring-web-modules/spring-resttemplate/pom.xml b/spring-web-modules/spring-resttemplate/pom.xml index 5cac186fad..93902bc81c 100644 --- a/spring-web-modules/spring-resttemplate/pom.xml +++ b/spring-web-modules/spring-resttemplate/pom.xml @@ -108,11 +108,6 @@ ${com.squareup.okhttp3.version} - - org.mockito - mockito-core - test - org.springframework spring-test diff --git a/testing-modules/junit-5/pom.xml b/testing-modules/junit-5/pom.xml index 7a511dfe7a..576800d979 100644 --- a/testing-modules/junit-5/pom.xml +++ b/testing-modules/junit-5/pom.xml @@ -16,6 +16,17 @@ ../ + + + + org.mockito + mockito-core + ${mockito.version} + test + + + + org.junit.platform @@ -76,7 +87,7 @@ org.mockito mockito-junit-jupiter - ${mockito.junit.jupiter.version} + ${mockito.version} test @@ -85,6 +96,11 @@ ${powermock.version} test + + org.mockito + mockito-core + test + @@ -119,11 +135,11 @@ - 2.23.0 2.8.2 - 2.0.0 + 2.0.9 5.0.1.RELEASE 3.0.0-M3 + 3.3.0 \ No newline at end of file diff --git a/testing-modules/mockito-2/pom.xml b/testing-modules/mockito-2/pom.xml index cff7598edc..ba81022c5c 100644 --- a/testing-modules/mockito-2/pom.xml +++ b/testing-modules/mockito-2/pom.xml @@ -29,8 +29,4 @@ - - 2.21.0 - - \ No newline at end of file diff --git a/testing-modules/mockito-2/src/test/java/com/baeldung/mockito/java8/UnemploymentServiceImplUnitTest.java b/testing-modules/mockito-2/src/test/java/com/baeldung/mockito/java8/UnemploymentServiceImplUnitTest.java index 87093fc1ba..ef7a9ac1d9 100644 --- a/testing-modules/mockito-2/src/test/java/com/baeldung/mockito/java8/UnemploymentServiceImplUnitTest.java +++ b/testing-modules/mockito-2/src/test/java/com/baeldung/mockito/java8/UnemploymentServiceImplUnitTest.java @@ -11,7 +11,7 @@ import java.util.stream.Stream; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) diff --git a/testing-modules/mockito-3/pom.xml b/testing-modules/mockito-3/pom.xml index 10130290df..e35416933b 100644 --- a/testing-modules/mockito-3/pom.xml +++ b/testing-modules/mockito-3/pom.xml @@ -24,8 +24,4 @@ - - 3.8.0 - - \ No newline at end of file diff --git a/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoConfigExamplesIntegrationTest.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoConfigExamplesIntegrationTest.java index 5d3c009edc..b9df6a456c 100644 --- a/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoConfigExamplesIntegrationTest.java +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoConfigExamplesIntegrationTest.java @@ -7,8 +7,6 @@ import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; -import static org.mockito.Matchers.anyInt; -import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.*; public class MockitoConfigExamplesIntegrationTest { diff --git a/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoConfigExamplesUnitTest.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoConfigExamplesUnitTest.java index 389dc231c1..6a5f797b41 100644 --- a/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoConfigExamplesUnitTest.java +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoConfigExamplesUnitTest.java @@ -7,8 +7,6 @@ import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; -import static org.mockito.Matchers.anyInt; -import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.*; import com.baeldung.mockito.MyList; diff --git a/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoMockIntegrationTest.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoMockIntegrationTest.java index e8cbcc4e8c..944d41316d 100644 --- a/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoMockIntegrationTest.java +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoMockIntegrationTest.java @@ -4,7 +4,7 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.mockito.MockSettings; -import org.mockito.exceptions.verification.TooLittleActualInvocations; +import org.mockito.exceptions.verification.TooFewActualInvocations; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; @@ -42,7 +42,7 @@ public class MockitoMockIntegrationTest { when(listMock.add(anyString())).thenReturn(false); listMock.add(randomAlphabetic(6)); - thrown.expect(TooLittleActualInvocations.class); + thrown.expect(TooFewActualInvocations.class); thrown.expectMessage(containsString("myMock.add")); verify(listMock, times(2)).add(anyString()); diff --git a/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoMockUnitTest.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoMockUnitTest.java index e1d99f80a2..27af3d8d1e 100644 --- a/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoMockUnitTest.java +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoMockUnitTest.java @@ -2,8 +2,6 @@ package com.baeldung.mockito; import static org.mockito.Mockito.*; -import com.baeldung.mockito.MyList; - import static org.junit.Assert.assertThat; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.containsString; @@ -13,7 +11,7 @@ import org.junit.Test; import org.junit.Rule; import org.junit.rules.ExpectedException; import org.mockito.MockSettings; -import org.mockito.exceptions.verification.TooLittleActualInvocations; +import org.mockito.exceptions.verification.TooFewActualInvocations; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; @@ -45,7 +43,7 @@ public class MockitoMockUnitTest { when(listMock.add(anyString())).thenReturn(false); listMock.add(randomAlphabetic(6)); - thrown.expect(TooLittleActualInvocations.class); + thrown.expect(TooFewActualInvocations.class); thrown.expectMessage(containsString("myMock.add")); verify(listMock, times(2)).add(anyString()); diff --git a/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoVerifyExamplesIntegrationTest.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoVerifyExamplesIntegrationTest.java index b5075d7db2..6dfe7f9d6b 100644 --- a/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoVerifyExamplesIntegrationTest.java +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoVerifyExamplesIntegrationTest.java @@ -11,7 +11,6 @@ import java.util.List; import static org.hamcrest.Matchers.hasItem; import static org.junit.Assert.assertThat; -import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.*; public class MockitoVerifyExamplesIntegrationTest { @@ -35,7 +34,7 @@ public class MockitoVerifyExamplesIntegrationTest { @Test public final void givenNoInteractionWithMockOccurred_whenVerifyingInteractions_thenCorrect() { final List mockedList = mock(MyList.class); - verifyZeroInteractions(mockedList); + verifyNoInteractions(mockedList); } @Test diff --git a/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoVerifyExamplesUnitTest.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoVerifyExamplesUnitTest.java index ca09f77d2d..f138256e72 100644 --- a/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoVerifyExamplesUnitTest.java +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoVerifyExamplesUnitTest.java @@ -2,7 +2,6 @@ package com.baeldung.mockito; import com.google.common.collect.Lists; -import com.baeldung.mockito.MyList; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.InOrder; @@ -13,7 +12,6 @@ import java.util.List; import static org.hamcrest.Matchers.hasItem; import static org.junit.Assert.assertThat; -import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.*; public class MockitoVerifyExamplesUnitTest { @@ -37,7 +35,7 @@ public class MockitoVerifyExamplesUnitTest { @Test public final void givenNoInteractionWithMockOccurred_whenVerifyingInteractions_thenCorrect() { final List mockedList = mock(MyList.class); - verifyZeroInteractions(mockedList); + verifyNoInteractions(mockedList); } @Test diff --git a/testing-modules/mocks/pom.xml b/testing-modules/mocks/pom.xml index 3fabde037c..e25d6f3ce6 100644 --- a/testing-modules/mocks/pom.xml +++ b/testing-modules/mocks/pom.xml @@ -31,12 +31,6 @@ ${jukito.version} test - - org.mockito - mockito-core - ${mockito.version} - test - org.easymock easymock @@ -53,7 +47,6 @@ 0.15 1.5 - 2.21.0 3.5.1 1.41 1.1 diff --git a/testing-modules/mocks/src/test/java/com/baeldung/mockito/LoginControllerIntegrationTest.java b/testing-modules/mocks/src/test/java/com/baeldung/mockito/LoginControllerIntegrationTest.java index 98df2cf850..140720f608 100644 --- a/testing-modules/mocks/src/test/java/com/baeldung/mockito/LoginControllerIntegrationTest.java +++ b/testing-modules/mocks/src/test/java/com/baeldung/mockito/LoginControllerIntegrationTest.java @@ -40,7 +40,7 @@ public class LoginControllerIntegrationTest { public void assertThatNoMethodHasBeenCalled() { loginController.login(null); // no method called - Mockito.verifyZeroInteractions(loginService); + Mockito.verifyNoInteractions(loginService); } @Test @@ -85,7 +85,7 @@ public class LoginControllerIntegrationTest { Assert.assertEquals("ERROR", login); Mockito.verify(loginService) .login(userForm); - Mockito.verifyZeroInteractions(loginService); + Mockito.verifyNoInteractions(loginService); } @Test