Repository navigation
Remove stale @Disabled tests, //noinspection lines and restating comments - #1233
Merged
Merged
Conversation
23 of 76 tasks
timtebeek
deleted the
tim/remove-stale-disabled-and-restating-comments
branch
October 25, 2026 13:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several tests stayed
@Disabledafter the issues they pointed at were closed, and a number of recipes carried IntelliJ-only//noinspectionlines, class Javadoc that repeats the recipe description, comments that restate the next line, and@NonNullannotations that the package's@NullMarkedalready implies. This removes that noise without changing recipe behaviour.@DisabledtestsAssumeNotNullToAssumptionsTest.twoArgsis enabled again. Refaster now matches two arguments into the varargs template; the test only failed because its input passednew Object(), new Object()while the expected output usedobject1, object2, so the input now passes the parameters. This looks like it also resolves the test part of B7.AddMissingNestedTest.doesNotAnnotateKotlinObjectanddoesNotAnnotateKotlinCompanionObjectpass and are enabled. While the recipe still skips Kotlin files (Add Kotlin support across the JUnit 4 to Jupiter migration #1189) they pass trivially, but they will catch a regression once that precondition goes.UpdateBeforeAfterAnnotationsTest.convertsToPackageVisibilitystill fails, so it stays disabled. rewrite#150 is closed and unrelated to the failure:UpdateBeforeAfterAnnotationskeeps thepublicmodifier and leaves the trailing comment on the annotation. The reason now says so.JMockitExpectationsToMockitoTest.whenCommentsstill fails (a comment inside theExpectationsblock is dropped), so it stays disabled; its trailing comment became the@Disabledreason.Comments and annotations
//noinspectionlines. The one inKotlinTestMethodsShouldReturnUnitwas already gone.CleanupKotlinJUnit5AssertionImports,AnyStringToNullable,MockConstructionToTryWithResources,CloseUnclosedStaticMocksandAddTestcontainersAnnotations. InExpectedExceptionToAssertThrows,HandleExternalResourceRules,JUnitParamsRunnerToParameterizedandMockitoJUnitToMockitoExtension, the parts that say something the description doesn't (unsupported methods, ordering in a recipe list, the reasoncollector()is skipped) are now a short line comment.EnvironmentVariables,CsvSourceToValueSource,TruthThrowableAssertions,JMockitAnnotatedArgumentToMockito,ReplaceSettersWithTransform,AddTestcontainersAnnotationsandRemoveTestPrefix, and kept the ones that explain a "why".@NonNullannotations fromEnvironmentVariables;org.openrewrite.java.testing.junit5is@NullMarked.Skipped
ReplaceSettersWithTransform:268("A run of setters reads better one per line…") gives the reason for the line breaks, so I kept it.TestMethodsShouldBeVoidno longer has restating comments (cleaned up in Keep early returns inTestMethodsShouldBeVoidandKotlinTestMethodsShouldReturnUnit#1217).FIXMEs inRemoveNotMatcherVisitorare gone with the fix for E1 (Track Hamcrestnot(..)negation locally instead of on theExecutionContext#1214).Verification
./gradlew testover the test classes of every touched recipe, plusSystemRulesMigrationTestandMigrateTruthToAssertJTest: 321 tests in 32 classes, 0 failures, 2 skipped (the two tests that stay disabled).Fixes item N9 of #1211.