Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Pathashala Gradle Boilerplate (with JUnit5 and Mockito 2.+)
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.1'
}
}
apply plugin: 'java'
apply plugin: 'org.junit.platform.gradle.plugin'
repositories {
mavenCentral()
jcenter()
}
dependencies {
testCompile(
'org.junit.jupiter:junit-jupiter-api:5.0.1',
"org.mockito:mockito-core:2.+"
)
testRuntime(
'org.junit.jupiter:junit-jupiter-engine:5.0.1',
'org.junit.vintage:junit-vintage-engine:4.12.1',
'org.junit.platform:junit-platform-launcher:1.0.1',
'org.junit.platform:junit-platform-runner:1.0.1'
)
}
sourceSets {
main {
java {
srcDirs = ['src/main']
}
resources {
srcDirs = ['src/resources']
}
}
test {
java {
srcDirs = ['src/test']
}
}
}
@jeremyj-thoughtworks

This comment has been minimized.

Copy link

commented Jan 7, 2018

Thanks dude

@rupinder1133

This comment has been minimized.

Copy link

commented Jan 11, 2018

I think dependencies org.junit.vintage:junit-vintage-engine:4.12.1 onwards is not required, it's for jUnit 4

Everything works fine with with the following testRuntime dependencies

testRuntime(
            'org.junit.jupiter:junit-jupiter-engine:5.0.1'
    )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.