Is it a option to use junit as test Framework? I c...
# questions
m
Is it a option to use junit as test Framework? I choosed this from the start.grails.org but I do not find any doc and the test for new controllers are still spock Test. What does this choice change?
g
It's an option, I wouldn't say it's a good option though. I think the only differences are in build.gradle where it adds:
Copy code
testImplementation("org.junit.jupiter:junit-jupiter:5.10.1")
and removes:
Copy code
tasks.withType(Test) {
    useJUnitPlatform()
    systemProperty "geb.env", System.getProperty('geb.env')
    systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
    systemProperty 'webdriver.chrome.driver', "${System.getenv('CHROMEWEBDRIVER')}/chromedriver"
    systemProperty 'webdriver.gecko.driver', "${System.getenv('GECKOWEBDRIVER')}/geckodriver"
}
webdriverBinaries {
    chromedriver '110.0.5481.77'
    geckodriver '0.32.2'
    edgedriver '110.0.1587.57'
}
Grails originally used Junit years ago I think before 2.4 came out give or take. In general, I would use Spock as with Junit you would be pretty much on your own. I think the only reason to still have Junit test would be because you have a large legacy app and you don't want to port all of your tests to Spock.