summaryrefslogtreecommitdiffstats
path: root/prh-aai-client/src/test/java/org/onap/dcaegen2/services/prh/service/AAIProducerClientTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'prh-aai-client/src/test/java/org/onap/dcaegen2/services/prh/service/AAIProducerClientTest.java')
-rw-r--r--prh-aai-client/src/test/java/org/onap/dcaegen2/services/prh/service/AAIProducerClientTest.java14
1 files changed, 4 insertions, 10 deletions
diff --git a/prh-aai-client/src/test/java/org/onap/dcaegen2/services/prh/service/AAIProducerClientTest.java b/prh-aai-client/src/test/java/org/onap/dcaegen2/services/prh/service/AAIProducerClientTest.java
index dbe857e6..ec926294 100644
--- a/prh-aai-client/src/test/java/org/onap/dcaegen2/services/prh/service/AAIProducerClientTest.java
+++ b/prh-aai-client/src/test/java/org/onap/dcaegen2/services/prh/service/AAIProducerClientTest.java
@@ -24,15 +24,14 @@ import org.apache.http.client.ResponseHandler;
import org.apache.http.client.methods.HttpPatch;
import org.apache.http.impl.client.CloseableHttpClient;
import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.onap.dcaegen2.services.prh.config.AAIClientConfiguration;
import org.onap.dcaegen2.services.prh.model.ConsumerDmaapModel;
import org.onap.dcaegen2.services.prh.model.ConsumerDmaapModelForUnitTest;
-
import java.io.IOException;
import java.lang.reflect.Field;
+import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
@@ -50,8 +49,9 @@ public class AAIProducerClientTest {
private static ConsumerDmaapModel consumerDmaapModel = new ConsumerDmaapModelForUnitTest();
- @BeforeAll
- public static void init() throws NoSuchFieldException, IllegalAccessException {
+ @Test
+ public void getHttpResponse_shouldReturnSuccessStatusCode()
+ throws IOException, URISyntaxException, NoSuchFieldException, IllegalAccessException {
//given
Map<String, String> aaiHeaders = new HashMap<>();
@@ -61,7 +61,6 @@ public class AAIProducerClientTest {
aaiHeaders.put("Real-Time", "true");
aaiHeaders.put("Content-Type", "application/merge-patch+json");
- //when
when(aaiHttpClientConfigurationMock.aaiHost()).thenReturn("eucalyptus.es-si-eu-dhn-20.eecloud.nsn-net.net");
when(aaiHttpClientConfigurationMock.aaiProtocol()).thenReturn("https");
when(aaiHttpClientConfigurationMock.aaiHostPortNumber()).thenReturn(1234);
@@ -73,11 +72,6 @@ public class AAIProducerClientTest {
testedObject = new AAIProducerClient(aaiHttpClientConfigurationMock);
setField();
- }
-
- @Test
- public void getHttpResponsePatch_shouldReturnSuccessStatusCode() throws IOException {
- //when
when(closeableHttpClientMock.execute(any(HttpPatch.class), any(ResponseHandler.class)))
.thenReturn(Optional.of(SUCCESS));
Optional<Integer> actualResult = testedObject.getHttpResponse(consumerDmaapModel);