Skip to content

Commit d9263c9

Browse files
committed
OAK-12251: Consolidate test-scoped dependencies (Mockito, JUnit extras)
- Add mockito.version property (5.20.0); use it in dependencyManagement; add test scope to mockito-core, easymock, slf4j-simple - Add mockito transitives to dependencyManagement: byte-buddy, objenesis, asm - Add Pax OSGi transitives to dependencyManagement: pax-swissbox-tracker, tinybundles, pax-url-commons - Add junit-addons and mockserver-junit-rule-no-dependencies to dependencyManagement with test scope - Group all test dependencies at the bottom of oak-parent dependencyManagement - Remove now-redundant explicit versions from modules: junit-addons (oak-jcr, oak-store-document), testcontainers (oak-store-document), mockserver (oak-segment-azure), system-rules (oak-lucene, oak-run-commons, oak-run, oak-search-elastic) - oak-store-composite: remove pax-exam 4.13.1 pin (OAK-12022); 4.14.0 passes all tests
1 parent a9f1f9e commit d9263c9

9 files changed

Lines changed: 120 additions & 66 deletions

File tree

oak-jcr/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,6 @@
505505
<dependency>
506506
<groupId>junit-addons</groupId>
507507
<artifactId>junit-addons</artifactId>
508-
<version>1.4</version>
509508
<scope>test</scope>
510509
<exclusions>
511510
<exclusion>

oak-lucene/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,6 @@
460460
<dependency>
461461
<groupId>com.github.stefanbirkner</groupId>
462462
<artifactId>system-rules</artifactId>
463-
<version>1.19.0</version>
464463
<scope>test</scope>
465464
</dependency>
466465
</dependencies>

oak-parent/pom.xml

Lines changed: 120 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
<groovy.version>3.0.25</groovy.version>
7272
<netty.version>4.1.135.Final</netty.version>
7373
<aws.sdk.version>2.34.9</aws.sdk.version>
74+
<mockito.version>5.20.0</mockito.version>
7475
<!-- determines the bytecode version (i.e. the minimum JRE required to run the build artifact) -->
7576
<javaTargetVersion>17</javaTargetVersion>
7677
<maven.compiler.release>${javaTargetVersion}</maven.compiler.release>
@@ -551,49 +552,16 @@
551552
<version>26.0.2-1</version>
552553
<scope>provided</scope>
553554
</dependency>
554-
<dependency>
555-
<groupId>junit</groupId>
556-
<artifactId>junit</artifactId>
557-
<version>4.13.1</version>
558-
</dependency>
559-
<dependency>
560-
<groupId>org.hamcrest</groupId>
561-
<artifactId>hamcrest</artifactId>
562-
<version>3.0</version>
563-
<scope>test</scope>
564-
</dependency>
565-
<dependency>
566-
<groupId>org.junit</groupId>
567-
<artifactId>junit-bom</artifactId>
568-
<version>5.14.2</version>
569-
<type>pom</type>
570-
<scope>import</scope>
571-
</dependency>
572555
<dependency>
573556
<groupId>org.mongodb</groupId>
574557
<artifactId>mongodb-driver-sync</artifactId>
575558
<version>${mongo.driver.version}</version>
576559
</dependency>
577-
<dependency>
578-
<groupId>org.easymock</groupId>
579-
<artifactId>easymock</artifactId>
580-
<version>5.6.0</version>
581-
</dependency>
582-
<dependency>
583-
<groupId>org.mockito</groupId>
584-
<artifactId>mockito-core</artifactId>
585-
<version>5.20.0</version>
586-
</dependency>
587560
<dependency>
588561
<groupId>org.slf4j</groupId>
589562
<artifactId>slf4j-api</artifactId>
590563
<version>${slf4j.api.version}</version>
591564
</dependency>
592-
<dependency>
593-
<groupId>org.slf4j</groupId>
594-
<artifactId>slf4j-simple</artifactId>
595-
<version>${slf4j.version}</version>
596-
</dependency>
597565
<dependency>
598566
<groupId>org.slf4j</groupId>
599567
<artifactId>log4j-over-slf4j</artifactId>
@@ -624,18 +592,6 @@
624592
<artifactId>aws-s3</artifactId>
625593
<version>2.0.3</version>
626594
</dependency>
627-
<dependency>
628-
<groupId>org.apache.sling</groupId>
629-
<artifactId>org.apache.sling.testing.osgi-mock.junit4</artifactId>
630-
<version>2.4.18</version>
631-
<scope>test</scope>
632-
</dependency>
633-
<dependency>
634-
<groupId>org.apache.sling</groupId>
635-
<artifactId>org.apache.sling.testing.osgi-mock.core</artifactId>
636-
<version>2.4.18</version>
637-
<scope>test</scope>
638-
</dependency>
639595
<dependency>
640596
<groupId>org.apache.commons</groupId>
641597
<artifactId>commons-collections4</artifactId>
@@ -756,13 +712,6 @@
756712
<artifactId>httpmime</artifactId>
757713
<version>4.5.14</version>
758714
</dependency>
759-
<!-- Testcontainers dependency -->
760-
<dependency>
761-
<groupId>org.testcontainers</groupId>
762-
<artifactId>testcontainers</artifactId>
763-
<version>${testcontainers.version}</version>
764-
<scope>test</scope>
765-
</dependency>
766715
<dependency>
767716
<groupId>com.microsoft.azure</groupId>
768717
<artifactId>azure-storage</artifactId>
@@ -863,7 +812,93 @@
863812
<scope>import</scope>
864813
</dependency>
865814

