NONRTRIC - Implement DMaaP mediator producer service in Java 19/6719/1
authorPatrikBuhr <patrik.buhr@est.tech>
Tue, 21 Sep 2021 07:41:19 +0000 (09:41 +0200)
committerPatrikBuhr <patrik.buhr@est.tech>
Tue, 21 Sep 2021 07:41:19 +0000 (09:41 +0200)
Fixed some sonar issues.

Signed-off-by: PatrikBuhr <patrik.buhr@est.tech>
Issue-ID: NONRTRIC-597
Change-Id: I5b7bffba9375a6e89dd3756366faeecd695ff74e

dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/ApplicationTest.java
dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/DmaapSimulatorController.java
dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/EcsSimulatorController.java
dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/IntegrationWithEcs.java

index ff50761..b2b6d96 100644 (file)
@@ -23,8 +23,6 @@ package org.oran.dmaapadapter;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.awaitility.Awaitility.await;
 
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
 import com.google.gson.JsonParser;
 
 import java.io.FileOutputStream;
@@ -49,8 +47,6 @@ import org.oran.dmaapadapter.repository.InfoType;
 import org.oran.dmaapadapter.repository.InfoTypes;
 import org.oran.dmaapadapter.repository.Jobs;
 import org.oran.dmaapadapter.tasks.ProducerRegstrationTask;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
@@ -73,7 +69,6 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
         "app.configuration-filepath=./src/test/resources/test_application_configuration.json"//
 })
 class ApplicationTest {
-    private static final Logger logger = LoggerFactory.getLogger(ApplicationTest.class);
 
     @Autowired
     private ApplicationConfig applicationConfig;
@@ -96,8 +91,6 @@ class ApplicationTest {
     @LocalServerPort
     int localServerHttpPort;
 
-    private static Gson gson = new GsonBuilder().create();
-
     static class TestApplicationConfig extends ApplicationConfig {
         @Override
         public String getEcsBaseUrl() {
index aa6220f..fbb600f 100644 (file)
@@ -64,6 +64,7 @@ public class DmaapSimulatorController {
             return ErrorResponse.create("", HttpStatus.NOT_FOUND);
         } else {
             String resp = dmaapResponses.remove(0);
+            logger.info("DMAAP simulator returned: {}", resp);
             return new ResponseEntity<>(resp, HttpStatus.OK);
         }
 
index 7d309cf..c042034 100644 (file)
@@ -102,6 +102,7 @@ public class EcsSimulatorController {
         ProducerJobInfo request =
                 new ProducerJobInfo(job.jobDefinition, "ID", job.infoTypeId, job.jobResultUri, job.owner, "TIMESTAMP");
         String body = gson.toJson(request);
+        logger.info("ECS Simulator PUT job: {}", body);
         restClient.post(url, body).block();
 
     }
index 5446004..f9ead03 100644 (file)
@@ -42,8 +42,6 @@ import org.oran.dmaapadapter.repository.InfoType;
 import org.oran.dmaapadapter.repository.InfoTypes;
 import org.oran.dmaapadapter.repository.Jobs;
 import org.oran.dmaapadapter.tasks.ProducerRegstrationTask;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
@@ -64,7 +62,6 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
         "app.ecs-base-url=https://localhost:8434" //
 })
 class IntegrationWithEcs {
-    private static final Logger logger = LoggerFactory.getLogger(ApplicationTest.class);
 
     @Autowired
     private ApplicationConfig applicationConfig;