Skip to content

Remove stale @Disabled tests, //noinspection lines and restating comments - #1233

Merged
timtebeek merged 1 commit into
mainfrom
tim/remove-stale-disabled-and-restating-comments
Oct 25, 2026
Merged

timtebeek merged 1 commit into
mainfrom
tim/remove-stale-disabled-and-restating-comments

Conversation

@timtebeek

Copy link
Copy Markdown
Member

Several tests stayed @Disabled after the issues they pointed at were closed, and a number of recipes carried IntelliJ-only //noinspection lines, class Javadoc that repeats the recipe description, comments that restate the next line, and @NonNull annotations that the package's @NullMarked already implies. This removes that noise without changing recipe behaviour.

@Disabled tests

  • AssumeNotNullToAssumptionsTest.twoArgs is enabled again. Refaster now matches two arguments into the varargs template; the test only failed because its input passed new Object(), new Object() while the expected output used object1, object2, so the input now passes the parameters. This looks like it also resolves the test part of B7.
  • AddMissingNestedTest.doesNotAnnotateKotlinObject and doesNotAnnotateKotlinCompanionObject pass 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.convertsToPackageVisibility still fails, so it stays disabled. rewrite#150 is closed and unrelated to the failure: UpdateBeforeAfterAnnotations keeps the public modifier and leaves the trailing comment on the annotation. The reason now says so.
  • JMockitExpectationsToMockitoTest.whenComments still fails (a comment inside the Expectations block is dropped), so it stays disabled; its trailing comment became the @Disabled reason.

Comments and annotations

  • Removed the 10 remaining //noinspection lines. The one in KotlinTestMethodsShouldReturnUnit was already gone.
  • Removed class Javadoc that repeats the description from CleanupKotlinJUnit5AssertionImports, AnyStringToNullable, MockConstructionToTryWithResources, CloseUnclosedStaticMocks and AddTestcontainersAnnotations. In ExpectedExceptionToAssertThrows, HandleExternalResourceRules, JUnitParamsRunnerToParameterized and MockitoJUnitToMockitoExtension, the parts that say something the description doesn't (unsupported methods, ordering in a recipe list, the reason collector() is skipped) are now a short line comment.
  • Removed restating comments in EnvironmentVariables, CsvSourceToValueSource, TruthThrowableAssertions, JMockitAnnotatedArgumentToMockito, ReplaceSettersWithTransform, AddTestcontainersAnnotations and RemoveTestPrefix, and kept the ones that explain a "why".
  • Removed the @NonNull annotations from EnvironmentVariables; org.openrewrite.java.testing.junit5 is @NullMarked.

Skipped

Verification
./gradlew test over the test classes of every touched recipe, plus SystemRulesMigrationTest and MigrateTruthToAssertJTest: 321 tests in 32 classes, 0 failures, 2 skipped (the two tests that stay disabled).

Fixes item N9 of #1211.

@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Oct 25, 2026
@timtebeek
timtebeek merged commit ac81764 into main Oct 25, 2026
2 checks passed
@timtebeek
timtebeek deleted the tim/remove-stale-disabled-and-restating-comments branch October 25, 2026 13:30
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant