Skip to content

Commit 8878ae5

Browse files
committed
Upgrade metrics exporter to use JUnit5
1 parent 919de1b commit 8878ae5

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

exporters/metrics/build.gradle

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,19 @@ dependencies {
2727
implementation(platform(libraries.opentelemetry_bom))
2828
implementation(project(':shared-resourcemapping'))
2929
implementation(libraries.opentelemetry_semconv)
30-
testImplementation(testLibraries.junit)
30+
testImplementation(testLibraries.junit5)
31+
testImplementation(testLibraries.junit5_params)
32+
testRuntimeOnly(testLibraries.junit5_runtime)
3133
testImplementation(testLibraries.mockito)
3234
testImplementation(testLibraries.slf4j_simple)
3335
testImplementation(testLibraries.test_containers)
3436
testImplementation(testLibraries.opentelemetry_sdk_testing)
3537
testImplementation(testLibraries.opencensus_shim)
3638
}
3739

40+
test {
41+
// required for discovering JUnit 5 tests
42+
useJUnitPlatform()
43+
}
44+
3845
test.dependsOn ':shared-resourcemapping:shadowJar'

exporters/metrics/src/test/java/com/google/cloud/opentelemetry/metric/MetricConfigurationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
import static org.junit.Assert.assertFalse;
2020
import static org.junit.Assert.assertNotNull;
2121
import static org.junit.Assert.assertNull;
22-
import static org.junit.Assert.assertThrows;
2322
import static org.junit.Assert.assertTrue;
23+
import static org.junit.jupiter.api.Assertions.assertThrows;
2424

2525
import com.google.auth.Credentials;
2626
import com.google.auth.oauth2.AccessToken;

0 commit comments

Comments
 (0)