Add unit tests for JMockit Delegate to mockito migration. Also add test case for comments#557
Merged
timtebeek merged 6 commits intoopenrewrite:mainfrom Aug 4, 2024
Merged
Conversation
…e test case for comments for JMockit Expectations proving that comments are not preserved.
Member
|
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
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.
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
timtebeek
reviewed
Aug 4, 2024
timtebeek
reviewed
Aug 4, 2024
Member
timtebeek
left a comment
There was a problem hiding this comment.
Great to have these examples documented and runnable! One last question before we merge, but other than that good to go.
timtebeek
approved these changes
Aug 4, 2024
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.
At the moment, JMockit Delegates are not migrated to mockito as mentioned in issue
@TestedandDeencapsulationwhen 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