866-
<!-- Pax Exam Integration Test Dependencies -->
815+
<!-- Test dependencies -->
816+
817+
<!-- JUnit -->
818+
<dependency>
819+
<groupId>junit</groupId>
820+
<artifactId>junit</artifactId>
821+
<version>4.13.1</version>
822+
</dependency>
823+
<dependency>
824+
<groupId>org.hamcrest</groupId>
825+
<artifactId>hamcrest</artifactId>
826+
<version>3.0</version>
827+
<scope>test</scope>
828+
</dependency>
829+
<dependency>
830+
<groupId>org.junit</groupId>
831+
<artifactId>junit-bom</artifactId>
832+
<version>5.14.2</version>
833+
<type>pom</type>
834+
<scope>import</scope>
835+
</dependency>
836+
837+
<!-- Mockito -->
838+
<dependency>
839+
<groupId>org.mockito</groupId>
840+
<artifactId>mockito-core</artifactId>
841+
<version>${mockito.version}</version>
842+
<scope>test</scope>
843+
</dependency>
844+
<dependency>
845+
<groupId>net.bytebuddy</groupId>
846+
<artifactId>byte-buddy</artifactId>
847+
<version>1.17.7</version>
848+
<scope>test</scope>
849+
</dependency>
850+
<dependency>
851+
<groupId>org.objenesis</groupId>
852+
<artifactId>objenesis</artifactId>
853+
<version>3.4</version>
854+
<scope>test</scope>
855+
</dependency>
856+
<dependency>
857+
<groupId>org.ow2.asm</groupId>
858+
<artifactId>asm</artifactId>
859+
<version>9.8</version>
860+
<scope>test</scope>
861+
</dependency>
862+
863+
<!-- EasyMock -->
864+
<dependency>
865+
<groupId>org.easymock</groupId>
866+
<artifactId>easymock</artifactId>
867+
<version>5.6.0</version>
868+
<scope>test</scope>
869+
</dependency>
870+
871+
<!-- Test logging -->
872+
<dependency>
873+
<groupId>org.slf4j</groupId>
874+
<artifactId>slf4j-simple</artifactId>
875+
<version>${slf4j.version}</version>
876+
<scope>test</scope>
877+
</dependency>
878+
879+
<!-- OSGi mocks -->
880+
<dependency>
881+
<groupId>org.apache.sling</groupId>
882+
<artifactId>org.apache.sling.testing.osgi-mock.junit4</artifactId>
883+
<version>2.4.18</version>
884+
<scope>test</scope>
885+
</dependency>
886+
<dependency>
887+
<groupId>org.apache.sling</groupId>
888+
<artifactId>org.apache.sling.testing.osgi-mock.core</artifactId>
889+
<version>2.4.18</version>
890+
<scope>test</scope>
891+
</dependency>
892+
893+
<!-- Testcontainers -->
894+
<dependency>
895+
<groupId>org.testcontainers</groupId>
896+
<artifactId>testcontainers</artifactId>
897+
<version>${testcontainers.version}</version>
898+
<scope>test</scope>
899+
</dependency>
900+
901+
<!-- Pax Exam -->
867902
<dependency>
868903
<groupId>org.apache.sling</groupId>
869904
<artifactId>org.apache.sling.testing.paxexam</artifactId>
@@ -918,6 +953,24 @@
918953
<version>${pax-url.version}</version>
919954
<scope>test</scope>
920955
</dependency>
956+
<dependency>
957+
<groupId>org.ops4j.pax.swissbox</groupId>
958+
<artifactId>pax-swissbox-tracker</artifactId>
959+
<version>1.9.0</version>
960+
<scope>test</scope>
961+
</dependency>
962+
<dependency>
963+
<groupId>org.ops4j.pax.tinybundles</groupId>
964+
<artifactId>tinybundles</artifactId>
965+
<version>4.0.0</version>
966+
<scope>test</scope>
967+
</dependency>
968+
<dependency>
969+
<groupId>org.ops4j.pax.url</groupId>
970+
<artifactId>pax-url-commons</artifactId>
971+
<version>${pax-url.version}</version>
972+
<scope>test</scope>
973+
</dependency>
921974
<dependency>
922975
<groupId>org.apache.felix</groupId>
923976
<artifactId>org.apache.felix.framework</artifactId>
@@ -930,12 +983,26 @@
930983
<version>1</version>
931984
<scope>test</scope>
932985
</dependency>
986+
987+
<!-- Misc test utilities -->
933988
<dependency>
934989
<groupId>com.github.stefanbirkner</groupId>
935990
<artifactId>system-rules</artifactId>
936991
<version>1.19.0</version>
937992
<scope>test</scope>
938993
</dependency>
994+
<dependency>
995+
<groupId>junit-addons</groupId>
996+
<artifactId>junit-addons</artifactId>
997+
<version>1.4</version>
998+
<scope>test</scope>
999+
</dependency>
1000+
<dependency>
1001+
<groupId>org.mock-server</groupId>
1002+
<artifactId>mockserver-junit-rule-no-dependencies</artifactId>
1003+
<version>5.14.0</version>
1004+
<scope>test</scope>
1005+
</dependency>
9391006
</dependencies>
9401007
</dependencyManagement>
9411008

