Created
January 5, 2018 17:33
-
-
Save tkshnwesper/6fb9896bc86946e7cc8d93a0ecfd2f1f to your computer and use it in GitHub Desktop.
Pathashala Gradle Boilerplate (with JUnit5 and Mockito 2.+)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'] | |
} | |
} | |
} |
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
Thanks dude