-
Notifications
You must be signed in to change notification settings - Fork 124
Add kotlin tests #874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add kotlin tests #874
Conversation
| @Test | ||
| void shouldRemoveAutowiredFromKotlinPrimaryConstructor() { | ||
| //language=kotlin | ||
| rewriteRun( | ||
| kotlin( | ||
| """ | ||
| import org.springframework.beans.factory.annotation.Autowired | ||
| import org.springframework.stereotype.Service | ||
| @Service | ||
| class MyService @Autowired constructor( | ||
| private val dependency: String | ||
| ) | ||
| """, | ||
| """ | ||
| import org.springframework.stereotype.Service | ||
| @Service | ||
| class MyService( | ||
| private val dependency: String | ||
| ) | ||
| """ | ||
| ) | ||
| ); | ||
| } | ||
|
|
||
| @Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @Test | |
| void shouldRemoveAutowiredFromKotlinPrimaryConstructor() { | |
| //language=kotlin | |
| rewriteRun( | |
| kotlin( | |
| """ | |
| import org.springframework.beans.factory.annotation.Autowired | |
| import org.springframework.stereotype.Service | |
| @Service | |
| class MyService @Autowired constructor( | |
| private val dependency: String | |
| ) | |
| """, | |
| """ | |
| import org.springframework.stereotype.Service | |
| @Service | |
| class MyService( | |
| private val dependency: String | |
| ) | |
| """ | |
| ) | |
| ); | |
| } | |
| @Test | |
| @Test |
| import org.openrewrite.Issue; | ||
| import org.openrewrite.java.JavaParser; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| import org.openrewrite.Issue; | |
| import org.openrewrite.java.JavaParser; | |
| import org.openrewrite.java.JavaParser; |
|
|
||
| @Test | ||
| void removeUnnecessaryAnnotationArgumentKotlin() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might it make sense to add the Kotlin tests in a @Nested class Kotlin { ... } ? That way it's clear they might mimic coverage for a specific purpose.
What's changed?
Added Kotlin based tests to validate these recipes work
Checklist