File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7676
7777configurations {
7878 asciidoctorExt
79+ mockitoAgent
7980}
8081
8182dependencies {
@@ -91,6 +92,10 @@ dependencies {
9192
9293 testImplementation platform(testLibs. mockito. bom)
9394 testImplementation testLibs. bundles. mockito
95+ mockitoAgent platform(testLibs. mockito. bom)
96+ mockitoAgent(testLibs. mockito. core) {
97+ transitive = false
98+ }
9499
95100 testImplementation testLibs. awaitility
96101 // A lot (if not all) tests for jaybird-native are in the main project given dependencies on test infrastructure
@@ -219,6 +224,11 @@ test {
219224 println " Running tests for type ${ project.'test.gds_type'} "
220225 // Use junit platform for unit tests
221226 useJUnitPlatform()
227+ jvmArgumentProviders. add(
228+ objects. newInstance(JavaAgentProvider ). tap {
229+ agent = configurations. mockitoAgent. asPath
230+ }
231+ )
222232
223233 // Test configuration, defaults specified in gradle.properties (modify through ext, or use -P<prop>=<value>)
224234 systemProperties(
Original file line number Diff line number Diff line change 1+ // SPDX-FileCopyrightText: Copyright 2026 Mark Rotteveel
2+ // SPDX-License-Identifier: LGPL-2.1-or-later
3+ plugins {
4+ id ' groovy-gradle-plugin'
5+ }
6+
7+ repositories {
8+ gradlePluginPortal()
9+ }
Original file line number Diff line number Diff line change 1+ // SPDX-FileCopyrightText: Copyright 2026 Mark Rotteveel
2+ // SPDX-License-Identifier: LGPL-2.1-or-later
3+ import org.gradle.api.provider.Property
4+ import org.gradle.api.tasks.InputFile
5+ import org.gradle.api.tasks.PathSensitive
6+ import org.gradle.api.tasks.PathSensitivity
7+ import org.gradle.process.CommandLineArgumentProvider
8+
9+ /**
10+ * Provider for {@code -javaagent:some.jar } command line arguments.
11+ */
12+ abstract class JavaAgentProvider implements CommandLineArgumentProvider {
13+
14+ @InputFile
15+ @PathSensitive (PathSensitivity .RELATIVE )
16+ abstract Property<String > getAgent ()
17+
18+ @Override
19+ Iterable<String > asArguments () {
20+ [" -javaagent:${ agent.get()} " ]
21+ }
22+
23+ }
You can’t perform that action at this time.
0 commit comments