summaryrefslogtreecommitdiffstats
path: root/prh-aai-client/src/test/java/org
diff options
context:
space:
mode:
authorpwielebs <piotr.wielebski@nokia.com>2018-05-21 12:50:27 +0200
committerpwielebs <piotr.wielebski@nokia.com>2018-05-22 15:39:53 +0200
commit91292c21d8ee51c3840ed455955636b7ceda36fb (patch)
tree9686880ba4e1d48a7dfd471e5dd99405b65990c6 /prh-aai-client/src/test/java/org
parent35ee40c8133d4984ce2eeb580d8e757edc304e66 (diff)
Removing warnings related to optionals
Change-Id: I4116ee1b16d8600a3f7109290b2f69b31fd51133 Issue-ID: DCAEGEN2-451 Signed-off-by: pwielebs <piotr.wielebski@nokia.com>
Diffstat (limited to 'prh-aai-client/src/test/java/org')
-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);