From 91292c21d8ee51c3840ed455955636b7ceda36fb Mon Sep 17 00:00:00 2001 From: pwielebs Date: Mon, 21 May 2018 12:50:27 +0200 Subject: Removing warnings related to optionals Change-Id: I4116ee1b16d8600a3f7109290b2f69b31fd51133 Issue-ID: DCAEGEN2-451 Signed-off-by: pwielebs --- .../services/prh/service/AAIProducerClientTest.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'prh-aai-client/src/test') 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 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 actualResult = testedObject.getHttpResponse(consumerDmaapModel); -- cgit 1.2.3-korg