Skip to content

Move junit to test scope and bump it to 4.13.2 - #262

Open
deepika-lalwani123 wants to merge 1 commit into
developfrom
vuln/dl-1-test-scope-junit
Open

deepika-lalwani123 wants to merge 1 commit into
developfrom
vuln/dl-1-test-scope-junit

Conversation

@deepika-lalwani123

@deepika-lalwani123 deepika-lalwani123 commented Nov 17, 2026 •

Copy link
Copy Markdown

Move junit to test scope and bump it to 4.13.2
Repo: data-integrations/delta
Commit: c2c939c
Part of the CVE fixes for the CDAP 6.11.2 patch release (container image scanning of gcr.io/cdapio/cdap).

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

The junit 4.12 findings close once data-integrations/database-delta-plugins#300
and data-integrations/datastream-delta-plugins#155 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).

The root POM declared junit 4.12 in <dependencies> 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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant