From c2c939ca6d5fb57c97c3f34a7f2edfded0484c8a Mon Sep 17 00:00:00 2001 From: Deepika Lalwani Date: Tue, 17 Nov 2026 06:02:22 +0000 Subject: [PATCH] Move junit to test scope and bump it to 4.13.2 The root POM declared junit 4.12 in with no scope, so every module, including delta-api and the delta-app system artifact, got junit 4.12 and hamcrest-core 1.3 at compile scope. Image scanning of gcr.io/cdapio/cdap reports /opt/cdap/master/artifacts/delta-app-*.jar/lib/junit-4.12.jar, and delta-api passes junit 4.12 on to the delta plugins (mysql and datastream plugin jars also package junit-4.12.jar). junit is now test scope in the root POM. delta-test is a test-utility library whose mocks in src/main use JUnit (MockTableAssessor), so it declares junit itself at compile scope; users of delta-test still get junit transitively. Versions: - junit 4.12 (compile, root pom) -> 4.13.2 (test scope, junit.version); delta-test declares junit ${junit.version} at compile scope Bugs: b/578455300 closes once database-delta DBD-1 and datastream DS-1 also land (they stop pulling junit from delta-api 0.9.0). Risk: very low. No code change. Only consumers that relied on delta-api to provide junit at compile scope are affected; delta-test users keep it. Testing: JDK 8. mvn -T 4 clean install: BUILD SUCCESS, Checkstyle 0 violations, 101 unit tests pass (delta-api, delta-proto, delta-app incl. DeltaWorkerTest, PipelineDBStoreTest, AssessmentHandlerTest). mvn dependency:tree -Dincludes=junit,org.hamcrest: delta, delta-api, delta-proto and delta-app show only junit:4.13.2:test; delta-test shows junit:4.13.2:compile. unzip -l delta-app/target/delta-app-*.jar shows no junit or hamcrest under lib/ (6 lib jars). --- delta-test/pom.xml | 6 ++++++ pom.xml | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/delta-test/pom.xml b/delta-test/pom.xml index 7210061..d6bdd24 100644 --- a/delta-test/pom.xml +++ b/delta-test/pom.xml @@ -63,6 +63,12 @@ gson 2.2.4 + + + junit + junit + ${junit.version} + diff --git a/pom.xml b/pom.xml index f9e4db0..cdbcf83 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 6.9.1 2.3.3 13.0.1 - 4.12 + 4.13.2 1.7.25 0.8.8 @@ -98,6 +98,7 @@ junit junit ${junit.version} + test