This is an automated email from the ASF dual-hosted git repository. baedke pushed a commit to branch OAK-11975 in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
commit 0f38db645f8b0c504f4da44f886643f99fde1a0c Author: Manfred Baedke <[email protected]> AuthorDate: Mon Dec 8 19:44:09 2025 +0100 OAK-11975: Use Mockito as an agent in Oak 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 92bd0504ee..0a81fbebb0 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 495c7be601..7621885a9d 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 131a886d4a..965f25972b 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 f2941eb0c5..ee1f6478e5 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 04dd800437..540661c909 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 e8bab71210..081dd9636a 100644 --- a/oak-parent/pom.xml +++ b/oak-parent/pom.xml @@ -261,10 +261,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> <systemPropertyVariables> <!-- evaluated in oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/util/KnownIssuesIgnoreRule.java (JUnit4) and @@ -287,7 +297,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> <systemPropertyVariables> <!-- evaluated in oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/util/KnownIssuesIgnoreRule.java (JUnit4) and @@ -359,6 +369,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 6e6ccbd0e9..f22bcb4160 100644 --- a/oak-segment-tar/pom.xml +++ b/oak-segment-tar/pom.xml @@ -123,6 +123,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 eb046c83d5..6d23ce3ee9 100644 --- a/oak-upgrade/pom.xml +++ b/oak-upgrade/pom.xml @@ -242,6 +242,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>
