Merge pull request #11585 from chaos2418/JAVA-3591
JAVA-3591: updating mockito-core to 4.1.0
This commit is contained in:
commit
514e80aae7
|
@ -111,7 +111,7 @@
|
|||
<feign-core.version>11.2</feign-core.version>
|
||||
<guice.version>5.0.1</guice.version>
|
||||
<system-stubs-junit4.version>1.2.0</system-stubs-junit4.version>
|
||||
<mockito-core.version>3.3.0</mockito-core.version>
|
||||
<mockito-core.version>4.1.0</mockito-core.version>
|
||||
<assertj-core.version>3.19.0</assertj-core.version>
|
||||
<junit-jupiter.version>5.8.1</junit-jupiter.version>
|
||||
</properties>
|
||||
|
|
|
@ -20,12 +20,6 @@
|
|||
<artifactId>aws-java-sdk</artifactId>
|
||||
<version>${aws-java-sdk.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>${mockito-core.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.amazonaws</groupId>
|
||||
<artifactId>aws-lambda-java-core</artifactId>
|
||||
|
@ -111,7 +105,6 @@
|
|||
<aws-lambda-java-core.version>1.1.0</aws-lambda-java-core.version>
|
||||
<gson.version>2.8.0</gson.version>
|
||||
<aws-java-sdk.version>1.11.290</aws-java-sdk.version>
|
||||
<mockito-core.version>2.21.0</mockito-core.version>
|
||||
<dynamodblocal.version>1.11.86</dynamodblocal.version>
|
||||
<dynamodblocal.repository.url>https://s3-us-west-2.amazonaws.com/dynamodb-local/release</dynamodblocal.repository.url>
|
||||
<commons-codec-version>1.10.L001</commons-codec-version>
|
||||
|
|
|
@ -43,12 +43,6 @@
|
|||
<version>${mockito-inline.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>${mockito-inline.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jmockit</groupId>
|
||||
<artifactId>jmockit</artifactId>
|
||||
|
@ -85,7 +79,7 @@
|
|||
<lombok.version>1.18.22</lombok.version>
|
||||
<asspectj.version>1.8.9</asspectj.version>
|
||||
<jmockit.version>1.44</jmockit.version>
|
||||
<mockito-inline.version>4.0.0</mockito-inline.version>
|
||||
<mockito-inline.version>4.1.0</mockito-inline.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -86,11 +86,6 @@
|
|||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.flapdoodle.embed</groupId>
|
||||
<artifactId>de.flapdoodle.embed.mongo</artifactId>
|
||||
|
|
|
@ -191,7 +191,6 @@
|
|||
<ethereumj-core.version>1.5.0-RELEASE</ethereumj-core.version>
|
||||
<web3j.core.version>3.3.1</web3j.core.version>
|
||||
<spring.boot.version>1.5.6.RELEASE</spring.boot.version>
|
||||
<mockito.version>2.21.0</mockito.version>
|
||||
<jsonpath.version>2.4.0</jsonpath.version>
|
||||
<spring-boot-maven-plugin.version>2.0.4.RELEASE</spring-boot-maven-plugin.version>
|
||||
<compiler.plugin.version>3.1</compiler.plugin.version>
|
||||
|
|
|
@ -40,11 +40,6 @@
|
|||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.platform</groupId>
|
||||
<artifactId>junit-platform-engine</artifactId>
|
||||
|
|
|
@ -36,11 +36,6 @@
|
|||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -37,11 +37,6 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
|
|
|
@ -76,12 +76,6 @@
|
|||
<scope>test</scope>
|
||||
<version>${spring-boot-starter.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>${mockito.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
|
@ -94,8 +88,6 @@
|
|||
<spring-data-jpa.version>2.2.7.RELEASE</spring-data-jpa.version>
|
||||
<!-- simple-jndi -->
|
||||
<simple-jndi.version>0.23.0</simple-jndi.version>
|
||||
<!-- test scoped -->
|
||||
<mockito.version>3.3.3</mockito.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
2
pom.xml
2
pom.xml
|
@ -1416,7 +1416,7 @@
|
|||
<assertj.version>3.21.0</assertj.version>
|
||||
<hamcrest.version>2.2</hamcrest.version>
|
||||
<hamcrest-all.version>1.3</hamcrest-all.version>
|
||||
<mockito.version>3.3.0</mockito.version>
|
||||
<mockito.version>4.1.0</mockito.version>
|
||||
<byte-buddy.version>1.11.20</byte-buddy.version>
|
||||
|
||||
<!-- logging -->
|
||||
|
|
|
@ -37,6 +37,12 @@
|
|||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>${mockito.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
@ -94,6 +100,11 @@
|
|||
<artifactId>rest-assured</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -172,6 +183,7 @@
|
|||
<properties>
|
||||
<quarkus.version>1.7.0.Final</quarkus.version>
|
||||
<lombok.version>1.18.6</lombok.version>
|
||||
<mockito.version>3.3.0</mockito.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -94,7 +94,7 @@
|
|||
<dependency>
|
||||
<groupId>com.github.tomakehurst</groupId>
|
||||
<artifactId>wiremock-standalone</artifactId>
|
||||
<version>2.26.0</version>
|
||||
<version>${wiremock-standalone.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -110,13 +110,13 @@
|
|||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-junit-jupiter</artifactId>
|
||||
<version>2.23.0</version>
|
||||
<version>${mockito.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.projectreactor</groupId>
|
||||
<artifactId>reactor-test</artifactId>
|
||||
<version>3.2.10.RELEASE</version>
|
||||
<version>${reactor-test.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -192,5 +192,7 @@
|
|||
<geronimo-json_1.1_spec.version>1.0</geronimo-json_1.1_spec.version>
|
||||
<jetty-reactive-httpclient.version>1.1.6</jetty-reactive-httpclient.version>
|
||||
<okhttp.version>4.0.1</okhttp.version>
|
||||
<reactor-test.version>3.2.10.RELEASE</reactor-test.version>
|
||||
<wiremock-standalone.version>2.26.0</wiremock-standalone.version>
|
||||
</properties>
|
||||
</project>
|
|
@ -32,11 +32,6 @@
|
|||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -33,11 +33,6 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
|
|
|
@ -27,11 +27,6 @@
|
|||
<artifactId>spring-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -129,11 +129,6 @@
|
|||
<artifactId>spring-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- ShedLock -->
|
||||
<dependency>
|
||||
<groupId>net.javacrumbs.shedlock</groupId>
|
||||
|
|
|
@ -28,8 +28,4 @@
|
|||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<mockito.version>2.24.0</mockito.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -115,12 +115,6 @@
|
|||
<artifactId>commons-lang3</artifactId>
|
||||
<version>${commons-lang3.version}</version>
|
||||
</dependency>
|
||||
<!-- test scoped -->
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -181,11 +181,6 @@
|
|||
<artifactId>spring-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -119,12 +119,6 @@
|
|||
<artifactId>okhttp</artifactId>
|
||||
<version>${com.squareup.okhttp3.version}</version>
|
||||
</dependency>
|
||||
<!-- test scoped -->
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
|
|
|
@ -165,11 +165,6 @@
|
|||
<artifactId>spring-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -16,6 +16,17 @@
|
|||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>${mockito.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.junit.platform</groupId>
|
||||
|
@ -76,7 +87,7 @@
|
|||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-junit-jupiter</artifactId>
|
||||
<version>${mockito.junit.jupiter.version}</version>
|
||||
<version>${mockito.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -85,6 +96,11 @@
|
|||
<version>${powermock.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -119,11 +135,11 @@
|
|||
</build>
|
||||
|
||||
<properties>
|
||||
<mockito.junit.jupiter.version>2.23.0</mockito.junit.jupiter.version>
|
||||
<log4j2.version>2.8.2</log4j2.version>
|
||||
<powermock.version>2.0.0</powermock.version>
|
||||
<powermock.version>2.0.9</powermock.version>
|
||||
<spring.version>5.0.1.RELEASE</spring.version>
|
||||
<surefire.report.plugin>3.0.0-M3</surefire.report.plugin>
|
||||
<mockito.version>3.3.0</mockito.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -29,8 +29,4 @@
|
|||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<mockito.version>2.21.0</mockito.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -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)
|
||||
|
|
|
@ -24,8 +24,4 @@
|
|||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<mockito.version>3.8.0</mockito.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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<String> mockedList = mock(MyList.class);
|
||||
verifyZeroInteractions(mockedList);
|
||||
verifyNoInteractions(mockedList);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -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<String> mockedList = mock(MyList.class);
|
||||
verifyZeroInteractions(mockedList);
|
||||
verifyNoInteractions(mockedList);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -31,12 +31,6 @@
|
|||
<version>${jukito.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>${mockito.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.easymock</groupId>
|
||||
<artifactId>easymock</artifactId>
|
||||
|
@ -53,7 +47,6 @@
|
|||
<properties>
|
||||
<javafaker.version>0.15</javafaker.version>
|
||||
<jukito.version>1.5</jukito.version>
|
||||
<mockito.version>2.21.0</mockito.version>
|
||||
<easymock.version>3.5.1</easymock.version>
|
||||
<jmockit.version>1.41</jmockit.version>
|
||||
<jimf.version>1.1</jimf.version>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue