X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=information-coordinator-service%2Fsrc%2Ftest%2Fjava%2Forg%2Foransc%2Fics%2Fcontroller%2FConsumerSimulatorController.java;h=4f2edcdc0565f19d9ac161ffdc09e6aa0eddf329;hb=refs%2Fchanges%2F26%2F7726%2F2;hp=3d69ee696f36d6a52b9745fada0d1bbc65dad2c6;hpb=e2871f2bfeb581ba608640cb8daae89430632914;p=nonrtric.git diff --git a/information-coordinator-service/src/test/java/org/oransc/ics/controller/ConsumerSimulatorController.java b/information-coordinator-service/src/test/java/org/oransc/ics/controller/ConsumerSimulatorController.java index 3d69ee69..4f2edcdc 100644 --- a/information-coordinator-service/src/test/java/org/oransc/ics/controller/ConsumerSimulatorController.java +++ b/information-coordinator-service/src/test/java/org/oransc/ics/controller/ConsumerSimulatorController.java @@ -35,8 +35,6 @@ import java.util.List; import lombok.Getter; import org.oransc.ics.controllers.VoidResponse; -import org.oransc.ics.controllers.a1e.A1eConsts; -import org.oransc.ics.controllers.a1e.A1eEiJobStatus; import org.oransc.ics.controllers.r1consumer.ConsumerConsts; import org.oransc.ics.controllers.r1consumer.ConsumerTypeRegistrationInfo; import org.slf4j.Logger; @@ -44,25 +42,22 @@ import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; @RestController("ConsumerSimulatorController") +@Tag(name = ConsumerConsts.CONSUMER_API_CALLBACKS_NAME, description = ConsumerConsts.CONSUMER_API_DESCRIPTION) public class ConsumerSimulatorController { private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static class TestResults { - public List eiJobStatusCallbacks = - Collections.synchronizedList(new ArrayList()); public List typeRegistrationInfoCallbacks = Collections.synchronizedList(new ArrayList()); public void reset() { - eiJobStatusCallbacks.clear(); typeRegistrationInfoCallbacks.clear(); } } @@ -70,39 +65,12 @@ public class ConsumerSimulatorController { @Getter private TestResults testResults = new TestResults(); - public static String getJobStatusUrl(String infoJobId) { - return "/example_dataconsumer/info_jobs/" + infoJobId + "/status"; - } - - @Tag(name = A1eConsts.CONSUMER_API_CALLBACKS_NAME) - @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( - responseCode = "200", - description = "OK", // - content = @Content(schema = @Schema(implementation = VoidResponse.class))) // - }) - public ResponseEntity jobStatusCallback( // - @PathVariable("infoJobId") String infoJobId, // - @RequestBody A1eEiJobStatus status) { - logger.info("Job status callback status: {} infoJobId: {}", status.state, infoJobId); - this.testResults.eiJobStatusCallbacks.add(status); - return new ResponseEntity<>(HttpStatus.OK); - } - - private static final String TYPE_STATUS_CALLBACK_URL = "/example_dataconsumer/info_type_status"; + private static final String TYPE_STATUS_CALLBACK_URL = "/example-dataconsumer/info-type-status"; public static String getTypeStatusCallbackUrl() { return TYPE_STATUS_CALLBACK_URL; } - @Tag(name = ConsumerConsts.CONSUMER_API_CALLBACKS_NAME) @PostMapping(path = TYPE_STATUS_CALLBACK_URL, produces = MediaType.APPLICATION_JSON_VALUE) @Operation( summary = "Callback for changed Information type registration status",