Skip to content

Commit

Permalink
Merge pull request #5261 from kwvanderlinde/refactor/5215-mockito-age…
Browse files Browse the repository at this point in the history
…nt-fix

Register mockito as a java agent
  • Loading branch information
cwisniew authored Feb 14, 2025
2 parents d7e2785 + 55b1bd8 commit 5c84544
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
9 changes: 0 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,6 @@ dependencies {
implementation(libs.rptools.maptool.addons)
implementation(libs.rptools.dice.roller)
implementation(libs.noiselib)

testRuntimeOnly(libs.junit.platform.launcher)
testRuntimeOnly(libs.junit.engine)
testImplementation(libs.bundles.junit)
testImplementation(libs.mockito.core)
}

processResources {
Expand Down Expand Up @@ -506,10 +501,6 @@ javadoc {
options.tags("note:a:<strong><u>Note:</u></strong>")
}

test {
useJUnitPlatform()
}

task createWrapper(type: Wrapper) {
gradleVersion = '8.2.1'
}
19 changes: 19 additions & 0 deletions buildSrc/shared.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,23 @@ spotless {
// or spaces. Takes an integer argument if you don't like 4
indentWithSpaces(4)
}
}

configurations {
mockitoAgent
}

dependencies {
testRuntimeOnly(libs.junit.platform.launcher)
testRuntimeOnly(libs.junit.engine)
testImplementation(libs.bundles.junit)
testImplementation(libs.mockito.core)
mockitoAgent(libs.mockito.core) {
transitive = false
}
}

test {
useJUnitPlatform()
jvmArgs += "-javaagent:${configurations.mockitoAgent.asPath}"
}
9 changes: 0 additions & 9 deletions clientserver/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,4 @@ dependencies {
// compression of messages between client and server
implementation(libs.apache.commons.compress)
implementation(libs.zstd)

testRuntimeOnly(libs.junit.platform.launcher)
testRuntimeOnly(libs.junit.engine)
testImplementation(libs.bundles.junit)
testImplementation(libs.mockito.core)
}

test {
useJUnitPlatform()
}

0 comments on commit 5c84544

Please sign in to comment.