X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=dmaap-adaptor-java%2Fsrc%2Ftest%2Fjava%2Forg%2Foran%2Fdmaapadapter%2FApplicationTest.java;h=66601750805f9188422d96eb7b20555bb692f128;hb=5ce0ce048084ad1504292a4315a0ba7446ee42bc;hp=0ea005642b5bd6b4c092908b07cca9ed4cf42ab7;hpb=86f81813c94a44337c199124e7bbf6280e2c6aa6;p=nonrtric.git diff --git a/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/ApplicationTest.java b/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/ApplicationTest.java index 0ea00564..66601750 100644 --- a/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/ApplicationTest.java +++ b/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/ApplicationTest.java @@ -52,6 +52,7 @@ import org.oran.dmaapadapter.repository.Job; import org.oran.dmaapadapter.repository.Jobs; import org.oran.dmaapadapter.tasks.KafkaJobDataConsumer; import org.oran.dmaapadapter.tasks.KafkaTopicConsumers; +import org.oran.dmaapadapter.tasks.ProducerRegstrationTask; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; @@ -98,6 +99,9 @@ class ApplicationTest { @Autowired KafkaTopicConsumers kafkaTopicConsumers; + @Autowired + ProducerRegstrationTask producerRegistrationTask; + private com.google.gson.Gson gson = new com.google.gson.GsonBuilder().create(); @LocalServerPort @@ -288,6 +292,8 @@ class ApplicationTest { // Register producer, Register types await().untilAsserted(() -> assertThat(icsSimulatorController.testResults.registrationInfo).isNotNull()); assertThat(icsSimulatorController.testResults.registrationInfo.supportedTypeIds).hasSize(this.types.size()); + assertThat(producerRegistrationTask.isRegisteredInIcs()).isTrue(); + producerRegistrationTask.supervisionTask().block(); // Create a job this.icsSimulatorController.addJob(consumerJobInfo(), JOB_ID, restClient()); @@ -327,11 +333,11 @@ class ApplicationTest { () -> assertThat(icsSimulatorController.testResults.registrationInfo.supportedTypeIds).hasSize(2)); } - private void testErrorCode(Mono request, HttpStatus expStatus, String responseContains) { + public static void testErrorCode(Mono request, HttpStatus expStatus, String responseContains) { testErrorCode(request, expStatus, responseContains, true); } - private void testErrorCode(Mono request, HttpStatus expStatus, String responseContains, + public static void testErrorCode(Mono request, HttpStatus expStatus, String responseContains, boolean expectApplicationProblemJsonMediaType) { StepVerifier.create(request) // .expectSubscription() // @@ -340,7 +346,7 @@ class ApplicationTest { .verify(); } - private boolean checkWebClientError(Throwable throwable, HttpStatus expStatus, String responseContains, + private static boolean checkWebClientError(Throwable throwable, HttpStatus expStatus, String responseContains, boolean expectApplicationProblemJsonMediaType) { assertTrue(throwable instanceof WebClientResponseException); WebClientResponseException responseException = (WebClientResponseException) throwable;