-
Notifications
You must be signed in to change notification settings - Fork 102
Comparing changes
Open a pull request
base repository: openrewrite/rewrite-testing-frameworks
base: v3.28.0
head repository: openrewrite/rewrite-testing-frameworks
compare: v3.29.0
- 7 commits
- 16 files changed
- 4 contributors
Commits on Feb 27, 2026
-
Detect JUnit version in PowerMockitoMockStaticToMockito (#919)
* Add failing test for JUnit 4 PowerMockito migration Reproduces moderneinc/customer-requests#1925: when a test class uses JUnit 4 (@org.junit.Test), ReplacePowerMockito should use @Before/@after instead of @BeforeEach/@AfterEach. * Detect JUnit version in PowerMockitoMockStaticToMockito When a test class uses JUnit 4 (@org.junit.Test), the recipe now uses @Before/@after from org.junit instead of always defaulting to @BeforeEach/@AfterEach from JUnit Jupiter. Fixes moderneinc/customer-requests#1925
Configuration menu - View commit details
-
Copy full SHA for af19fad - Browse repository at this point
Copy the full SHA af19fadView commit details -
ReplacePowerMockito: ensure mockito-core is added when PowerMock is r…
…emoved (#920) * Add failing test for missing mockito-core after PowerMock removal When a project only has PowerMock declared and gets Mockito transitively through powermock-api-mockito, ReplacePowerMockito removes the PowerMock dependencies but never adds mockito-core. Reproduces moderneinc/customer-requests#1926 * Replace PowerMock API dependency with mockito-core instead of just removing it When a project gets Mockito only transitively through powermock-api-mockito, RemoveDependency leaves no Mockito dependency at all. Instead of removing and then adding (which runs into stale GradleProject marker issues with AddDependency), use ChangeDependency to convert powermock-api-mockito directly to mockito-core:3.x. Handles both powermock-api-mockito (Mockito 1) and powermock-api-mockito2 (Mockito 2) artifact names. Fixes moderneinc/customer-requests#1926 * Regenerate recipes.csv * Add comment explaining mutual exclusivity of powermock-api-mockito artifacts
Configuration menu - View commit details
-
Copy full SHA for 0e3d076 - Browse repository at this point
Copy the full SHA 0e3d076View commit details
Commits on Feb 28, 2026
-
Remove all remaining PowerMock dependencies in ReplacePowerMockito re…
…cipe (#921) * Remove all remaining PowerMock dependencies in ReplacePowerMockito recipe The ReplacePowerMockito recipe previously only removed powermock-api-mockito, powermock-api-mockito2, and powermock-core. This left behind 14 other org.powermock artifacts that should also be removed when migrating to Mockito. Added RemoveDependency entries for: powermock-api-support, powermock-api-mockito-common, powermock-api-easymock, powermock-reflect, powermock-module-junit4, powermock-module-junit4-common, powermock-module-junit4-legacy, powermock-module-junit4-rule, powermock-module-junit4-rule-agent, powermock-module-junit3, powermock-module-junit5, powermock-module-testng, powermock-classloading-xstream, and powermock-classloading-objenesis. Fixes moderneinc/customer-requests#1933 * Also remove managed dependencies for PowerMock artifacts Add RemoveManagedDependency entries alongside each RemoveDependency to ensure PowerMock artifacts are also cleaned up from Maven dependencyManagement sections. * Extract PowerMock dependency removal into separate recipe Move all RemoveDependency and RemoveManagedDependency entries into a new RemovePowerMockDependencies declarative recipe for clarity. The main ReplacePowerMockito recipe now references it as a single entry. * Also remove powermock parent POM and powermock-modules aggregator * Add powermock and powermock-modules to integration test * Use wildcard to remove all PowerMock dependencies Replace individual RemoveDependency and RemoveManagedDependency entries with a single powermock* glob for each, and inline back into the main ReplacePowerMockito recipe. * Add Maven POM test for managed PowerMock dependency removal Verifies that RemoveManagedDependency with powermock* wildcard correctly removes managed PowerMock dependencies, and that ChangeDependency properly converts managed powermock-api-mockito into managed mockito-core. Fixes moderneinc/customer-requests#1933 * Add Maven POM test to removesAllPowerMockDependencies, remove @issue annotations Add a pomXml assertion to the existing Gradle test to verify PowerMock dependencies are removed from Maven builds without dependencyManagement. Remove @issue annotations referencing the customer-requests repo.
Configuration menu - View commit details
-
Copy full SHA for e8bbdf0 - Browse repository at this point
Copy the full SHA e8bbdf0View commit details -
Add JUnit 4 support to AddMockitoExtensionIfAnnotationsUsed (#1932) (#…
…922) When PowerMock's @RunWith(PowerMockRunner.class) is removed from JUnit 4 tests, mock fields annotated with @mock are never initialized. This adds @RunWith(MockitoJUnitRunner.class) for JUnit 4 tests using Mockito annotations, complementing the existing JUnit 5 @ExtendWith support.
Configuration menu - View commit details
-
Copy full SHA for 63820f4 - Browse repository at this point
Copy the full SHA 63820f4View commit details
Commits on Mar 2, 2026
-
Use mockito-inline instead of mockito-core where applicable (#923)
* ReplacePowerMockito: use mockito-inline instead of mockito-core (#1934) PowerMock features (static mocking, constructor mocking, final class mocking) require the inline mock maker, which is only bundled in mockito-inline for Mockito 3.x/4.x. Using mockito-core alone causes runtime failures when the migrated code calls Mockito.mockStatic(). * ReplacePowerMockito: conditionally select mockito-core vs mockito-inline (#1934) Replace hardcoded mockito-inline dependency with a ScanningRecipe that detects mockStatic(), whenNew(), or @PrepareForTest usage and selects mockito-inline only when needed, falling back to mockito-core otherwise. * Add ReplacePowerMockDependencies to recipes.csv (#1934) * ReplacePowerMockDependencies: multi-module project support (#1934) Use Map<JavaProject, Boolean> in the accumulator so each sub-module gets mockito-inline or mockito-core based on its own usage patterns.
Configuration menu - View commit details
-
Copy full SHA for f1b202d - Browse repository at this point
Copy the full SHA f1b202dView commit details
Commits on Mar 4, 2026
-
Add recipe to replace MockitoTestExecutionListener (#924)
* Add recipe to replace `MockitoTestExecutionListener` with framework-appropriate Mockito initialization --------- Co-authored-by: Tim te Beek <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5c07d95 - Browse repository at this point
Copy the full SHA 5c07d95View commit details -
Remove empty constructors and suite() methods in MigrateJUnitTestCase (…
…#926) After removing `super(testName)`, constructors left with an empty body are now fully removed. Static `suite()` methods returning `junit.framework.Test` or `TestSuite` are also removed along with their stale imports. Fixes moderneinc/customer-requests#1948
Configuration menu - View commit details
-
Copy full SHA for 7796693 - Browse repository at this point
Copy the full SHA 7796693View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v3.28.0...v3.29.0