X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=enrichment-coordinator-service%2Fsrc%2Ftest%2Fjava%2Forg%2Foransc%2Fenrichment%2Fcontroller%2FConsumerSimulatorController.java;h=a9702b29eec75d00b176e12423e4a58cdfd0877c;hb=8fd8e9fc86a24be49d61841e381423120a41296d;hp=562f28699e289167df40a7b8e5706ce230c14f3a;hpb=8489de0f43f28c5cd62206b4e242c0308f9864b9;p=nonrtric.git diff --git a/enrichment-coordinator-service/src/test/java/org/oransc/enrichment/controller/ConsumerSimulatorController.java b/enrichment-coordinator-service/src/test/java/org/oransc/enrichment/controller/ConsumerSimulatorController.java index 562f2869..a9702b29 100644 --- a/enrichment-coordinator-service/src/test/java/org/oransc/enrichment/controller/ConsumerSimulatorController.java +++ b/enrichment-coordinator-service/src/test/java/org/oransc/enrichment/controller/ConsumerSimulatorController.java @@ -20,10 +20,12 @@ package org.oransc.enrichment.controller; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.lang.invoke.MethodHandles; import java.util.ArrayList; @@ -33,7 +35,8 @@ import java.util.List; import lombok.Getter; import org.oransc.enrichment.controllers.VoidResponse; -import org.oransc.enrichment.controllers.consumer.ConsumerEiJobStatus; +import org.oransc.enrichment.controllers.a1e.A1eConsts; +import org.oransc.enrichment.controllers.a1e.A1eEiJobStatus; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; @@ -45,14 +48,14 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; @RestController("ConsumerSimulatorController") -@Api(tags = {"Consumer Callbacks"}) +@Tag(name = A1eConsts.CONSUMER_API_CALLBACKS_NAME) public class ConsumerSimulatorController { private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static class TestResults { - public List status = Collections.synchronizedList(new ArrayList()); + public List status = Collections.synchronizedList(new ArrayList()); public void reset() { status.clear(); @@ -62,20 +65,27 @@ public class ConsumerSimulatorController { @Getter private TestResults testResults = new TestResults(); - public static String getJobStatusUrl(String eiJobId) { - return "/consumer_simulator/eijobs/" + eiJobId + "/status"; + public static String getJobStatusUrl(String infoJobId) { + return "/example_dataconsumer/info_jobs/" + infoJobId + "/status"; } - @PostMapping(path = "/consumer_simulator/eijobs/{eiJobId}/status", produces = MediaType.APPLICATION_JSON_VALUE) - @ApiOperation(value = "Callback for EI job status", notes = "") + @PostMapping( + path = "/example_dataconsumer/info_jobs/{infoJobId}/status", + produces = MediaType.APPLICATION_JSON_VALUE) + @Operation( + summary = "Callback for changed Information Job status", + description = "The primitive is implemented by the data consumer and is invoked when a Information Job status has been changed.") @ApiResponses( value = { // - @ApiResponse(code = 200, message = "OK", response = VoidResponse.class)} // - ) + @ApiResponse( + responseCode = "200", + description = "OK", // + content = @Content(schema = @Schema(implementation = VoidResponse.class))) // + }) public ResponseEntity jobStatusCallback( // - @PathVariable("eiJobId") String eiJobId, // - @RequestBody ConsumerEiJobStatus status) { - logger.info("Job status callback status: {} eiJobId: {}", status.state, eiJobId); + @PathVariable("infoJobId") String infoJobId, // + @RequestBody A1eEiJobStatus status) { + logger.info("Job status callback status: {} infoJobId: {}", status.state, infoJobId); this.testResults.status.add(status); return new ResponseEntity<>(HttpStatus.OK); }