Код: Выделить всё
mvn clean test
Код: Выделить всё
[ERROR] TestEngine with ID 'junit-jupiter' failed to discover tests
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
Структура проекта:
Код: Выделить всё
src/main/java/com/trazia/trazia_project/...
src/test/java/com/trazia/trazia_project/service/RecipeServiceTest.java
src/test/java/com/trazia/trazia_project/service/ProductServiceTest.java
src/test/java/com/trazia/trazia_project/product/ProductControllerTest.java
src/test/java/com/trazia/trazia_project/product/ProductTest.java
src/test/java/com/trazia/trazia_project/ProductMapperTestUtils.java
Зависимости и плагины тестов POM:
Код: Выделить всё
org.springframework.boot
spring-boot-starter-test
test
org.springframework.security
spring-security-test
test
org.junit.jupiter
junit-jupiter-api
5.9.3
test
org.junit.jupiter
junit-jupiter-engine
5.9.3
test
org.mockito
mockito-core
5.2.0
test
org.mockito
mockito-junit-jupiter
5.2.0
test
org.apache.maven.plugins
maven-surefire-plugin
3.2.5
**/*Test.java
Код: Выделить всё
• All tests are annotated with @Test from org.junit.jupiter.api.Test.
• The project builds fine, main classes work, and integration with Spring Boot is correct.
• I have verified the folder structure and package names, all match the imports in the test classes.
• Java version: 21
• Maven version: 3.9.11
Кто-нибудь знает, что может помешать JUnit 5 обнаружить тесты в этой настройке?>
Подробнее здесь: https://stackoverflow.com/questions/797 ... ava-21-vis
Мобильная версия