summaryrefslogtreecommitdiffstats
path: root/a1-policy-management/src/test/java/org/onap
diff options
context:
space:
mode:
Diffstat (limited to 'a1-policy-management/src/test/java/org/onap')
-rw-r--r--a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/OtelConfigTest.java17
-rw-r--r--a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java5
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