Skip to content

Commit 3e34eb3

Browse files
committed
fix
1 parent 05fc07b commit 3e34eb3

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

javaagent-tooling/build.gradle.kts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,14 @@ testing {
113113
compileOnly("com.google.code.findbugs:annotations")
114114
}
115115
}
116+
117+
val testConfigFile by registering(JvmTestSuite::class) {
118+
dependencies {
119+
implementation(project(":javaagent-tooling"))
120+
// requires mockito-inline
121+
implementation("uk.org.webcompere:system-stubs-jupiter")
122+
}
123+
}
116124
}
117125
}
118126

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,23 @@
1414
import java.nio.charset.StandardCharsets;
1515
import java.nio.file.Files;
1616
import java.util.Map;
17-
import org.junit.Rule;
18-
import org.junit.contrib.java.lang.system.EnvironmentVariables;
1917
import org.junit.jupiter.api.Test;
18+
import org.junit.jupiter.api.extension.ExtendWith;
2019
import org.junit.jupiter.api.io.TempDir;
2120
import org.junitpioneer.jupiter.ClearSystemProperty;
21+
import uk.org.webcompere.systemstubs.environment.EnvironmentVariables;
22+
import uk.org.webcompere.systemstubs.jupiter.SystemStub;
23+
import uk.org.webcompere.systemstubs.jupiter.SystemStubsExtension;
2224

25+
@ExtendWith(SystemStubsExtension.class)
2326
@ClearSystemProperty(key = "otel.javaagent.configuration-file")
2427
class ConfigurationFileTest {
2528

2629
@TempDir File tmpDir;
2730

28-
@Rule public EnvironmentVariables environmentVariables = new EnvironmentVariables();
31+
@SystemStub private EnvironmentVariables environmentVariables;
32+
33+
// @SystemStub private SystemProperties systemProperties;
2934

3035
@Test
3136
void shouldUseEnvVar() throws IOException {

0 commit comments

Comments
 (0)