This is an automated email from the ASF dual-hosted git repository.

baedke pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 93821e4c78 OAK-11975: Use Mockito as an agent in Oak (#2653)
93821e4c78 is described below

commit 93821e4c78907aa2b5882ec4b09c4cdba9115d3e
Author: mbaedke <[email protected]>
AuthorDate: Thu Feb 12 11:24:59 2026 +0100

    OAK-11975: Use Mockito as an agent in Oak (#2653)
    
    Replaced the dynamic inline mocking with a static agent dependency.
---
 oak-api/pom.xml         |  5 +++++
 oak-benchmarks/pom.xml  |  4 ++++
 oak-blob/pom.xml        |  5 +++++
 oak-http/pom.xml        |  5 +++++
 oak-it-osgi/pom.xml     |  5 +++++
 oak-parent/pom.xml      | 17 +++++++++++++++--
 oak-segment-tar/pom.xml |  6 ++++++
 oak-upgrade/pom.xml     |  5 +++++
 8 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/oak-api/pom.xml b/oak-api/pom.xml
index 1aeb08627f..e8fe5777ae 100644
--- a/oak-api/pom.xml
+++ b/oak-api/pom.xml
@@ -84,5 +84,10 @@
       <artifactId>junit</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
diff --git a/oak-benchmarks/pom.xml b/oak-benchmarks/pom.xml
index 02ce5cbfda..41d79b2bca 100644
--- a/oak-benchmarks/pom.xml
+++ b/oak-benchmarks/pom.xml
@@ -222,6 +222,10 @@
             <groupId>ch.qos.logback</groupId>
             <artifactId>logback-classic</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+        </dependency>
     </dependencies>
 
     <profiles>
diff --git a/oak-blob/pom.xml b/oak-blob/pom.xml
index f850091860..ea85f05814 100644
--- a/oak-blob/pom.xml
+++ b/oak-blob/pom.xml
@@ -150,6 +150,11 @@
       <artifactId>logback-classic</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
 </project>
diff --git a/oak-http/pom.xml b/oak-http/pom.xml
index 8dfe302b8f..c5c3caa7ab 100644
--- a/oak-http/pom.xml
+++ b/oak-http/pom.xml
@@ -89,5 +89,10 @@
       <artifactId>junit</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>
diff --git a/oak-it-osgi/pom.xml b/oak-it-osgi/pom.xml
index 6e18f8984e..fbd3970413 100644
--- a/oak-it-osgi/pom.xml
+++ b/oak-it-osgi/pom.xml
@@ -300,6 +300,11 @@
       <artifactId>metrics-core</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
 </project>
diff --git a/oak-parent/pom.xml b/oak-parent/pom.xml
index 231b5afe67..716bd6e4f9 100644
--- a/oak-parent/pom.xml
+++ b/oak-parent/pom.xml
@@ -259,10 +259,20 @@
             <consoleOutput>true</consoleOutput>
           </configuration>
         </plugin>
+        <plugin>
+          <artifactId>maven-dependency-plugin</artifactId>
+          <executions>
+            <execution>
+              <goals>
+                <goal>properties</goal>
+              </goals>
+            </execution>
+          </executions>
+        </plugin>
         <plugin>
           <artifactId>maven-surefire-plugin</artifactId>
           <configuration>
-            <argLine>${test.opts}</argLine>
+            <argLine>${test.opts} 
-javaagent:${org.mockito:mockito-core:jar}</argLine>
             <trimStackTrace>false</trimStackTrace>
             <useModulePath>false</useModulePath>
             <systemPropertyVariables>
@@ -286,7 +296,7 @@
         <plugin>
           <artifactId>maven-failsafe-plugin</artifactId>
           <configuration>
-            <argLine>${test.opts}</argLine>
+            <argLine>${test.opts} 
-javaagent:${org.mockito:mockito-core:jar}</argLine>
             <trimStackTrace>false</trimStackTrace>
             <useModulePath>false</useModulePath>
             <systemPropertyVariables>
@@ -354,6 +364,9 @@
       </plugins>
     </pluginManagement>
     <plugins>
+      <plugin>
+        <artifactId>maven-dependency-plugin</artifactId>
+      </plugin>
       <plugin>
         <groupId>org.jacoco</groupId>
         <artifactId>jacoco-maven-plugin</artifactId>
diff --git a/oak-segment-tar/pom.xml b/oak-segment-tar/pom.xml
index 269212dede..afd8d0cdf2 100644
--- a/oak-segment-tar/pom.xml
+++ b/oak-segment-tar/pom.xml
@@ -122,6 +122,12 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-dependency-plugin</artifactId>
                 <executions>
+                    <execution>
+                        <id>properties</id>
+                        <goals>
+                            <goal>properties</goal>
+                        </goals>
+                    </execution>
                     <execution>
                         <phase>pre-integration-test</phase>
                         <goals><goal>copy</goal></goals>
diff --git a/oak-upgrade/pom.xml b/oak-upgrade/pom.xml
index 8f776ce7b2..117f0fcebc 100644
--- a/oak-upgrade/pom.xml
+++ b/oak-upgrade/pom.xml
@@ -247,6 +247,11 @@
       <version>${project.version}</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <scope>test</scope>
+    </dependency>
 
     <!-- test dependency of classic Jackrabbit -->
     <dependency>

Reply via email to