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;
@Autowired
KafkaTopicConsumers kafkaTopicConsumers;
+ @Autowired
+ ProducerRegstrationTask producerRegistrationTask;
+
private com.google.gson.Gson gson = new com.google.gson.GsonBuilder().create();
@LocalServerPort
// 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());
() -> 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() //
.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;