-
Notifications
You must be signed in to change notification settings - Fork 67
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 unit tests for JMockit Delegate to mockito migration. Also add test case for comments #557
Conversation
…e test case for comments for JMockit Expectations proving that comments are not preserved.
src/test/java/org/openrewrite/java/testing/jmockit/JMockitDelegateToMockitoTest.java
Show resolved
Hide resolved
src/test/java/org/openrewrite/java/testing/jmockit/JMockitDelegateToMockitoTest.java
Show resolved
Hide resolved
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 |
Modify test cases so that the tests fail with expected output of Delegate migration
src/test/java/org/openrewrite/java/testing/jmockit/JMockitDelegateToMockitoTest.java
Show resolved
Hide resolved
src/test/java/org/openrewrite/java/testing/jmockit/JMockitDelegateToMockitoTest.java
Show resolved
Hide resolved
Modify test to prove that comments migration is not supported within expectations, and this may be useful for someone who is adding this feature later. Disable test.
src/test/java/org/openrewrite/java/testing/jmockit/JMockitDelegateToMockitoTest.java
Show resolved
Hide resolved
src/test/java/org/openrewrite/java/testing/jmockit/JMockitDelegateToMockitoTest.java
Show resolved
Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Modify tests to account for stubbing void methods using doAnswer instead of thenAnswer. Remove unnecessary imports
src/test/java/org/openrewrite/java/testing/jmockit/JMockitDelegateToMockitoTest.java
Show resolved
Hide resolved
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.
Great to have these examples documented and runnable! One last question before we merge, but other than that good to go.
At the moment, JMockit Delegates are not migrated to mockito as mentioned in issue
@Tested
andDeencapsulation
when migrating to Mockito #522.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