Merge pull request #11609 from chaos2418/JAVA-3591
JAVA-3591: updating mockito version in parent-boot-2
This commit is contained in:
commit
58eb7f641a
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -90,8 +90,6 @@
|
|||
<thin.version>1.0.22.RELEASE</thin.version>
|
||||
<spring-boot.version>2.6.1</spring-boot.version>
|
||||
<aspectjweaver.version>1.9.1</aspectjweaver.version>
|
||||
<!-- this property can be removed once we update Mockito version in the main pom.xml -->
|
||||
<mockito.version>3.4.0</mockito.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -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
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -85,7 +85,7 @@ public class LoginControllerIntegrationTest {
|
|||
Assert.assertEquals("ERROR", login);
|
||||
Mockito.verify(loginService)
|
||||
.login(userForm);
|
||||
Mockito.verifyNoInteractions(loginService);
|
||||
Mockito.verifyNoMoreInteractions(loginService);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue