openrewrite / rewrite-testing-frameworks

OpenRewrite recipes that perform common Java testing migration tasks.
Apache License 2.0
77 stars 73 forks source link

Add unit tests for JMockit Delegate to mockito migration. Also add test case for comments #557

Closed shivanisky closed 4 months ago

shivanisky commented 4 months ago

At the moment, JMockit Delegates are not migrated to mockito as mentioned in issue

What I'm seeing is that they are being trashed with the template being printed out. These tests were written to try to replicate this issue, however I was unable to. They may help anyone adding the feature for Delegate migration.

https://javadoc.io/doc/org.jmockit/jmockit/latest/mockit/Delegate.html

Also added one test case showing comments are not preserved.

I am wondering if it's better to have the test cases failing with the expected output and to disable them. Please let me know if that's preferred.

Anyone you would like to review specifically?

@timtebeek @tinder-dthomson

Checklist

timtebeek commented 4 months ago

Thanks for the continued work on this! Indeed probably best to have the tests fail with the actual expected output, as opposed to documenting the status quo. No need to mark them @Disabled just yet, we can do that just before a merge if we want to delay any work towards this, and then have the tests reference an open issue with more information.