Skip to content

Conversation

@Thomas-Iapichino
Copy link
Contributor

@Thomas-Iapichino Thomas-Iapichino commented Nov 26, 2025

What's changed?

Changes:

  • Reverted ExcludeJUnit4UnlessUsingTestcontainers recipe precondition to check for org.testcontainers:*:1.x instead of spring-boot-testcontainers
  • Removed Testcontainers2Migration from the ExcludeJUnit4UnlessUsingTestcontainers recipe list
  • Updated test expectations to verify no changes occur when Testcontainers 1.x is present
  • Added issue Spring Boot upgrades (any version) now causes upgrade to Testcontainers 2 #850 reference to affected tests

What's your motivation?

Anything in particular you'd like reviewers to focus on?

  • The precondition now checks for org.testcontainers:*:1.x specifically. This ensures that:
    • Projects using Testcontainers 1.x keep JUnit 4 (as TC 1.x needs it)
    • Projects using Testcontainers 2.x can still exclude JUnit 4
    • Projects without Testcontainers can exclude JUnit 4

Anyone you would like to review specifically?

Have you considered any alternatives or workarounds?

Any additional context

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@timtebeek timtebeek self-requested a review November 26, 2025 10:33
@timtebeek timtebeek moved this from In Progress to Ready to Review in OpenRewrite Nov 26, 2025
@timtebeek timtebeek merged commit bcdee03 into openrewrite:main Nov 26, 2025
2 checks passed
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Spring Boot upgrades (any version) now causes upgrade to Testcontainers 2

3 participants