-
Notifications
You must be signed in to change notification settings - Fork 101
Comparing changes
Open a pull request
base repository: openrewrite/rewrite-testing-frameworks
base: v3.39.0
head repository: openrewrite/rewrite-testing-frameworks
compare: main
- 15 commits
- 48 files changed
- 3 contributors
Commits on Jun 20, 2026
-
TestNgToAssertj: emit a static import for assertThat (#1033)
Normalize the AssertJ entry points introduced by TestNgToAssertj to a static import via UseStaticImport, so qualified Assert.assertX(...) calls become static-imported assertThat(...) instead of mirroring the source qualification as Assertions.assertThat(...). Fixes #1029
Configuration menu - View commit details
-
Copy full SHA for 54f3db8 - Browse repository at this point
Copy the full SHA 54f3db8View commit details -
Add SimplifyHasSizeFromIsEqualToAssertion recipe (#1034)
Handles literal-first AssertJ size assertions where the meaningful expression sits on the isEqualTo(...) side, e.g. assertThat(4).isEqualTo(coll.size()) -> assertThat(coll).hasSize(4). This is the always-safe "Case A" from the issue: the comparison is on a primitive int (size()/length()/array length), so reversing the assertion is behavior-preserving. Object-equality reversal (Case B) is intentionally left untouched since it depends on equals() symmetry. Fixes #1031
Configuration menu - View commit details
-
Copy full SHA for 9a16f57 - Browse repository at this point
Copy the full SHA 9a16f57View commit details -
Refactor assertThat(x instanceof Type).isTrue() to assertThat(x).isIn…
…stanceOf(Type.class) (#1035) * Add SimplifyAssertJInstanceOfAssertion recipe Convert `assertThat(x instanceof Type).isTrue()` to the dedicated `assertThat(x).isInstanceOf(Type.class)` (and `.isFalse()` / negated forms to `isNotInstanceOf`), so failures describe the actual type instead of just "expected true but was false". Handles parenthesized and `!`-negated arguments, qualified and statically imported `assertThat`, array types, and skips Java 16+ pattern bindings whose variable may be used later. Fixes #1030 * Regenerate recipes.csv for SimplifyAssertJInstanceOfAssertion
Configuration menu - View commit details
-
Copy full SHA for 286a3d7 - Browse repository at this point
Copy the full SHA 286a3d7View commit details -
Converge AssertJ isSameAs/isNotSameAs(0|1) to isZero/isNotZero/isOne …
…in a single run (#1036) The Assertj aggregate normalizes primitive isSameAs/isNotSameAs to isEqualTo/isNotEqualTo via Picnic's AssertJPrimitiveRulesRecipes, after which our type-specific rules collapse isEqualTo(0) to isZero(), etc. Because between-cycle re-attribution does not give the rewritten node a typed receiver, the second simplification only fired on a subsequent rewriteRun. Let our type rules also match the isSameAs/isNotSameAs forms directly so they collapse straight to isZero/isNotZero/isOne, and order them before AssertJPrimitiveRulesRecipes so they win within a single cycle. Fixes #1032
Configuration menu - View commit details
-
Copy full SHA for cd8b263 - Browse repository at this point
Copy the full SHA cd8b263View commit details -
Simplify AssertJ hasSize(0) to isEmpty() for Iterable (#1037)
The existing rule targeted java.util.Collection, so an actual typed as the broader java.lang.Iterable was not matched. Widen the required type to java.lang.Iterable, which subsumes the Collection case. Fixes #811
Configuration menu - View commit details
-
Copy full SHA for 9e69b1b - Browse repository at this point
Copy the full SHA 9e69b1bView commit details -
Fix isSameAs(null) compile error from null reference comparisons (#1038)
* Add SimplifyAssertJNullRelatedAssertion to fix isSameAs(null) compile error assertThat(null == a).isEqualTo(true) was converted by the picnic AssertJObjectRulesRecipes into the uncompilable assertThat(null).isSameAs(a), since the Refaster rule binds the left operand as the actual value. This adds a recipe that runs before the picnic rules and converges null reference comparisons to the dedicated assertThat(x).isNull()/isNotNull(), mirroring SimplifyAssertJInstanceOfAssertion. Only comparisons against the null literal are handled; genuine x == y still becomes isSameAs(y). Fixes #868 * Use J.Literal.isLiteralValue(expr, null) instead of a local helper
Configuration menu - View commit details
-
Copy full SHA for 9a8b7cb - Browse repository at this point
Copy the full SHA 9a8b7cbView commit details -
Cover commented AssertJ tests: array length, Comparable & BigDecimal …
…compareTo (#1039) * Cover previously-commented AssertJ best-practice tests Un-comments the disabled cases in AssertJBestPracticesTest and closes the coverage gaps they represented: - Comparable relational operators (>, >=, <, <=) were already handled by AssertJPrimitiveRules; the cases were only disabled because the test template emitted an invalid `import int;` for primitive types. Fix the template to skip imports for primitives and strip array brackets. - Add a SimplifyChainedAssertJAssertion entry mapping BigDecimal `compareTo(y).isZero()` to `isEqualByComparingTo(y)`. - Add SimplifyArrayLengthAssertion to convert `assertThat(array.length)` size assertions to dedicated array assertions (isEmpty, hasSize, hasSameSizeAs, hasSize{Less,Greater}Than[OrEqualTo]), for both object and primitive arrays. Ordered before AssertJNumberRules to avoid the `isGreaterThanOrEqualTo(1)` -> `isPositive()` collision. * Update recipes.csv for new recipe and declarative entries
Configuration menu - View commit details
-
Copy full SHA for db78ffd - Browse repository at this point
Copy the full SHA db78ffdView commit details -
TestsShouldNotBePublic: recognize meta-annotated test methods (#1040)
Resolve #308 so that classes whose methods carry a custom annotation that is itself meta-annotated with @test (e.g. @maventest) also have their redundant public modifier removed. Use AnnotationMatcher's built-in meta-annotation matching rather than hand-rolled recursion.
Configuration menu - View commit details
-
Copy full SHA for 7e27ad6 - Browse repository at this point
Copy the full SHA 7e27ad6View commit details -
Add recipe to surface implausible JUnit @timeout values as minutes (#…
…1041) Rewrites second-based @timeout values at or above a configurable threshold (default 1000s) to the equivalent minutes, e.g. @timeout(10000) -> @timeout(value = 167, unit = TimeUnit.MINUTES), making likely millisecond mistakes visible. Implements option a) of #452 and adds it to JupiterBestPractices. Fixes #452
Configuration menu - View commit details
-
Copy full SHA for 8ade02d - Browse repository at this point
Copy the full SHA 8ade02dView commit details -
Decompose
assertThat(a && b).isTrue()into separate assertions (#1042)* Add DecomposeConjunctionAssertion recipe for issue #387 * Add end-to-end issue #387 tests for conjunction decomposition * Use built-in Expression.unwrap() instead of a custom helper * Add test showing same-subject conjuncts collapse into a chain * Flatten conjuncts functionally with ListUtils.flatMap * Build decomposed assertions with ListUtils.flatMap
Configuration menu - View commit details
-
Copy full SHA for e471570 - Browse repository at this point
Copy the full SHA e471570View commit details -
Skip JUnit 4 lifecycle annotation when Jupiter equivalent already pre…
…sent (#1043) When a method carries both a JUnit 4 lifecycle annotation (e.g. @before) and its Jupiter equivalent (@beforeeach), changing the type of the JUnit 4 annotation produced a duplicate, non-repeatable annotation. Remove the JUnit 4 annotation instead in that case. Fixes #501
Configuration menu - View commit details
-
Copy full SHA for 0eb4765 - Browse repository at this point
Copy the full SHA 0eb4765View commit details -
Convert
assertThrowswith anExecutablevariable (#1046)* Convert `assertThrows` with an `Executable` variable, retyping to `ThrowingCallable` Fixes #511 * Address review: inline safe via reduce; drop unused import; hoist ThrowingCallable type
Configuration menu - View commit details
-
Copy full SHA for 9321cbc - Browse repository at this point
Copy the full SHA 9321cbcView commit details
Commits on Jun 23, 2026
-
Use this link to re-run the recipe: https://app.moderne.io/builder/yESIGzVB0?organizationId=QUxML01vZGVybmUgKyBPcGVuUmV3cml0ZQ%3D%3D Co-authored-by: Moderne <team@moderne.io>
Configuration menu - View commit details
-
Copy full SHA for cba9383 - Browse repository at this point
Copy the full SHA cba9383View commit details -
Configuration menu - View commit details
-
Copy full SHA for 95ff73a - Browse repository at this point
Copy the full SHA 95ff73aView commit details
Commits on Jul 3, 2026
-
OpenRewrite recipe best practices
Co-authored-by: Moderne <team@moderne.io>
Configuration menu - View commit details
-
Copy full SHA for 2e6d485 - Browse repository at this point
Copy the full SHA 2e6d485View 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.39.0...main