if you get this error :

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:testCompile (default-testCompile) on project XXXX: Compilation failure
[ERROR] /src/test/java/com/XXX/XXXApplicationTests.java:[13,17] cannot find symbol
[ERROR] symbol:   method assertEquals(java.lang.String,java.lang.String)
[ERROR] location: class com.XXX.XXXTests
[ERROR] -> [Help 1]

this JUnit 5 the package name has changed and the Assertions are at org.junit.jupiter.api.Assertions and Assumptions at org.junit.jupiter.api.Assumptions So you have to add the following static import:

import static org.junit.jupiter.api.Assertions.*;

See also http://junit.org/junit5/docs/current/user-guide/#writing-tests-assertions

thank you!

Aller au contenu principal