Organize Kotlin tests with @Nested and fix test expectations#913
Merged
Organize Kotlin tests with @Nested and fix test expectations#913
Conversation
Changes: - Wrap Kotlin tests in @nested class Kotlin { } as suggested by review - Remove unused import org.openrewrite.Issue from OAuth2ResourceServerLambdaDslTest - Fix expected import order in DatabaseComponentAndBeanInitializationOrderingTest - Fix expected constructor output (preserves 'constructor' keyword) in NoAutowiredOnConstructorTest - Add TypeValidation.none() where Kotlin stdlib types cannot be resolved - Disable tests that reveal recipe bugs needing separate fixes: - OAuth2ResourceServerLambdaDsl mangles Kotlin code structure - ImplicitWebAnnotationNames doesn't add space after removing annotation args - DatabaseComponentAndBeanInitializationOrdering not idempotent for Kotlin
Add TypeValidation.none() to OAuth2ResourceServerLambdaDslTest Kotlin test as the types cannot be fully resolved in CI environment.
Contributor
Author
|
Have to check this:
|
timtebeek
reviewed
Jan 26, 2026
src/test/java/org/openrewrite/java/spring/ImplicitWebAnnotationNamesTest.java
Outdated
Show resolved
Hide resolved
…ble full type validation
The recipe has a bug with Kotlin whitespace handling when there is no space between annotation arguments and the variable name. The test documents this issue and is marked as @disabled. When input has space like @PathVariable("id") id, the recipe works correctly. When input has no space like @PathVariable("id")id, the recipe does not add the required space.
…ble full type validation
src/test/java/org/openrewrite/java/spring/ImplicitWebAnnotationNamesTest.java
Outdated
Show resolved
Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
timtebeek
reviewed
Jan 27, 2026
...va/org/openrewrite/java/spring/boot2/DatabaseComponentAndBeanInitializationOrderingTest.java
Outdated
Show resolved
Hide resolved
timtebeek
reviewed
Jan 27, 2026
...nrewrite/java/spring/security6/oauth2/server/resource/OAuth2ResourceServerLambdaDslTest.java
Show resolved
Hide resolved
timtebeek
approved these changes
Jan 27, 2026
Member
timtebeek
left a comment
There was a problem hiding this comment.
Small suggestions to clean this up, but otherwise ok to merge, thanks! Good to see the fix too.
Contributor
Author
|
I have a more complete commit about to push, will merge than |
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.
Summary
This PR builds on top of PR Add kotlin tests #874 by @Laurens-W to add Kotlin tests for Spring recipes. Changes include:
Wrap Kotlin tests in
@Nested class Kotlin { }as suggested by @timtebeek in reviewRemove unused
import org.openrewrite.Issuefrom OAuth2ResourceServerLambdaDslTestFix expected import order in DatabaseComponentAndBeanInitializationOrderingTest
Fix expected constructor output (preserves
constructorkeyword) in NoAutowiredOnConstructorTestAdd
TypeValidation.none()where Kotlin stdlib types cannot be resolvedRecipe bugs discovered
Some tests have been disabled as they reveal recipe bugs that need separate fixes:
OAuth2ResourceServerLambdaDslImplicitWebAnnotationNames@PathVariable("id")idDatabaseComponentAndBeanInitializationOrderingRelated
Test plan
./gradlew licenseFormatapplied