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=8c8ce5f142a447f7106faec5642d61d0a6f32c25;hb=5e1623ab25b62c6c28849bfd862eba4648465922;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..8c8ce5f1 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); } @@ -1024,7 +1028,7 @@ class ApplicationTest { // Test that subscriptions are removed for a unresponsive consumer // PUT a subscription with a junk callback - final ConsumerTypeSubscriptionInfo info = new ConsumerTypeSubscriptionInfo(baseUrl() + "JUNK", "owner"); + final ConsumerTypeSubscriptionInfo info = new ConsumerTypeSubscriptionInfo(baseUrl() + "/JUNK", "owner"); String body = gson.toJson(info); restClient().putForEntity(typeSubscriptionUrl() + "/subscriptionId", body).block(); assertThat(this.infoTypeSubscriptions.size()).isEqualTo(1);