Skip to content

Commit

Permalink
JAVA-32410: Update mockito-core to version 5.11.0 (eugenp#16199)
Browse files Browse the repository at this point in the history
* JAVA-32410: Update mockito-core to version 5.11.0

* Fix rollback mockito upgrade.

* wip

* WIP: Update jee-7 wildfly versions

* WIP: Fix jersey tests

* WIP: rollback powermock module

* wip: fix test in spring-data-dynamodb

* wip: fix test in spring-security-legacy-oidc

* wip: rollback quarkus

* wip: fix greeter-spring-boot-autoconfigure

* JAVA-33535: Fix spring-core module integration test

JAVA-33535: rollback junit-5 module mockito version.

* Fix byte-buddy

* Fix log4j dependency in apache-poi
  • Loading branch information
harry9656 authored Apr 10, 2024
1 parent f1af9d5 commit 4394e82
Show file tree
Hide file tree
Showing 31 changed files with 102 additions and 80 deletions.
11 changes: 11 additions & 0 deletions apache-poi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@
<artifactId>fastexcel-reader</artifactId>
<version>${fastexcel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
</dependency>
</dependencies>

<build>
Expand All @@ -64,6 +74,7 @@
<jexcel.version>1.0.9</jexcel.version>
<fastexcel.version>0.17.0</fastexcel.version>
<maven.resources.plugin.version>3.3.1</maven.resources.plugin.version>
<log4j.version>2.23.1</log4j.version>
</properties>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito-core.version}</version>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -112,7 +112,6 @@
<feign-core.version>11.2</feign-core.version>
<guice.version>5.1.0</guice.version>
<system-stubs-junit4.version>2.0.2</system-stubs-junit4.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>
Expand Down
1 change: 0 additions & 1 deletion core-java-modules/core-java-jar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@
<!-- util -->
<unix4j.version>0.4</unix4j.version>
<grep4j.version>1.8.7</grep4j.version>
<mockito.version>4.6.1</mockito.version>
<!-- maven plugins -->
<javamoney.moneta.version>1.1</javamoney.moneta.version>
<maven-javadoc-plugin.version>3.6.2</maven-javadoc-plugin.version>
Expand Down
7 changes: 6 additions & 1 deletion graphql-modules/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<!-- Boot version compatible with spqr-boot-starter -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.6.4</version>
<version>2.6.15</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -34,4 +34,9 @@
<module>graphql-spqr-boot-starter</module>
</modules>

<properties>
<!-- Can't update to the recent mockito version, without updating the spring boot version-->
<mockito.version>4.4.0</mockito.version>
</properties>

</project>
3 changes: 2 additions & 1 deletion libraries-http-2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>${mockito.version}</version>
<version>${mockito-inline.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -120,6 +120,7 @@
<reactive.stream.version>1.0.3</reactive.stream.version>
<reactor.version>3.6.0</reactor.version>
<jmockit.version>1.49</jmockit.version>
<mockito-inline.version>5.2.0</mockito-inline.version>
</properties>

</project>
3 changes: 1 addition & 2 deletions messaging-modules/spring-jms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito-core.version}</version>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -83,7 +83,6 @@
<activemq.version>5.14.1</activemq.version>
<spring-boot-test.version>1.5.10.RELEASE</spring-boot-test.version>
<maven-war-plugin.version>3.3.2</maven-war-plugin.version>
<mockito-core.version>4.6.1</mockito-core.version>
<activemq-junit.version>5.16.5</activemq-junit.version>
<testcontainers.version>1.17.3</testcontainers.version>
<junit-jupiter.version>5.10.1</junit-jupiter.version>
Expand Down
6 changes: 5 additions & 1 deletion patterns-modules/design-patterns-creational-2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>${mockito.version}</version>
<version>${mockito-inline.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<properties>
<mockito-inline.version>5.2.0</mockito-inline.version>
</properties>

</project>
1 change: 0 additions & 1 deletion persistence-modules/spring-boot-persistence/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
</dependencies>

<properties>
<mockito.version>2.23.0</mockito.version>
<validation-api.version>2.0.1.Final</validation-api.version>
<mysql-connector-java.version>8.2.0</mysql-connector-java.version>
<start-class>com.baeldung.boot.Application</start-class>
Expand Down
6 changes: 6 additions & 0 deletions persistence-modules/spring-data-dynamodb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@
<type>so</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.14.13</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import com.baeldung.Application;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
public class SpringContextTest {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@
<assertj.version>3.21.0</assertj.version>
<hamcrest.version>2.2</hamcrest.version>
<hamcrest-all.version>1.3</hamcrest-all.version>
<mockito.version>4.4.0</mockito.version>
<mockito.version>5.11.0</mockito.version>
<byte-buddy.version>1.14.11</byte-buddy.version>

<!-- logging -->
Expand Down
3 changes: 1 addition & 2 deletions quarkus-modules/quarkus-virtual-threads/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
<surefire-plugin.version>3.0.0</surefire-plugin.version>
<loom-unit.version>0.3.0</loom-unit.version>
<panache-common-deployment.version>3.6.0</panache-common-deployment.version>
<mockito-core.version>3.11.2</mockito-core.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -92,7 +91,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito-core.version}</version>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion quarkus-modules/quarkus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@

<properties>
<quarkus.version>2.16.3.Final</quarkus.version>
<mockito.version>3.3.0</mockito.version>
<mockito.version>4.4.0</mockito.version> <!-- Current quarkus doesn't support latest version. If Upgrading to a new quarkus remove this. -->
</properties>

</project>
1 change: 1 addition & 0 deletions spring-aop-2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
<version>${spring-boot.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>${byte-buddy.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand All @@ -61,6 +67,7 @@
<properties>
<spring-boot.version>2.2.6.RELEASE</spring-boot.version>
<greeter.version>0.0.1-SNAPSHOT</greeter.version>
<byte-buddy.version>1.14.13</byte-buddy.version>
</properties>

</project>
4 changes: 1 addition & 3 deletions spring-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
<version>${mockito.spring.boot.version}</version>
<version>${spring-boot.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -78,10 +78,8 @@
</build>

<properties>
<mockito.spring.boot.version>1.4.4.RELEASE</mockito.spring.boot.version>
<javax.inject.version>1</javax.inject.version>
<spring-boot.version>1.5.2.RELEASE</spring-boot.version>
<mockito.version>1.10.19</mockito.version>
<annotation-api.version>1.3.2</annotation-api.version>
</properties>

Expand Down
1 change: 0 additions & 1 deletion spring-ejb-modules/ejb-beans/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@
<springframework.version>5.2.3.RELEASE</springframework.version>
<activemq-broker.version>5.16.3</activemq-broker.version>
<activemq-junit.version>5.16.3</activemq-junit.version>
<mockito.version>2.21.0</mockito.version>
<maven-dependency-plugin.version>2.8</maven-dependency-plugin.version>
<wildfly-ejb.version>8.2.1.Final</wildfly-ejb.version>
<joda-time.version>2.12.5</joda-time.version>
Expand Down
6 changes: 6 additions & 0 deletions spring-security-modules/spring-security-legacy-oidc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
<artifactId>jwks-rsa</artifactId>
<version>${jwks-rsa.version}</version>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.14.13</version>
<scope>test</scope>
</dependency>
</dependencies>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
<junit.jupiter.engine.version>5.9.3</junit.jupiter.engine.version>
<mockito.version>5.3.1</mockito.version>
<thymeleaf.spring6.version>3.1.1.RELEASE</thymeleaf.spring6.version>
<spring.boot.starter.thymeleaf>3.1.1</spring.boot.starter.thymeleaf>
</properties>
Expand Down
3 changes: 1 addition & 2 deletions testing-modules/junit-5-basics-2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito-core.version}</version>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -42,7 +42,6 @@

<properties>
<junit-jupiter-api.version>5.10.0</junit-jupiter-api.version>
<mockito-core.version>5.5.0</mockito-core.version>
</properties>

</project>
7 changes: 1 addition & 6 deletions testing-modules/junit-5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -135,7 +130,7 @@
<log4j2.version>2.17.1</log4j2.version>
<powermock.version>2.0.9</powermock.version>
<spring.version>5.0.1.RELEASE</spring.version>
<mockito.version>3.3.0</mockito.version>
<mockito.version>3.3.0</mockito.version> <!-- Cannot Upgrade to recent versions. Powermock doesn't support it -->
</properties>

</project>
2 changes: 1 addition & 1 deletion testing-modules/mockito-2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@

<properties>
<mockito-inline.version>4.8.1</mockito-inline.version>
<mockito.version>5.10.0</mockito.version>
<lombok.version>1.18.30</lombok.version>

</properties>

</project>
1 change: 0 additions & 1 deletion testing-modules/mockito-simple/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@

<properties>
<spring-framework.version>6.0.8</spring-framework.version>
<mockito.version>5.3.1</mockito.version>
</properties>

</project>
2 changes: 1 addition & 1 deletion testing-modules/powermock/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</build>

<properties>
<mockito.version>2.21.0</mockito.version>
<mockito.version>2.21.0</mockito.version> <!--Cannot upgrade to the latest version as powermock doesn't support that-->
<powermock.version>2.0.9</powermock.version>
</properties>

Expand Down
5 changes: 2 additions & 3 deletions web-modules/jakarta-ee/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
Expand Down Expand Up @@ -100,11 +100,10 @@
<jakartaee-api.version>9.0.0</jakartaee-api.version>
<krazo.version>2.0.0</krazo.version>
<jakarta.mvc-api.version>2.0.0</jakarta.mvc-api.version>
<junit.jupiter.version>5.8.2</junit.jupiter.version>
<junit.jupiter.version>5.10.2</junit.jupiter.version>
<local.glassfish.home>C:/glassfish6</local.glassfish.home>
<local.glassfish.user>admin</local.glassfish.user>
<local.glassfish.domain>mvn-domain</local.glassfish.domain>
<mockito.version>1.10.19</mockito.version>
<local.glassfish.passfile>
${local.glassfish.home}\\domains\\${local.glassfish.domain}\\config\\domain-passwords
</local.glassfish.passfile>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
package com.baeldung.eclipse.krazo;

import com.baeldung.eclipse.krazo.User;
import com.baeldung.eclipse.krazo.UserController;
import jakarta.mvc.Models;
import jakarta.mvc.binding.BindingResult;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.when;

import org.eclipse.krazo.core.ModelsImpl;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;

import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.when;
import jakarta.mvc.Models;
import jakarta.mvc.binding.BindingResult;

/**
* The class contains unit tests. We do only unit tests. Most of the classes are mocked
Expand Down
1 change: 0 additions & 1 deletion web-modules/javax-servlets-2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
<jetty-maven-plugin.version>10.0.4</jetty-maven-plugin.version>
<commons-text.version>1.10.0</commons-text.version>
<mockito.version>5.6.0</mockito.version>
<uap.version>1.5.4</uap.version>
</properties>

Expand Down
Loading

0 comments on commit 4394e82

Please sign in to comment.