Junit 5, EAP 208.2
已回答
This may not be a regression, but I'm running
IntelliJ IDEA 2018.2 EAP (Community Edition)
Build #IC-182.2949.4, built on June 5, 2018
JRE: 1.8.0_152-release-1226-b7 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.6
And having trouble getting a simple Junit 5 test case to run.
I have the dependencies in my pom ie:
<properties>
<junit.platform.version>1.2.0</junit.platform.version>
<junit.jupiter.version>5.2.0</junit.jupiter.version>
</properties>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.jupiter.version}</version>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>${junit.platform.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
My maven projects are auto import
Then in my testcode I have
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertThrows;
public class GovernanceEngineImplTest {
private Throwable thrown;
@Test
void mytest1() {
thrown = assertThrows(InvalidParameterException.class, () ->
{
// my code that causes an exception
});
}
But I simply get
No tests were found
when trying to run within the UI
请先登录再写评论。
Ah.. answered myself. I'd migrated some tests from TestNG and still had an old run configuration. I created a JUnit one & then deleted all configs and now the tests run