I am writing a game in libGDX using IntelliJ. I am writing the tests and having difficulty running them using gradle test
. I get the error:
error: package org.junit.jupiter.api does not exist
org.junit.jupiter:junit-jupiter-api:5.1.0
is in the Gradle dependencies. I have included repositories(mavenCentral())
in build.gradle. I have followed the documentation for Gradle 4.6 and JUnit 5 so also have the following:
test{
useJUnitPlatform()
}
However this seems to make no difference. Whenever I change the dependencies it affects whether I can run the JUnit tests so I know it is using them. It is just that when I run gradle test
I get that error. How can I fix this?