feature/CSTACKEX-217: Mockito upgrade for supporting java21,17 and 11#80
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts the ONTAP storage-volume plugin’s Maven test dependency versions to align Mockito with the root build (to better support running tests on newer JDKs like Java 21), and updates the Byte Buddy agent version used by tests.
Changes:
- Switch ONTAP plugin Mockito dependencies to use the root
${cs.mockito.version}instead of module-local Mockito properties. - Bump
byte-buddy-agenttest dependency version to1.15.11. - Remove the module’s
mockito-inlinedependency and remove an explicitskipTests=falseconfiguration entry.
Comments suppressed due to low confidence (1)
plugins/storage/volume/ontap/pom.xml:120
Mockito.mockStatic(...)is used in this module's tests (e.g.,OntapPrimaryDatastoreProviderTest), but the POM no longer includesmockito-inline. Without the inline mock maker, static mocking will fail at runtime (Mockito will throw that the current MockMaker doesn't support static mocks). Re-addmockito-inlineas a test dependency (or provide amockito-extensions/org.mockito.plugins.MockMakerresource enablingmock-maker-inline).
<!-- Mockito -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${cs.mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${cs.mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
<version>${byte-buddy-agent.version}</version>
<scope>test</scope>
</dependency>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <httpclient.version>4.5.14</httpclient.version> | ||
| <swagger-annotations.version>1.6.2</swagger-annotations.version> | ||
| <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version> | ||
| <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version> |
There was a problem hiding this comment.
Let's align <maven-surefire-plugin.version>, <assertj.version> and <junit-jupiter.version> versions also with the root pom.xml for now.
There was a problem hiding this comment.
These are independent libraries from Mockito. They can be taken up later as part of internal upgrade story.
| <mockito.version>3.12.4</mockito.version> | ||
| <mockito-junit-jupiter.version>5.2.0</mockito-junit-jupiter.version> | ||
| <byte-buddy-agent.version>1.11.13</byte-buddy-agent.version> | ||
| <byte-buddy-agent.version>1.15.11</byte-buddy-agent.version> |
There was a problem hiding this comment.
no need to add this dependency explicitly. it should come with Mockito-core itself. Could u please check this once
Description
This PR...
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Ran UT with different Java versions.
JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64 mvn -pl plugins/storage/volume/ontap/ clean test - PASS
JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 mvn -pl plugins/storage/volume/ontap/ clean test - PASS
JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 mvn -T8 -P developer,systemvm clean install -Dnoredist -pl plugins/storage/volume/ontap/ - PASS
How did you try to break this feature and the system with this change?