You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
instead of forcing the version on the org.junit.jupiter:junit-jupiter dependency, because the mismatching junit-bom gets imported. It might be good to set mockito.version to something more recent as well for consistency, but it will only work if you also update junit-jupiter.version, for API compatibility reasons.
What is the full stack trace of any errors you encountered?
[INFO] --- compiler:3.8.1:testCompile (default-testCompile) @ spring-petclinic ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 11 source files to /home/didier/IdeaProjects/spring-petclinic-migration/target/test-classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/didier/IdeaProjects/spring-petclinic-migration/src/test/java/org/springframework/samples/petclinic/owner/PetTypeFormatterTests.java:[8,33] package org.mockito.junit.jupiter does not exist
[ERROR] /home/didier/IdeaProjects/spring-petclinic-migration/src/test/java/org/springframework/samples/petclinic/owner/PetTypeFormatterTests.java:[24,13] cannot find symbol
symbol: class MockitoExtension
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.235 s
[INFO] Finished at: 2024-10-04T20:59:11+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile) on project spring-petclinic: Compilation failure: Compilation failure:
[ERROR] /home/didier/IdeaProjects/spring-petclinic-migration/src/test/java/org/springframework/samples/petclinic/owner/PetTypeFormatterTests.java:[8,33] package org.mockito.junit.jupiter does not exist
[ERROR] /home/didier/IdeaProjects/spring-petclinic-migration/src/test/java/org/springframework/samples/petclinic/owner/PetTypeFormatterTests.java:[24,13] cannot find symbol
[ERROR] symbol: class MockitoExtension
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
What version of OpenRewrite are you using?
I am using
How are you running OpenRewrite?
I am using the Maven plugin on spring-petclinic-migration with the
SpringBoot2JUnit4to5Migration
as described in the quickstart guide, just without OrderImports and the custom recipe:(the tutorial uses version
5.16.0
but it does not seem to make a difference)What is the smallest, simplest way to reproduce the problem?
Follow the tutorial 😏 then run
mvn verify
.What did you expect to see?
The project should compile successfully.
What did you see instead?
PetTypeFormatterTests
does not compile because it cannot findMockitoExtension
. It appears to be missing themockito-junit-jupiter
dependency:It would also be better to set
instead of forcing the version on the
org.junit.jupiter:junit-jupiter
dependency, because the mismatchingjunit-bom
gets imported. It might be good to setmockito.version
to something more recent as well for consistency, but it will only work if you also updatejunit-jupiter.version
, for API compatibility reasons.What is the full stack trace of any errors you encountered?
Are you interested in contributing a fix to OpenRewrite?
Not particularly, migrating to Junit 5 is for old projects now…
Sorry, I should have reported this earlier when I first tried OpenRewrite, instead of remembering it 3 days before Devoxx 😅
The text was updated successfully, but these errors were encountered: