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=441842969b39e2cecd97161617bdbc56bc8fbb31;hb=1ed3146635bb9cb256e8ea7b47df985b5afde310;hp=4d64ef65b0168454fc6c93fe1601d5ccfdd4dcc5;hpb=4917d45e3e4a08e3e587c88ec17a12dc6da4d073;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 4d64ef65..44184296 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 @@ -490,7 +490,10 @@ class ApplicationTest { "targetUri", "jobStatusUrl"); String body = gson.toJson(jobInfo); - testErrorCode(restClient().put(url, body), HttpStatus.CONFLICT, "Json validation failure"); + testErrorCode(restClient().put(url, body), HttpStatus.BAD_REQUEST, "Json validation failure"); + + testErrorCode(restClient().put(url, "{jojo}"), HttpStatus.BAD_REQUEST, "", false); + } @Test @@ -503,7 +506,7 @@ class ApplicationTest { new ConsumerJobInfo("typeId", jsonObject("{ \"XXstring\" : \"value\" }"), "owner", "targetUri", null); String body = gson.toJson(jobInfo); - testErrorCode(restClient().put(url, body), HttpStatus.CONFLICT, "Json validation failure"); + testErrorCode(restClient().put(url, body), HttpStatus.BAD_REQUEST, "Json validation failure"); } @Test @@ -515,7 +518,7 @@ class ApplicationTest { ConsumerJobInfo jobInfo = new ConsumerJobInfo(TYPE_ID, jsonObject(), "owner", "junk", null); String body = gson.toJson(jobInfo); - testErrorCode(restClient().put(url, body), HttpStatus.CONFLICT, "URI: junk is not absolute"); + testErrorCode(restClient().put(url, body), HttpStatus.BAD_REQUEST, "URI: junk is not absolute"); } @Test @@ -552,6 +555,8 @@ class ApplicationTest { String url = ProducerConsts.API_ROOT + "/info-types/" + TYPE_ID; String body = "{}"; testErrorCode(restClient().put(url, body), HttpStatus.BAD_REQUEST, "No schema provided"); + + testErrorCode(restClient().post(url, body), HttpStatus.METHOD_NOT_ALLOWED, "", false); } @Test @@ -572,8 +577,7 @@ class ApplicationTest { void producerDeleteEiTypeExistingProducer() throws Exception { putInfoProducerWithOneType(PRODUCER_ID, TYPE_ID); String url = ProducerConsts.API_ROOT + "/info-types/" + TYPE_ID; - testErrorCode(restClient().delete(url), HttpStatus.NOT_ACCEPTABLE, - "The type has active producers: " + PRODUCER_ID); + testErrorCode(restClient().delete(url), HttpStatus.CONFLICT, "The type has active producers: " + PRODUCER_ID); assertThat(this.infoTypes.size()).isEqualTo(1); }