Skip to content

style: improve test assertions for reduceLog4jAffected#1589

Open
algomaster99 wants to merge 1 commit into
mainfrom
claude/relaxed-fermi-QpzUn
Open

style: improve test assertions for reduceLog4jAffected#1589
algomaster99 wants to merge 1 commit into
mainfrom
claude/relaxed-fermi-QpzUn

Conversation

@algomaster99
Copy link
Copy Markdown
Member

@algomaster99 algomaster99 commented Jun 4, 2026

Summary

Enhanced the reduceLog4jAffected integration test to provide more comprehensive validation of the reduced lockfile behavior, with clearer assertions and improved test documentation.

Key Changes

  • Refactored the assertion logic to first collect all flattened dependencies into a list for reusability
  • Split the single chained assertion into two distinct, focused assertions:
    • Verify that log4j-core appears exactly once at the resolved version 2.0 (the conflict winner)
    • Verify that the conflict-losing log4j-api:2.19.0 duplicate is completely absent from the lockfile
  • Added explanatory comments documenting the expected behavior when reduced=true is configured
  • Improved readability by using AssertJ's filteredOn and extracting fluent API for the first assertion

Implementation Details

The test now explicitly validates that the reduced lockfile correctly:

  1. Retains only the winning version of conflicting dependencies
  2. Removes duplicate versions that lost the conflict resolution
  3. Maintains deterministic, conflict-free dependency graphs

This change makes the test intent clearer and provides better failure diagnostics if the reduced lockfile behavior regresses.

…plicate versions

Replace the weak anyMatch check (which only confirmed the winning
log4j-core:2.0 was present) with assertions that verify log4j-core
appears exactly once at the resolved version 2.0 and that the
conflict-losing log4j-api:2.19.0 duplicate is absent, matching the
intent of reduced=true.

https://claude.ai/code/session_01Vv1pSzMEituXF8gK6QkSj2
@algomaster99 algomaster99 changed the title Improve test assertions for reduced lockfile log4j dependencies style: improve test assertions for reduceLog4jAffected Jun 4, 2026
@algomaster99
Copy link
Copy Markdown
Member Author

@brunoapimentel This is not fixing the dependencies. Only making the assertions clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants