Skip to content

feature/CSTACKEX-217: Mockito upgrade for supporting java21,17 and 11#80

Merged
piyush5netapp merged 1 commit into
mainfrom
feature/CSTACKEX-217
Jul 13, 2026
Merged

feature/CSTACKEX-217: Mockito upgrade for supporting java21,17 and 11#80
piyush5netapp merged 1 commit into
mainfrom
feature/CSTACKEX-217

Conversation

@piyush5netapp

@piyush5netapp piyush5netapp commented Jul 12, 2026

Copy link
Copy Markdown

Description

This PR...

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

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?

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-agent test dependency version to 1.15.11.
  • Remove the module’s mockito-inline dependency and remove an explicit skipTests=false configuration 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 includes mockito-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-add mockito-inline as a test dependency (or provide a mockito-extensions/org.mockito.plugins.MockMaker resource enabling mock-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.

@piyush5netapp piyush5netapp changed the title feature/CSTACKEX-217: Mockito upgrade for supporting java21 feature/CSTACKEX-217: Mockito upgrade for supporting java21,17 and 11 Jul 12, 2026
<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>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's align <maven-surefire-plugin.version>, <assertj.version> and <junit-jupiter.version> versions also with the root pom.xml for now.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to add this dependency explicitly. it should come with Mockito-core itself. Could u please check this once

@piyush5netapp piyush5netapp merged commit 5311795 into main Jul 13, 2026
20 checks passed
@piyush5netapp piyush5netapp added the cherry-pick for upstream PR This commit should be cherry-picked to upstream PR if raised. label Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick for upstream PR This commit should be cherry-picked to upstream PR if raised.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants