Merge "Uplift of PMS source from ONAP"
authorHenrik Andersson <henrik.b.andersson@est.tech>
Tue, 21 Sep 2021 13:58:08 +0000 (13:58 +0000)
committerGerrit Code Review <gerrit@o-ran-sc.org>
Tue, 21 Sep 2021 13:58:08 +0000 (13:58 +0000)
dmaap-adaptor-java/Dockerfile
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 46dfba5..b2c0c30 100644 (file)
@@ -1,8 +1,8 @@
 #
 # ============LICENSE_START=======================================================
-# ONAP : ccsdk oran
+# O-RAN-SC
 # ================================================================================
-# Copyright (C) 2019-2020 Nordix Foundation. All rights reserved.
+# Copyright (C) 2021 Nordix Foundation. All rights reserved.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -40,4 +40,4 @@ ADD /config/truststore.jks /opt/app/dmaap-adaptor-service/etc/cert/truststore.jk
 RUN chmod -R 777 /opt/app/dmaap-adaptor-service/config/
 
 ADD target/${JAR} /opt/app/dmaap-adaptor-service/dmaap-adaptor.jar
-CMD ["java", "-jar", "/opt/app/policy-agent/dmaap-adaptor.jar"]
+CMD ["java", "-jar", "/opt/app/dmaap-adaptor-service/dmaap-adaptor.jar"]
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;