-
Notifications
You must be signed in to change notification settings - Fork 102
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: openrewrite/rewrite-testing-frameworks
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.31.0
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: openrewrite/rewrite-testing-frameworks
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.32.0
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 4 commits
- 15 files changed
- 2 contributors
Commits on Mar 26, 2026
-
Fix Mockito1to3Migration not adding runner after removing PowerMockRu…
…nner (#942) ReplacePowerMockito was ordered after AddMockitoExtensionIfAnnotationsUsed, so the latter would see @RunWith(PowerMockRunner.class) and skip the class. Then ReplacePowerMockito would remove it, leaving @mock fields uninitialized. Move ReplacePowerMockito before AddMockitoExtensionIfAnnotationsUsed so the runner gap is detected and filled with MockitoJUnitRunner or MockitoExtension.
Configuration menu - View commit details
-
Copy full SHA for a72d7b1 - Browse repository at this point
Copy the full SHA a72d7b1View commit details -
Refactor PowerMockito recipes for clarity and single responsibility (#…
…943) * Refactor PowerMockitoMockStaticToMockito for clarity and single responsibility Extract independent responsibilities from the monolithic 557-line recipe: - Extract `RemovePowerMockClassExtensions` recipe for removing `extends PowerMockConfiguration` and `extends PowerMockTestCase` - Fold `@RunWith(PowerMockRunner.class)` removal (with and without delegate) into `PowerMockRunnerDelegateToRunWith` - Replace 8 mutable instance fields with a `TestFramework` enum - Add early returns throughout to reduce nesting and improve readability * Clean up PowerMockitoMockStaticToMockito visitor - Consolidate isStaticMockAlreadyClosed/isStaticMockAlreadyOpened into single hasMatchingInvocation method parameterized by MethodMatcher - Restructure visitMethodInvocation with early returns for clarity - Fix double getTestGroupsAsString() call in maybeAddTearDownMethodBody - Simplify mockStatic tracking to use direct list access instead of Optional stream * Improve PowerMockRunnerDelegateToRunWith per review feedback - Use service(AnnotationService.class) instead of manual stream check - Extract findDelegateRunnerArg method to avoid finalDelegateRunnerArg - Move shared maybeRemoveImport(POWER_MOCK_RUNNER) above if/else so each branch can return immediately * Move import removal before withLeadingAnnotations for immediate returns * Update src/main/java/org/openrewrite/java/testing/mockito/PowerMockRunnerDelegateToRunWith.java
Configuration menu - View commit details
-
Copy full SHA for 43acae3 - Browse repository at this point
Copy the full SHA 43acae3View commit details
Commits on Mar 27, 2026
-
Add PowerMockWhiteboxToJavaReflection recipe (#944)
* Add PowerMockWhiteboxToJavaReflection recipe Replace `org.powermock.reflect.Whitebox` calls with plain Java reflection as part of the ReplacePowerMockito recipe chain. Handles setInternalState, getInternalState, and invokeMethod by expanding each call into getDeclaredField/getDeclaredMethod + setAccessible + get/set/invoke. Uses VariableNameUtils to avoid name collisions when multiple Whitebox calls target the same field. * Regenerate recipes.csv to include PowerMockWhiteboxToJavaReflection * Add powermock-reflect-1.6.5 classpath JAR for type resolution * Regenerate classpath type table to include powermock-reflect The classpath.tsv.gz type table is what CI uses for type resolution in tests. The previously committed JAR is unnecessary when the type table includes the artifact. * Address review feedback on PowerMockWhiteboxToJavaReflection - Inline the named WhiteboxVisitor into an anonymous class - Use immediate return for maybeAutoFormat - Remove unnecessary powermock-reflect-1 classpath from integration test * Fix template type attribution by using #{any(java.lang.Object)} Untyped #{any()} placeholders caused the template parser to infer the argument's actual type (e.g. MyService), which is not on the template parser's classpath. This broke type resolution for the entire method chain (.getClass(), .getDeclaredField(), .setAccessible(), etc.). Using #{any(java.lang.Object)} ensures the substitution always resolves against a JDK type, fixing type attribution. Also inlines the JAVA_PARSER field and removes the now-unnecessary methodInvocations(false) from the unit test. --------- Co-authored-by: Tim te Beek <[email protected]>Configuration menu - View commit details
-
Copy full SHA for e679ace - Browse repository at this point
Copy the full SHA e679aceView commit details -
Use declared parameter types for Whitebox.invokeMethod reflection (#945)
Resolve the target method's declared parameter types from the AST instead of using arg.getClass() which returns the runtime concrete class and fails when the method parameter is an interface/parent type. Three-tier resolution strategy: 1. Resolve the target method declaration and use its parameter types 2. Fall back to the argument's compile-time type 3. Fall back to arg.getClass() when no type info is available
Configuration menu - View commit details
-
Copy full SHA for cf368d7 - Browse repository at this point
Copy the full SHA cf368d7View commit details
Loading
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.31.0...v3.32.0