aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientServerTest.java
diff options
context:
space:
mode:
authorEylon Malin <eylon.malin@intl.att.com>2019-09-10 16:31:01 +0300
committerEylon Malin <eylon.malin@intl.att.com>2019-09-12 08:51:25 +0300
commit2265215c803291e029add2db7912c7b1e25e0a8e (patch)
tree3082c232fa26483a0f1262efcc5c228d554280d1 /vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientServerTest.java
parent77e77f77c89ca1bef622b12c71897ab1ab256216 (diff)
make Logging a service and inject it to SyncRestClient
Issue-ID: VID-611 Change-Id: I120782884351c55b2e0d1b4ca8bae1e2479d1d0a Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
Diffstat (limited to 'vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientServerTest.java')
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientServerTest.java24
1 files changed, 17 insertions, 7 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientServerTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientServerTest.java
index dd7b26c12..a9fe256c1 100644
--- a/vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientServerTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientServerTest.java
@@ -20,12 +20,17 @@
package org.onap.vid.aai;
+import static org.mockito.Mockito.mock;
+import static org.mockito.MockitoAnnotations.initMocks;
+
import com.fasterxml.jackson.core.JsonProcessingException;
import com.xebialabs.restito.semantics.Action;
import io.joshworks.restclient.http.HttpResponse;
import io.joshworks.restclient.http.mapper.ObjectMapper;
+import java.io.IOException;
import org.assertj.core.api.Assertions;
import org.glassfish.grizzly.http.util.HttpStatus;
+import org.jetbrains.annotations.NotNull;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.mockito.Mock;
@@ -33,15 +38,12 @@ import org.onap.vid.aai.model.ResourceType;
import org.onap.vid.client.SyncRestClient;
import org.onap.vid.model.SubscriberList;
import org.onap.vid.testUtils.StubServerUtil;
+import org.onap.vid.utils.Logging;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-import java.io.IOException;
-
-import static org.mockito.MockitoAnnotations.initMocks;
-
public class AaiOverTLSClientServerTest {
@Mock
@@ -107,8 +109,7 @@ public class AaiOverTLSClientServerTest {
@Test
public void shouldSearchNodeTypeByName() throws IOException, ParseException {
- ObjectMapper objectMapper = getFasterXmlObjectMapper();
- AaiOverTLSClient aaiOverTLSClient = new AaiOverTLSClient(new SyncRestClient(objectMapper), propertySupplier, serverUtil.constructTargetUrl("http", ""));
+ AaiOverTLSClient aaiOverTLSClient = createAaiOverTLSClient();
serverUtil.prepareGetCall("/nodes/generic-vnfs", new JSONParser().parse(searchNodesQueryResponsePayload), Action.status(HttpStatus.OK_200));
@@ -118,10 +119,19 @@ public class AaiOverTLSClientServerTest {
Assertions.assertThat(aaiNodeQueryResponseHttpResponse).isEqualTo(true);
}
+ @NotNull
+ private AaiOverTLSClient createAaiOverTLSClient() {
+ return new AaiOverTLSClient(
+ new SyncRestClient(getFasterXmlObjectMapper(), mock(Logging.class)),
+ propertySupplier,
+ serverUtil.constructTargetUrl("http", "")
+ );
+ }
+
@Test
public void shouldGetSubscribers() throws ParseException, JsonProcessingException {
ObjectMapper objectMapper = getFasterXmlObjectMapper();
- AaiOverTLSClient aaiOverTLSClient = new AaiOverTLSClient(new SyncRestClient(objectMapper), propertySupplier, serverUtil.constructTargetUrl("http", ""));
+ AaiOverTLSClient aaiOverTLSClient = createAaiOverTLSClient();
serverUtil.prepareGetCall("/business/customers", new JSONParser().parse(subscribersResponsePayload), Action.status(HttpStatus.OK_200));