X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pmproducer%2Fsrc%2Ftest%2Fjava%2Forg%2Foran%2Fpmproducer%2FApplicationTest.java;h=76ccb487fcb91dceacf8945b708fe3f212dcfd73;hb=608883c0d1a053280151772144798311f3699909;hp=49b8ea2c13129fa12ab1a8c6e2f10574cf787579;hpb=547c200ebd35ebc81a92694fa48653d3ba6dcb27;p=nonrtric%2Fplt%2Franpm.git diff --git a/pmproducer/src/test/java/org/oran/pmproducer/ApplicationTest.java b/pmproducer/src/test/java/org/oran/pmproducer/ApplicationTest.java index 49b8ea2..76ccb48 100644 --- a/pmproducer/src/test/java/org/oran/pmproducer/ApplicationTest.java +++ b/pmproducer/src/test/java/org/oran/pmproducer/ApplicationTest.java @@ -53,7 +53,6 @@ import org.junit.jupiter.api.TestMethodOrder; import org.mockito.ArgumentCaptor; import org.oran.pmproducer.clients.AsyncRestClient; import org.oran.pmproducer.clients.AsyncRestClientFactory; -import org.oran.pmproducer.clients.SecurityContext; import org.oran.pmproducer.configuration.ApplicationConfig; import org.oran.pmproducer.configuration.WebClientConfig; import org.oran.pmproducer.configuration.WebClientConfig.HttpProxyConfig; @@ -64,6 +63,7 @@ import org.oran.pmproducer.filter.FilteredData; import org.oran.pmproducer.filter.PmReport; import org.oran.pmproducer.filter.PmReportFilter; import org.oran.pmproducer.filter.PmReportFilter.FilterData; +import org.oran.pmproducer.oauth2.SecurityContext; import org.oran.pmproducer.r1.ConsumerJobInfo; import org.oran.pmproducer.r1.ProducerJobInfo; import org.oran.pmproducer.repository.InfoType; @@ -106,7 +106,7 @@ import reactor.test.StepVerifier; "app.webclient.trust-store=./config/truststore.jks", // "app.webclient.trust-store-used=true", // "app.configuration-filepath=./src/test/resources/test_application_configuration.json", // - "app.pm-files-path=/tmp/dmaapadaptor", // + "app.pm-files-path=/tmp/pmproducer", // "app.s3.endpointOverride=" // }) class ApplicationTest { @@ -146,11 +146,6 @@ class ApplicationTest { return thisProcessUrl(); } - @Override - public String getDmaapBaseUrl() { - return thisProcessUrl(); - } - @Override public String getSelfUrl() { return thisProcessUrl(); @@ -240,11 +235,6 @@ class ApplicationTest { return "https://localhost:" + this.applicationConfig.getLocalServerHttpPort(); } - private String quote(String str) { - final String q = "\""; - return q + str.replace(q, "\\\"") + q; - } - private Object toJson(String json) { try { return JsonParser.parseString(json).getAsJsonObject(); @@ -262,9 +252,10 @@ class ApplicationTest { } private void waitForRegistration() { + producerRegistrationTask.registerTypesAndProducer().block(); // Register producer, Register types await().untilAsserted(() -> assertThat(icsSimulatorController.testResults.registrationInfo).isNotNull()); - producerRegistrationTask.supervisionTask().block(); + producerRegistrationTask.registerTypesAndProducer().block(); assertThat(icsSimulatorController.testResults.registrationInfo.supportedTypeIds).hasSize(this.types.size()); assertThat(producerRegistrationTask.isRegisteredInIcs()).isTrue(); @@ -434,23 +425,6 @@ class ApplicationTest { await().untilAsserted(() -> assertThat(this.jobs.size()).isEqualTo(1)); } - @Test - void testReRegister() throws Exception { - // Wait foir register types and producer - waitForRegistration(); - - // Clear the registration, should trigger a re-register - icsSimulatorController.testResults.reset(); - producerRegistrationTask.supervisionTask().block(); - await().untilAsserted(() -> assertThat(icsSimulatorController.testResults.registrationInfo).isNotNull()); - assertThat(icsSimulatorController.testResults.registrationInfo.supportedTypeIds).hasSize(this.types.size()); - - // Just clear the registerred types, should trigger a re-register - icsSimulatorController.testResults.types.clear(); - await().untilAsserted(() -> assertThat(icsSimulatorController.testResults.registrationInfo.supportedTypeIds) - .hasSize(this.types.size())); - } - @Test @SuppressWarnings("squid:S2925") // "Thread.sleep" should not be used in tests. void testZZActuator() throws Exception {