Closed
Description
Description
IntelliJ IDEA is generating default Gradle project with separate jupiter-api and jupiter-engine dependencies.
For compiling JUnit5 parametrized tests jupiter-params dependency is needed.
To Reproduce
Steps to reproduce the behavior:
- Run IntelliJ IDEA with UTBot plugin installed
- File -> New -> Project... -> Enter name, select Java, Gradle, JDK 8/11, Groovy, click Create
- Open build.gradle, check dependencies added by default
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}
- Add a simple class to the project src\main\java
- Create tests with UTBot... for it - with JUnit5 and Parametrized
- See the generated test
Expected behavior
All required dependencies, including params, are added
Actual behavior
ParameterizedTest, MethodSource are not found - Cannot resolve symbol... compilation errors are shown.
Tests cannot be compiled and executed.
Visual proofs (screenshots, logs, images)
Environment
Windows 10 Pro
IDEA Ultimate 2022.1.4
JDK 11
Additional context
To fix the issue:
- add params
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.1'
}
or
2) add parent dependency, params included
dependencies {
implementation 'org.junit.jupiter:junit-jupiter:5.8.1'
}
When JUnit5 dependency is added by UTBot the 2nd one is added - works fine.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done