From 938c3622c61d20f866e95e244a87e392cb8d04d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edd=C3=BA=20Mel=C3=A9ndez?= Date: Tue, 2 Sep 2025 14:47:09 -0600 Subject: [PATCH] Move Grafana tests to JUnit Jupiter --- modules/grafana/build.gradle | 9 ++++++++- .../testcontainers/grafana/LgtmStackContainerTest.java | 6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/grafana/build.gradle b/modules/grafana/build.gradle index 1bb588498d8..bd69ea40170 100644 --- a/modules/grafana/build.gradle +++ b/modules/grafana/build.gradle @@ -3,13 +3,20 @@ description = "Testcontainers :: Grafana" dependencies { api project(':testcontainers') + testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.0' + + testImplementation 'org.junit.jupiter:junit-jupiter:5.13.4' testImplementation 'org.assertj:assertj-core:3.27.4' testImplementation 'io.rest-assured:rest-assured:5.5.6' testImplementation 'io.micrometer:micrometer-registry-otlp:1.15.3' - testImplementation 'uk.org.webcompere:system-stubs-junit4:2.1.8' + testImplementation 'uk.org.webcompere:system-stubs-jupiter:2.1.8' testImplementation platform('io.opentelemetry:opentelemetry-bom:1.53.0') testImplementation 'io.opentelemetry:opentelemetry-api' testImplementation 'io.opentelemetry:opentelemetry-sdk' testImplementation 'io.opentelemetry:opentelemetry-exporter-otlp' } + +test { + useJUnitPlatform() +} diff --git a/modules/grafana/src/test/java/org/testcontainers/grafana/LgtmStackContainerTest.java b/modules/grafana/src/test/java/org/testcontainers/grafana/LgtmStackContainerTest.java index ba4fb94856c..ff8d5cb6609 100644 --- a/modules/grafana/src/test/java/org/testcontainers/grafana/LgtmStackContainerTest.java +++ b/modules/grafana/src/test/java/org/testcontainers/grafana/LgtmStackContainerTest.java @@ -21,7 +21,7 @@ import io.restassured.RestAssured; import io.restassured.response.Response; import org.awaitility.Awaitility; -import org.junit.Test; +import org.junit.jupiter.api.Test; import uk.org.webcompere.systemstubs.SystemStubs; import java.time.Duration; @@ -29,10 +29,10 @@ import static org.assertj.core.api.Assertions.assertThat; -public class LgtmStackContainerTest { +class LgtmStackContainerTest { @Test - public void shouldPublishMetricsTracesAndLogs() throws Exception { + void shouldPublishMetricsTracesAndLogs() throws Exception { try ( // container { LgtmStackContainer lgtm = new LgtmStackContainer("grafana/otel-lgtm:0.11.1") // }