diff options
author | lapentafd <francesco.lapenta@est.tech> | 2024-06-24 10:54:54 +0100 |
---|---|---|
committer | lapentafd <francesco.lapenta@est.tech> | 2024-06-26 14:41:42 +0100 |
commit | ad800650d7958985a34ac30d77407a9ce7c2de1a (patch) | |
tree | dfb0f1cc3bcfb9c59cf68ba7ab45eb22842a34fb /a1-policy-management/src/test | |
parent | f734a409bfab49b88deb9979315b593d964ecfa2 (diff) |
Wrap AsyncWebClient to use less the ApplicationContextProvider1.7.0
Issue-ID: CCSDK-4022
Change-Id: I2ecc3431ef646fe408de0de35698e8f369a55ee4
Signed-off-by: lapentafd <francesco.lapenta@est.tech>
Diffstat (limited to 'a1-policy-management/src/test')
2 files changed, 11 insertions, 11 deletions
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/OtelConfigTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/OtelConfigTest.java index 7c04de20..bd011193 100644 --- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/OtelConfigTest.java +++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/OtelConfigTest.java @@ -28,9 +28,7 @@ import static org.mockito.Mockito.when; import io.micrometer.observation.Observation; import io.micrometer.observation.ObservationRegistry; -import io.opentelemetry.api.OpenTelemetry; import io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporter; -import io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdk; import jakarta.servlet.http.HttpServletRequest; import java.util.Objects; import org.junit.jupiter.api.Test; @@ -40,8 +38,8 @@ import org.springframework.boot.test.autoconfigure.actuate.observability.AutoCon import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.Bean; import org.springframework.http.server.observation.ServerRequestObservationContext; +import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.TestPropertySource; import org.springframework.util.AntPathMatcher; @@ -54,12 +52,14 @@ import org.springframework.util.AntPathMatcher; "app.filepath=", "app.s3.bucket=", "spring.application.name=a1-pms", - "management.tracing.enabled=true", - "management.tracing.exporter.protocol=grpc", - "management.tracing.sampler.jaeger_remote.endpoint=http://127.0.0.1:14250", + "otel.sdk.disabled=false", + "otel.sdk.south=true", + "otel.exporter.otlp.traces.protocol=grpc", + "otel.tracing.sampler.jaeger-remote.endpoint=http://127.0.0.1:14250", "management.tracing.propagator.type=W3C" }) @AutoConfigureObservability +@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) class OtelConfigTest { @Autowired private ApplicationContext context; @@ -68,11 +68,6 @@ class OtelConfigTest { @Autowired ObservationRegistry observationRegistry; - @Bean - OpenTelemetry openTelemetry() { - return AutoConfiguredOpenTelemetrySdk.initialize().getOpenTelemetrySdk(); - } - @Test void otlpExporterGrpc() { assertNotNull(otelConfig); diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java index 4f3fa5f5..69ee12ba 100644 --- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java +++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java @@ -195,6 +195,11 @@ class ApplicationTest { @BeforeEach void init() { this.applicationConfig.setAuthProviderUrl(baseUrl() + OpenPolicyAgentSimulatorController.ACCESS_CONTROL_URL); + rics.clear(); + policies.clear(); + policyTypes.clear(); + services.clear(); + a1ClientFactory.reset(); } @AfterEach |