Upgrade from JUnit 4 to JUnit 5 in intellij with gradle -
i want convert gradle project test junit 4 junit 5. there lot of tests, don't want convert them @ same time.
i try configure build.gradle
this:
apply plugin: 'java' compiletestjava { sourcecompatibility = 1.8 targetcompatibility = 1.8 } repositories { mavencentral() } dependencies { testcompile("junit:junit:4.12") testcompile 'org.junit.jupiter:junit-jupiter-api:5.0.0-m2' testruntime("org.junit.vintage:junit-vintage-engine:4.12.0-m2") testruntime 'org.junit.jupiter:junit-jupiter-engine:5.0.0-m2' }
old test still running, intellij didn't recognize new junit 5 test one:
import org.junit.jupiter.api.test; import static org.junit.jupiter.api.assertions.asserttrue; public class junit5test { @test void test() { asserttrue(true); } }
i'm using intellij 2016.2 gradle 2.9
currently intellij idea supports junit5.
take @ nice article integrating junit5 idea: using junit 5 in intellij idea
Comments
Post a Comment