X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=enrichment-coordinator-service%2Fsrc%2Ftest%2Fjava%2Forg%2Foransc%2Fenrichment%2FApplicationTest.java;h=a863c103375b185849fba01abe6bee7d7f4d02b1;hb=30f931f999a839a549d6c3bda6e182c8e3ec0b2f;hp=3a52fbc29e8562bea0fb66fa138444d36433ea26;hpb=1e539490bc37fed791895dd1f2f898caa3b0ca5c;p=nonrtric.git diff --git a/enrichment-coordinator-service/src/test/java/org/oransc/enrichment/ApplicationTest.java b/enrichment-coordinator-service/src/test/java/org/oransc/enrichment/ApplicationTest.java index 3a52fbc2..a863c103 100644 --- a/enrichment-coordinator-service/src/test/java/org/oransc/enrichment/ApplicationTest.java +++ b/enrichment-coordinator-service/src/test/java/org/oransc/enrichment/ApplicationTest.java @@ -170,6 +170,8 @@ class ApplicationTest { JSONObject jsonObj = new JSONObject(resp.getBody()); jsonObj.remove("host"); + assertThat(jsonObj.getJSONObject("definitions").remove("Mono«ResponseEntity«object»»")).isNotNull(); + assertThat(jsonObj.getJSONObject("definitions").remove("Void")).isNotNull(); String indented = jsonObj.toString(4); try (PrintStream out = new PrintStream(new FileOutputStream("api/ecs-api.json"))) { out.print(indented); @@ -197,6 +199,13 @@ class ApplicationTest { assertThat(putEiType(EI_TYPE_ID)).isEqualTo(HttpStatus.OK); } + @Test + void testPutEiType_noSchema() { + String url = ProducerConsts.API_ROOT + "/eitypes/" + EI_TYPE_ID; + String body = "{}"; + testErrorCode(restClient().put(url, body), HttpStatus.BAD_REQUEST, "No schema provided"); + } + @Test void testGetEiType() throws Exception { putEiProducerWithOneType(EI_PRODUCER_ID, "test"); @@ -429,6 +438,13 @@ class ApplicationTest { assertThat(request.id).isEqualTo("jobId"); } + @Test + void testPutEiProducer_noType() throws Exception { + String url = ProducerConsts.API_ROOT + "/eiproducers/eiProducerId"; + String body = gson.toJson(producerEiRegistratioInfo(EI_TYPE_ID)); + testErrorCode(restClient().put(url, body), HttpStatus.NOT_FOUND, "EI type not found"); + } + @Test void testPutProducerAndEiJob() throws Exception { this.putEiType(EI_TYPE_ID);