-
Notifications
You must be signed in to change notification settings - Fork 73
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
org.junit.rules.ExpectedException not migrated as part of SpringBoot2JUnit4to5Migration #581
Comments
Thanks for logging the issue and the first attempts to replicate that in I've moved your issue as there is an existing recipe in rewrite-testing-frameworks related to this issue Lines 30 to 42 in 17b0427
Would you be able to adapt the example test there to fit the error seen here? Lines 73 to 118 in 17b0427
Ideally the test is stripped of everything not needed for replicate, so the |
Also might make sense to run through these steps to ensure your failure to see changes is not caused by missing types for instance. |
Just to be clear, is the |
Do you think this code should be migrated using this recipe or should I use another one? |
That ought to be converted by this recipe, as the expected exception is part of the annotation: That's different from the case reported by @FieteO above, as that uses a rule for the expected exception: The steps to debug are the same, and outlined here: Additionally, since you're using JMockit, you might want to first and only run the JMockit to Mockito migration: |
What version of OpenRewrite are you using?
I am using version
5.17.0
of the Migrate Spring Boot 2.x projects to JUnit 5 from JUnit 4 recipeHow are you running OpenRewrite?
What did you expect to see?
What did you see instead?
The declaration of
@Rule public ExpectedException thrown
is correctly removed, but the reference tothrown
is not correctly replaced in the test method. Also the import forExpectedException
is not removed.I hope I have not forgotten anything in the code blocks. Also it may not be necessary to have this as a parameterized test.
If the issue cannot be reproduced based on the provided snippets, than running the recipe on the provided repository should reproduce the issue.
The text was updated successfully, but these errors were encountered: