diff --git a/jhipster/jhipster-microservice/gateway-app/src/test/java/com/gateway/web/rest/AccountResourceIntegrationTest.java b/jhipster/jhipster-microservice/gateway-app/src/test/java/com/gateway/web/rest/AccountResourceIntegrationTest.java index 607c69ebd1..6eab576561 100644 --- a/jhipster/jhipster-microservice/gateway-app/src/test/java/com/gateway/web/rest/AccountResourceIntegrationTest.java +++ b/jhipster/jhipster-microservice/gateway-app/src/test/java/com/gateway/web/rest/AccountResourceIntegrationTest.java @@ -26,7 +26,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.*; import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Matchers.anyObject; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.when; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; @@ -64,7 +64,7 @@ public class AccountResourceIntegrationTest { @Before public void setup() { MockitoAnnotations.initMocks(this); - doNothing().when(mockMailService).sendActivationEmail(anyObject()); + doNothing().when(mockMailService).sendActivationEmail(any()); AccountResource accountResource = new AccountResource(userRepository, userService, mockMailService); diff --git a/jhipster/jhipster-monolithic/src/test/java/com/baeldung/web/rest/AccountResourceIntegrationTest.java b/jhipster/jhipster-monolithic/src/test/java/com/baeldung/web/rest/AccountResourceIntegrationTest.java index 9644ae488c..a6a104ba63 100644 --- a/jhipster/jhipster-monolithic/src/test/java/com/baeldung/web/rest/AccountResourceIntegrationTest.java +++ b/jhipster/jhipster-monolithic/src/test/java/com/baeldung/web/rest/AccountResourceIntegrationTest.java @@ -26,7 +26,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.*; import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Matchers.anyObject; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.when; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; @@ -64,7 +64,7 @@ public class AccountResourceIntegrationTest { @Before public void setup() { MockitoAnnotations.initMocks(this); - doNothing().when(mockMailService).sendActivationEmail(anyObject()); + doNothing().when(mockMailService).sendActivationEmail(any()); AccountResource accountResource = new AccountResource(userRepository, userService, mockMailService); diff --git a/parent-boot-2/pom.xml b/parent-boot-2/pom.xml index 72aea5e81c..109bf3b64f 100644 --- a/parent-boot-2/pom.xml +++ b/parent-boot-2/pom.xml @@ -90,8 +90,6 @@ 1.0.22.RELEASE 2.6.1 1.9.1 - - 3.4.0 \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-annotations/src/test/java/com/baeldung/boot/ddd/event/AggregateEventsIntegrationTest.java b/persistence-modules/spring-data-jpa-annotations/src/test/java/com/baeldung/boot/ddd/event/AggregateEventsIntegrationTest.java index ac607063b2..5481d4644d 100644 --- a/persistence-modules/spring-data-jpa-annotations/src/test/java/com/baeldung/boot/ddd/event/AggregateEventsIntegrationTest.java +++ b/persistence-modules/spring-data-jpa-annotations/src/test/java/com/baeldung/boot/ddd/event/AggregateEventsIntegrationTest.java @@ -3,7 +3,7 @@ package com.baeldung.boot.ddd.event; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoInteractions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; @@ -51,7 +51,7 @@ class AggregateEventsIntegrationTest { .domainOperation(); // then - verifyZeroInteractions(eventHandler); + verifyNoInteractions(eventHandler); } @BeforeEach diff --git a/spring-boot-modules/spring-boot-client/src/test/java/com/baeldung/websocket/client/MyStompSessionHandlerIntegrationTest.java b/spring-boot-modules/spring-boot-client/src/test/java/com/baeldung/websocket/client/MyStompSessionHandlerIntegrationTest.java index 57eec935f6..956892729e 100644 --- a/spring-boot-modules/spring-boot-client/src/test/java/com/baeldung/websocket/client/MyStompSessionHandlerIntegrationTest.java +++ b/spring-boot-modules/spring-boot-client/src/test/java/com/baeldung/websocket/client/MyStompSessionHandlerIntegrationTest.java @@ -14,6 +14,6 @@ public class MyStompSessionHandlerIntegrationTest { MyStompSessionHandler sessionHandler = new MyStompSessionHandler(); sessionHandler.afterConnected(mockSession, mockHeader); Mockito.verify(mockSession).subscribe("/topic/messages", sessionHandler); - Mockito.verify(mockSession).send(Mockito.anyString(), Mockito.anyObject()); + Mockito.verify(mockSession).send(Mockito.anyString(), Mockito.any()); } } diff --git a/spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/mock/EmployeeServiceUnitTest.java b/spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/mock/EmployeeServiceUnitTest.java index 9a992f390a..6e2072efe3 100644 --- a/spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/mock/EmployeeServiceUnitTest.java +++ b/spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/mock/EmployeeServiceUnitTest.java @@ -9,7 +9,7 @@ import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; 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 140720f608..a42e6ae5e8 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 @@ -85,7 +85,7 @@ public class LoginControllerIntegrationTest { Assert.assertEquals("ERROR", login); Mockito.verify(loginService) .login(userForm); - Mockito.verifyNoInteractions(loginService); + Mockito.verifyNoMoreInteractions(loginService); } @Test