Skip to content

feat(junit5): support parameterized, repeated, and nested test isolation with custom snapshot naming - #5

Open
YashDoesCode wants to merge 2 commits into
mainfrom
feat/junit5-test-isolation
Open

YashDoesCode wants to merge 2 commits into
mainfrom
feat/junit5-test-isolation

Conversation

@YashDoesCode

Copy link
Copy Markdown
Owner

Summary

Enhances MintExtension and MintSnapshot to isolate snapshot files across JUnit 5 @ParameterizedTest, @RepeatedTest, and @Nested test classes, preventing file collision bugs. Also introduces mint.named(String) for custom multiple snapshot assertions within a single test.

Key Capabilities

  1. Parameterized and Repeated Test Isolation:
    • Automatically computes distinct, filesystem-safe snapshot filenames for each parameter invocation or repetition.
    • Converts JUnit 5 display names (e.g., [1] apple or repetition 1 of 2) into clean filename suffixes (e.g., testMethod_1_apple).
  2. Nested Test Hierarchy Support:
    • Recursively resolves @EnableMintSnapshots from enclosing classes when not declared on the inner @Nested class.
    • Namespaces nested snapshot files with enclosing class names to prevent collisions between nested tests sharing method names.
  3. Custom Multiple Snapshots (mint.named(String)):
    • Adds MintSnapshot.named(String snapshotName) allowing developers to snapshot multiple checkpoints within a single test method without collisions.
    • Adds testName() accessor for snapshot verification.
  4. Execution in CI / Surefire:
    • Added MintExtensionTest.java covering standard tests, parameterized tests, repeated tests, nested tests, and named assertions, ensuring automated execution during mvn test.

Verification

  • mvn verify: BUILD SUCCESS (all 30 tests pass across the reactor with zero regressions).
  • gitleaks: 0 leaks found.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 51 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e04a92c0-efe9-4d11-b634-52355cb2001c
Commits

Reviewing files that changed from the base of the PR and between b31a051 and a73212f.

Files selected for processing: 3

  • mint-junit5/src/main/java/io/mint/junit5/MintExtension.java
  • mint-junit5/src/main/java/io/mint/junit5/MintSnapshot.java
  • mint-junit5/src/test/java/io/mint/junit5/MintExtensionTest.java
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@YashDoesCode
YashDoesCode marked this pull request as ready for review November 17, 2026 10:40
Copilot AI balanced review requested due to automatic review settings November 17, 2026 10:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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