Skip to content
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

Add Kotlin support for JUnit recipes: UpdateBeforeAfterAnnotations #533

Conversation

amitojduggal
Copy link
Contributor

What's changed?

  • Adding support for Kotlin to the UpdateBeforeAfterAnnotations recipe.
  • Adding Kotlin tests for AddParameterizedTestAnnotation
  • More to come

What's your motivation?

Would like to make the recipes to work both with Java and Kotlin.

Anything in particular you'd like reviewers to focus on?

Anyone you would like to review specifically?

@timtebeek @knutwannheden

Have you considered any alternatives or workarounds?

Any additional context

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

Amitoj Duggal and others added 14 commits June 17, 2024 10:45
* Add Picnic AssertJ rules to AssertJ best practices

* Include Picnic's JUnitToAssertJRulesRecipes in migration

* Exclude `jakarta.xml.bind-api` from TimeFold

* Move the exclude to rewrite-third-party
… Mockito verify statement (openrewrite#530)

* Ensure Jmockit expectations with no times or result transform to a mockito verify

* Minor polish to text blocks

* Make times, minTimes, maxTimes more flexible as it was originally so even if someone mistakenly puts times and minTimes together, it still migrates without issue

---------

Co-authored-by: Tim te Beek <tim@moderne.io>
…penrewrite#532)

* Ensure Jmockit expectations with no times or result transform to a mockito verify

* Minor polish to text blocks

* Make times, minTimes, maxTimes more flexible as it was originally so even if someone mistakenly puts times and minTimes together, it still migrates without issue

* Add feature to enable migration of Jmockit Injectable annotation exactly as we are doing the Mocked annotation ie method parameter annotation as well as field annotation. Have moved all of the code from JMockitMockedVariableToMockito to JMockitAnnotationToMockito for code reuse. Also add the corresponding test cases and jmockit.yml file modification.

* Use `@Option` instead of inheritance

* Drop Option and just replace both variants

* Update display name and description to match application

---------

Co-authored-by: Tim te Beek <tim@moderne.io>
…-cleanuprule' into feature/add-kotlin-support-junit-cleanuprule
@timtebeek timtebeek self-requested a review June 20, 2024 20:13
Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work here @amitojduggal ! With some small adjustments to the tests I think we cna get this through quickly. Really appreciate the work here to make the recipes work for Kotlin.

amitojduggal and others added 3 commits June 21, 2024 09:55
…AfterAnnotationsTest.java

Co-authored-by: Tim te Beek <timtebeek@gmail.com>
…We can tackle the issues and add tests separately if we see bug in workflows.
@amitojduggal
Copy link
Contributor Author

Its done @timtebeek , i addressed the review comments. Thanks for the feedback

Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great to see @amitojduggal ! Thanks for applying that review feedback so quickly too.

@timtebeek timtebeek added the enhancement New feature or request label Jun 23, 2024
@timtebeek timtebeek merged commit 9eabd19 into openrewrite:main Jun 23, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants