X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=dmaap-adaptor-java%2Fsrc%2Ftest%2Fjava%2Forg%2Foran%2Fdmaapadapter%2FIntegrationWithIcs.java;h=9f0ef19fe5ad925a44312d6959dac3cd7689762b;hb=844931b62f35ce6ee2d9dc7274573fc54e14407a;hp=d1d7e91070bc4252e22b45f91ef488a6f2582326;hpb=534a1fe8136ed8d72615707008bdd6061d1df2fe;p=nonrtric.git diff --git a/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/IntegrationWithIcs.java b/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/IntegrationWithIcs.java index d1d7e910..9f0ef19f 100644 --- a/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/IntegrationWithIcs.java +++ b/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/IntegrationWithIcs.java @@ -49,9 +49,11 @@ import org.springframework.boot.test.context.TestConfiguration; import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; import org.springframework.boot.web.servlet.server.ServletWebServerFactory; import org.springframework.context.annotation.Bean; +import org.springframework.http.HttpStatus; import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit.jupiter.SpringExtension; + @SuppressWarnings("java:S3577") // Rename class @ExtendWith(SpringExtension.class) @SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT) @@ -232,7 +234,23 @@ class IntegrationWithIcs { } @Test - void testWholeChain() throws Exception { + void testKafkaJobParameterOutOfRange() { + await().untilAsserted(() -> assertThat(producerRegstrationTask.isRegisteredInIcs()).isTrue()); + final String TYPE_ID = "KafkaInformationType"; + + Job.Parameters param = new Job.Parameters("filter", new Job.BufferTimeout(123, 170 * 1000), 1); + + ConsumerJobInfo jobInfo = + new ConsumerJobInfo(TYPE_ID, jsonObject(gson.toJson(param)), "owner", consumerUri(), ""); + String body = gson.toJson(jobInfo); + + ApplicationTest.testErrorCode(restClient().put(jobUrl("KAFKA_JOB_ID"), body), HttpStatus.BAD_REQUEST, + "Json validation failure"); + + } + + @Test + void testDmaapMessage() throws Exception { await().untilAsserted(() -> assertThat(producerRegstrationTask.isRegisteredInIcs()).isTrue()); createInformationJobInIcs(DMAAP_TYPE_ID, DMAAP_JOB_ID, ".*DmaapResponse.*"); @@ -250,7 +268,6 @@ class IntegrationWithIcs { deleteInformationJobInIcs(DMAAP_JOB_ID); await().untilAsserted(() -> assertThat(this.jobs.size()).isZero()); - } }