diff options
author | pwielebs <piotr.wielebski@nokia.com> | 2019-05-28 10:47:03 +0200 |
---|---|---|
committer | pwielebs <piotr.wielebski@nokia.com> | 2019-05-28 15:52:10 +0200 |
commit | 37dd2cb2d2ad38ad1e6dd83f3ff5b40bc2c0f614 (patch) | |
tree | f0ed1982612bdca8a2b17d67c554d53d5083f5d4 /prh-app-server/src/test | |
parent | 57cbc1a3e9f3c1b8049115461266d15736d2f391 (diff) |
Refactor due to AAI model changes
Change-Id: I1684cb798b40c5d58b531549f2596582f14bc901
Issue-ID: DCAEGEN2-1533
Signed-off-by: pwielebs <piotr.wielebski@nokia.com>
Diffstat (limited to 'prh-app-server/src/test')
4 files changed, 12 insertions, 99 deletions
diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/TestAppConfiguration.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/TestAppConfiguration.java index fb0b1b43..b398c501 100644 --- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/TestAppConfiguration.java +++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/TestAppConfiguration.java @@ -56,14 +56,9 @@ public class TestAppConfiguration { public static ImmutableAaiClientConfiguration createDefaultAaiClientConfiguration() { return new ImmutableAaiClientConfiguration.Builder() .pnfUrl("https://aai.onap.svc.cluster.local:8443/aai/v12/network/pnfs/pnf") - .aaiHost("aai.onap.svc.cluster.local") - .aaiPort(8443) - .aaiProtocol("https") .aaiUserName("AAI") .aaiUserPassword("AAI") .aaiIgnoreSslCertificateErrors(true) - .aaiBasePath("/aai/v12") - .aaiPnfPath("/network/pnfs/pnf") .aaiServiceInstancePath("/business/customers/customer/${customer}/service-subscriptions/service-subscription/${serviceType}/service-instances/service-instance/${serviceInstanceId}") .trustStorePath("/opt/app/prh/local/org.onap.prh.trust.jks") .trustStorePasswordPath("change_it") diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskTest.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskTest.java index 5edf15a8..c8b3a92b 100644 --- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskTest.java +++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskTest.java @@ -20,23 +20,11 @@ package org.onap.dcaegen2.services.prh.tasks; -import static java.nio.charset.StandardCharsets.UTF_8; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.BDDMockito.given; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyNoMoreInteractions; -import static org.mockito.Mockito.verifyZeroInteractions; - import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import io.netty.buffer.ByteBuf; import io.netty.handler.codec.http.HttpResponseStatus; -import java.io.InputStreamReader; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.onap.dcaegen2.services.prh.TestAppConfiguration; @@ -52,13 +40,21 @@ import org.onap.dcaegen2.services.sdk.rest.services.adapters.http.RxHttpClient; import org.reactivestreams.Publisher; import reactor.core.publisher.Mono; +import java.io.InputStreamReader; + +import static java.nio.charset.StandardCharsets.UTF_8; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.*; + class BbsActionsTaskTest { - private static final String CORRECT_LOGICAL_LINK_JSON = "bbs_action/correct_logical_link.json"; - public static final String AAI_URL = "https://aai.onap.svc.cluster.local:8443/aai/v12/network/logical-links/logical-link/some-link"; + private static final String AAI_URL = "https://aai.onap.svc.cluster.local:8443/aai/v12/network/logical-links/logical-link/some-link"; private CbsConfiguration cbsConfiguration = mock(CbsConfiguration.class); - private AaiClientConfiguration aaiClientConfiguration = TestAppConfiguration.createDefaultAaiClientConfiguration(); private RxHttpClient httpClient = mock(RxHttpClient.class); diff --git a/prh-app-server/src/test/resources/correct_config.json b/prh-app-server/src/test/resources/correct_config.json deleted file mode 100644 index 7ec2f74c..00000000 --- a/prh-app-server/src/test/resources/correct_config.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "config":{ - "dmaap.dmaapConsumerConfiguration.dmaapUrl":"http://dmaap-mr:2222/events/unauthenticated.VES_PNFREG_OUTPUT", - "dmaap.dmaapConsumerConfiguration.dmaapHostName":"dmaap-mr", - "dmaap.dmaapConsumerConfiguration.dmaapPortNumber":2223, - "dmaap.dmaapConsumerConfiguration.dmaapTopicName":"events/unauthenticated.VES_PNFREG_OUTPUT", - "dmaap.dmaapConsumerConfiguration.dmaapProtocol":"http", - "dmaap.dmaapConsumerConfiguration.dmaapUserName":"admin", - "dmaap.dmaapConsumerConfiguration.dmaapUserPassword":"admin", - "dmaap.dmaapConsumerConfiguration.dmaapContentType":"application/json", - "dmaap.dmaapConsumerConfiguration.consumerId":"c12", - "dmaap.dmaapConsumerConfiguration.consumerGroup":"OpenDCAE-c12", - "dmaap.dmaapConsumerConfiguration.timeoutMs":-1, - "dmaap.dmaapConsumerConfiguration.messageLimit":-1, - "dmaap.dmaapProducerConfiguration.dmaapUrl":"http://dmaap-mr:2222/events/unauthenticated.PNF_READY", - "dmaap.dmaapProducerConfiguration.dmaapHostName":"dmaap-mr", - "dmaap.dmaapProducerConfiguration.dmaapPortNumber":2223, - "dmaap.dmaapProducerConfiguration.dmaapTopicName":"events/unauthenticated.PNF_READY", - "dmaap.dmaapProducerConfiguration.dmaapProtocol":"http", - "dmaap.dmaapProducerConfiguration.dmaapUserName":"admin", - "dmaap.dmaapProducerConfiguration.dmaapUserPassword":"admin", - "dmaap.dmaapProducerConfiguration.dmaapContentType":"application/json", - "dmaap.dmaapUpdateProducerConfiguration.dmaapUrl":"http://dmaap-mr:2222/events/unauthenticated.PNF_UPDATE", - "dmaap.dmaapUpdateProducerConfiguration.dmaapHostName":"dmaap-mr", - "dmaap.dmaapUpdateProducerConfiguration.dmaapPortNumber":2223, - "dmaap.dmaapUpdateProducerConfiguration.dmaapTopicName":"events/unauthenticated.PNF_UPDATE", - "dmaap.dmaapUpdateProducerConfiguration.dmaapProtocol":"http", - "dmaap.dmaapUpdateProducerConfiguration.dmaapUserName":"admin", - "dmaap.dmaapUpdateProducerConfiguration.dmaapUserPassword":"admin", - "dmaap.dmaapUpdateProducerConfiguration.dmaapContentType":"application/json", - "aai.aaiClientConfiguration.pnfUrl":"https://aai:3333/aai/v12/network/pnfs/pnf", - "aai.aaiClientConfiguration.aaiHost":"aai", - "aai.aaiClientConfiguration.aaiHostPortNumber":3334, - "aai.aaiClientConfiguration.aaiProtocol":"https", - "aai.aaiClientConfiguration.aaiUserName":"DCAE", - "aai.aaiClientConfiguration.aaiUserPassword":"DCAE", - "aai.aaiClientConfiguration.aaiIgnoreSslCertificateErrors":true, - "aai.aaiClientConfiguration.aaiBasePath":"/aai/v12", - "aai.aaiClientConfiguration.aaiPnfPath":"/network/pnfs/pnf", - "aai.aaiClientConfiguration.aaiServiceInstancePath":"/business/customers/customer//service-subscriptions/service-subscription//service-instances/service-instance/", - "aai.aaiClientConfiguration.aaiHeaders":{ - "X-FromAppId":"prh", - "X-TransactionId":"9999", - "Accept":"application/json", - "Real-Time":"true", - "Authorization":"Basic QUFJOkFBSQ==" - }, - "security.trustStorePath":"change it", - "security.trustStorePasswordPath":"change it", - "security.keyStorePath":"change it", - "security.keyStorePasswordPath":"change it", - "security.enableAaiCertAuth":false, - "security.enableDmaapCertAuth":false, - "streams_publishes":{ - "pnf-update":{ - "type": "message_router", - "dmaap_info":{ - "topic_url":"http://dmaap-mr:2222/events/unauthenticated.PNF_UPDATE" - } - }, - "pnf-ready":{ - "type": "message_router", - "dmaap_info":{ - "topic_url":"http://dmaap-mr:2222/events/unauthenticated.PNF_READY" - } - } - }, - "streams_subscribes":{ - "ves-reg-output":{ - "type": "message_router", - "dmaap_info":{ - "topic_url":"http://dmaap-mr:2222/events/unauthenticated.VES_PNFREG_OUTPUT" - } - } - } - } -}
\ No newline at end of file diff --git a/prh-app-server/src/test/resources/flattened_configuration.json b/prh-app-server/src/test/resources/flattened_configuration.json index 9997f583..4b846b70 100644 --- a/prh-app-server/src/test/resources/flattened_configuration.json +++ b/prh-app-server/src/test/resources/flattened_configuration.json @@ -29,8 +29,7 @@ "dmaap.dmaapUpdateProducerConfiguration.dmaapUserName":"admin", "dmaap.dmaapUpdateProducerConfiguration.dmaapUserPassword":"admin", "dmaap.dmaapUpdateProducerConfiguration.dmaapContentType":"application/json", - - "aai.aaiClientConfiguration.pnfUrl":"https://aai.onap.svc.cluster.local:8443/aai/v12/network/pnfs/pnf", + "aai.aaiClientConfiguration.pnfUrl": "https://aai.onap.svc.cluster.local:8443/aai/v12/network/pnfs/pnf", "aai.aaiClientConfiguration.aaiHost":"aai.onap.svc.cluster.local", "aai.aaiClientConfiguration.aaiHostPortNumber":8443, "aai.aaiClientConfiguration.aaiProtocol":"https", |