Skip to content

Commit bfe1476

Browse files
committed
Use com.ryandens.javaagent-test instead of hand-rolled solution
1 parent ac55169 commit bfe1476

3 files changed

Lines changed: 2 additions & 45 deletions

File tree

build.gradle

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ plugins {
3131
id 'maven-publish'
3232
id 'signing'
3333
id 'org.asciidoctor.jvm.convert' version '4.0.5'
34+
id 'com.ryandens.javaagent-test' version '0.12.2'
3435
}
3536

3637
defaultTasks 'clean', 'build'
@@ -86,9 +87,6 @@ java {
8687

8788
configurations {
8889
asciidoctorExt
89-
if (project.testJava > 8) {
90-
mockitoAgent
91-
}
9290
}
9391

9492
ext {
@@ -121,9 +119,7 @@ dependencies {
121119
if (project.testJava == 8) {
122120
testImplementation "org.mockito:mockito-inline:$mockito"
123121
} else {
124-
mockitoAgent("org.mockito:mockito-core:$mockito") {
125-
transitive = false
126-
}
122+
testJavaagent("org.mockito:mockito-core:$mockito")
127123
}
128124
testImplementation "org.mockito:mockito-junit-jupiter:$mockito"
129125

@@ -258,13 +254,6 @@ test {
258254
println "Running tests for type ${project.'test.gds_type'}"
259255
// Use junit platform for unit tests
260256
useJUnitPlatform()
261-
if (project.testJava > 8) {
262-
jvmArgumentProviders.add(
263-
objects.newInstance(JavaAgentProvider).tap {
264-
agent = configurations.mockitoAgent.asPath
265-
}
266-
)
267-
}
268257

269258
// Test configuration, defaults specified in gradle.properties (modify through ext, or use -P<prop>=<value>)
270259
systemProperties(

buildSrc/build.gradle

Lines changed: 0 additions & 9 deletions
This file was deleted.

buildSrc/src/main/groovy/build-helpers.gradle

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)