Skip to content

Instantly share code, notes, and snippets.

@tkshnwesper
Created January 5, 2018 17:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkshnwesper/6fb9896bc86946e7cc8d93a0ecfd2f1f to your computer and use it in GitHub Desktop.
Save tkshnwesper/6fb9896bc86946e7cc8d93a0ecfd2f1f to your computer and use it in GitHub Desktop.
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
Copy link

Thanks dude

@rupinder1133
Copy link

rupinder1133 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