X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=dmaap-adaptor-java%2Fsrc%2Ftest%2Fjava%2Forg%2Foran%2Fdmaapadapter%2FEcsSimulatorController.java;h=1cf8903a0755cf1ae338d30aa8e539495ffde415;hb=ce1d9f2d3e1d2713289dc4d2b5c246f99ec65160;hp=7542e0bdcd917f4cb455e7c55e8eedcf7d58e94a;hpb=b5fecf5c17cfa8663aea3a3432ee5a9717ebb0cc;p=nonrtric.git diff --git a/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/EcsSimulatorController.java b/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/EcsSimulatorController.java index 7542e0bd..1cf8903a 100644 --- a/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/EcsSimulatorController.java +++ b/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/EcsSimulatorController.java @@ -45,8 +45,8 @@ import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; -@RestController("EcsSimulatorController") -@Tag(name = "EcsSimulator") +@RestController("IcsSimulatorController") +@Tag(name = "Information Coordinator Service Simulator (exists only in test)") public class EcsSimulatorController { private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @@ -54,14 +54,16 @@ public class EcsSimulatorController { public static class TestResults { - ProducerRegistrationInfo registrationInfo; + ProducerRegistrationInfo registrationInfo = null; Map types = new HashMap<>(); + String infoProducerId = null; public TestResults() {} public void reset() { registrationInfo = null; types.clear(); + infoProducerId = null; } } @@ -77,7 +79,6 @@ public class EcsSimulatorController { } else { return new ResponseEntity<>(HttpStatus.NOT_FOUND); } - } @PutMapping(path = API_ROOT + "/info-producers/{infoProducerId}", // @@ -86,6 +87,7 @@ public class EcsSimulatorController { @PathVariable("infoProducerId") String infoProducerId, // @RequestBody ProducerRegistrationInfo registrationInfo) { testResults.registrationInfo = registrationInfo; + testResults.infoProducerId = infoProducerId; return new ResponseEntity<>(HttpStatus.OK); } @@ -103,7 +105,7 @@ public class EcsSimulatorController { new ProducerJobInfo(job.jobDefinition, jobId, job.infoTypeId, job.jobResultUri, job.owner, "TIMESTAMP"); String body = gson.toJson(request); logger.info("ECS Simulator PUT job: {}", body); - restClient.post(url, body).block(); + restClient.post(url, body, MediaType.APPLICATION_JSON).block(); } public void deleteJob(String jobId, AsyncRestClient restClient) {