From f87356a66246a3c0f5c0da8ae7481a87b571241c Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Tue, 14 May 2024 17:06:48 +0200 Subject: [PATCH] fix test --- .../spring/smoketest/AbstractOtelSpringStarterSmokeTest.java | 1 + .../smoketest/OtelSpringStarterSmokeTestController.java | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/smoke-tests-otel-starter/spring-boot-common/src/main/java/io/opentelemetry/spring/smoketest/AbstractOtelSpringStarterSmokeTest.java b/smoke-tests-otel-starter/spring-boot-common/src/main/java/io/opentelemetry/spring/smoketest/AbstractOtelSpringStarterSmokeTest.java index 5ba98bad06ca..f87388483e51 100644 --- a/smoke-tests-otel-starter/spring-boot-common/src/main/java/io/opentelemetry/spring/smoketest/AbstractOtelSpringStarterSmokeTest.java +++ b/smoke-tests-otel-starter/spring-boot-common/src/main/java/io/opentelemetry/spring/smoketest/AbstractOtelSpringStarterSmokeTest.java @@ -172,6 +172,7 @@ void databaseQuery() { traceAssert -> traceAssert.hasSpansSatisfyingExactly( span -> span.hasName("server"), + span -> span.satisfies(s -> assertThat(s.getName()).endsWith(".getConnection")), span -> span.hasKind(SpanKind.CLIENT) .hasAttribute( diff --git a/smoke-tests-otel-starter/spring-boot-common/src/main/java/io/opentelemetry/spring/smoketest/OtelSpringStarterSmokeTestController.java b/smoke-tests-otel-starter/spring-boot-common/src/main/java/io/opentelemetry/spring/smoketest/OtelSpringStarterSmokeTestController.java index df06e67a0166..903b451dd0a9 100644 --- a/smoke-tests-otel-starter/spring-boot-common/src/main/java/io/opentelemetry/spring/smoketest/OtelSpringStarterSmokeTestController.java +++ b/smoke-tests-otel-starter/spring-boot-common/src/main/java/io/opentelemetry/spring/smoketest/OtelSpringStarterSmokeTestController.java @@ -11,7 +11,6 @@ import java.util.Optional; import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext; -import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.client.RestTemplate; @@ -26,15 +25,12 @@ public class OtelSpringStarterSmokeTestController { public static final String METER_SCOPE_NAME = "scope"; private final LongHistogram histogram; private final Optional restTemplate; - private final JdbcTemplate jdbcTemplate; private final Optional server; public OtelSpringStarterSmokeTestController( OpenTelemetry openTelemetry, RestTemplateBuilder restTemplateBuilder, - JdbcTemplate jdbcTemplate, Optional server) { - this.jdbcTemplate = jdbcTemplate; this.server = server; Meter meter = openTelemetry.getMeter(METER_SCOPE_NAME); histogram = meter.histogramBuilder(TEST_HISTOGRAM).ofLongs().build();