oak-run-commons/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@
225225
<dependency>
226226
<groupId>com.github.stefanbirkner</groupId>
227227
<artifactId>system-rules</artifactId>
228-
<version>1.19.0</version>
229228
<scope>test</scope>
230229
</dependency>
231230
<dependency>

oak-run/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,6 @@
508508
<dependency>
509509
<groupId>com.github.stefanbirkner</groupId>
510510
<artifactId>system-rules</artifactId>
511-
<version>1.19.0</version>
512511
<scope>test</scope>
513512
</dependency>
514513
</dependencies>

oak-search-elastic/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@
312312
<dependency>
313313
<groupId>com.github.stefanbirkner</groupId>
314314
<artifactId>system-rules</artifactId>
315-
<version>1.19.0</version>
316315
<scope>test</scope>
317316
</dependency>
318317
<dependency>

oak-segment-azure/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,6 @@
428428
<dependency>
429429
<groupId>org.mock-server</groupId>
430430
<artifactId>mockserver-junit-rule-no-dependencies</artifactId>
431-
<version>5.14.0</version>
432431
<scope>test</scope>
433432
</dependency>
434433
<dependency>

oak-store-composite/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@
3131
<name>Oak Composite Store</name>
3232
<packaging>bundle</packaging>
3333

34-
<properties>
35-
<!-- see https://issues.apache.org/jira/browse/OAK-12022 -->
36-
<pax-exam.version>4.13.1</pax-exam.version>
37-
</properties>
38-
3934
<build>
4035
<plugins>
4136
<plugin>

oak-store-document/pom.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@
229229
<dependency>
230230
<groupId>junit-addons</groupId>
231231
<artifactId>junit-addons</artifactId>
232-
<version>1.4</version>
233232
<scope>test</scope>
234233
<exclusions>
235234
<exclusion>
@@ -343,7 +342,6 @@
343342
<dependency>
344343
<groupId>org.testcontainers</groupId>
345344
<artifactId>testcontainers</artifactId>
346-
<version>${testcontainers.version}</version>
347345
<scope>test</scope>
348346
</dependency>
349347
<dependency>

0 commit comments

Comments
 (0)