I'm running into an error with my UnitTests. Can't...
# getting-started
v
I'm running into an error with my UnitTests. Can't really make sense of the errormessage: - Is this an issue with gradle? The only test atm is a simple @Test assert(true). https://pastebin.com/GZXsiDWL
j
My guess is that you configured gradle to use JUnit 5, but used the JUnit 4 Test annotation, or vice-versa. You should show us the full code of the test (including imports), the test task configuration, and tell us how you execute the test.
v
I ran it by clicking the "run" arrow next to the fun() @jbnizet
j
It seems you haven’t configured the test class in the gradle script. So it uses JUnit 4 by default. You need to configure itto use JUnit 5, since, apparently (but you didn’t post your imports so I can only guess based on the BeforeAll annotation), you’re using JUnit 5. See https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html: you must call useJUnitPlatform() as the example shows)
v
That and adding a dependancy solved it. Thank you!
👍 1