summaryrefslogtreecommitdiffstats
path: root/aai-resources/src/test
diff options
context:
space:
mode:
authorKajur, Harish (vk250x) <vk250x@att.com>2019-01-13 12:18:00 -0500
committerKajur, Harish (vk250x) <vk250x@att.com>2019-01-13 12:18:07 -0500
commit3289e79a0f0343cbd380a385d61e21f59ceff85c (patch)
treea74957c74fb41275aede412e5c43307fd3e0c859 /aai-resources/src/test
parent92ac3a80c822340c07b9d09189b85c34ac797122 (diff)
Sync up the changes for v15
Issue-ID: AAI-1811 Change-Id: I5c397d5907bb0711977f62ba84abe454f410a3b7 Signed-off-by: Kajur, Harish (vk250x) <vk250x@att.com>
Diffstat (limited to 'aai-resources/src/test')
-rw-r--r--aai-resources/src/test/java/org/onap/aai/IncreaseNodesToolTest.java5
-rw-r--r--aai-resources/src/test/java/org/onap/aai/rest/DepthTest.java64
-rw-r--r--aai-resources/src/test/java/org/onap/aai/rest/LegacyMoxyConsumerTest.java199
-rw-r--r--aai-resources/src/test/java/org/onap/aai/rest/retired/RetiredConsumerSpringTest.java7
-rw-r--r--aai-resources/src/test/resources/application-test.properties8
-rw-r--r--aai-resources/src/test/resources/etc/appprops/aaiconfig.properties8
-rw-r--r--aai-resources/src/test/resources/payloads/relationship/complex2.json16
-rw-r--r--aai-resources/src/test/resources/payloads/relationship/complex3.json16
-rw-r--r--aai-resources/src/test/resources/payloads/relationship/complex4.json16
-rw-r--r--aai-resources/src/test/resources/payloads/relationship/pserver-complex-relationship-list2.json1
-rw-r--r--aai-resources/src/test/resources/payloads/relationship/pserver-complex-relationship-list3.json1
-rw-r--r--aai-resources/src/test/resources/payloads/relationship/pserver-complex-relationship2.json8
-rw-r--r--aai-resources/src/test/resources/payloads/relationship/pserver-complex-relationship3.json8
-rw-r--r--aai-resources/src/test/resources/payloads/relationship/pserver2.json4
-rw-r--r--aai-resources/src/test/resources/payloads/relationship/pserver3.json4
-rw-r--r--aai-resources/src/test/resources/payloads/relationship/pserver4.json4
16 files changed, 292 insertions, 77 deletions
diff --git a/aai-resources/src/test/java/org/onap/aai/IncreaseNodesToolTest.java b/aai-resources/src/test/java/org/onap/aai/IncreaseNodesToolTest.java
index 5d91fb3..53b162f 100644
--- a/aai-resources/src/test/java/org/onap/aai/IncreaseNodesToolTest.java
+++ b/aai-resources/src/test/java/org/onap/aai/IncreaseNodesToolTest.java
@@ -48,11 +48,8 @@ public class IncreaseNodesToolTest extends AAISetup {
@Mock
GraphTraversal<org.apache.tinkerpop.gremlin.structure.Vertex, org.apache.tinkerpop.gremlin.structure.Vertex> graphTraversalVertex;
-
private IncreaseNodesTool increaseNodesTool;
-
-
- String [] args = {"-numberOfNodes", "5" ,"-nodeType", "pserver", "-uri", "/cloud-infrastructure/pservers/pserver/"};
+ String [] args = {"-numberOfNodes", "5" ,"-nodeType", "pserver", "-uri", "/cloud-infrastructure/pservers/pserver/", "-child", "false"};
@Before
public void setup(){
diff --git a/aai-resources/src/test/java/org/onap/aai/rest/DepthTest.java b/aai-resources/src/test/java/org/onap/aai/rest/DepthTest.java
deleted file mode 100644
index c664c22..0000000
--- a/aai-resources/src/test/java/org/onap/aai/rest/DepthTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * ============LICENSE_START=======================================================
- * org.onap.aai
- * ================================================================================
- * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-package org.onap.aai.rest;
-
-import org.hamcrest.MatcherAssert;
-import org.junit.Test;
-import org.onap.aai.PayloadUtil;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-
-import java.io.IOException;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.not;
-
-public class DepthTest extends AbstractSpringRestTest {
-
- @Test
- public void testOldVersionReturnAllChildrenAndNewVersionReturnDepthZero() throws IOException {
-
- String id = "customer-987654321-91";
- String endpoint = "/aai/v9/business/customers/customer/"+ id;
-
- String body = PayloadUtil.getResourcePayload("customer.json");
-
- httpEntity = new HttpEntity(body, headers);
-
- ResponseEntity responseEntity;
- responseEntity = restTemplate.exchange(baseUrl + endpoint, HttpMethod.PUT, httpEntity, String.class);
- assertThat(responseEntity.getStatusCode(), is(HttpStatus.CREATED));
-
- responseEntity = restTemplate.exchange(baseUrl + endpoint, HttpMethod.GET, httpEntity, String.class);
- assertThat(responseEntity.getStatusCode(), is(HttpStatus.OK));
- String responseBody = responseEntity.getBody().toString();
- assertThat(responseBody, not(containsString("service-instance-id")));
- endpoint = "/aai/v8/business/customers/customer/"+ id;
-
- responseEntity = restTemplate.exchange(baseUrl + endpoint, HttpMethod.GET, httpEntity, String.class);
- assertThat(responseEntity.getStatusCode(), is(HttpStatus.OK));
- responseBody = responseEntity.getBody().toString();
- assertThat(responseBody, containsString("service-instance-id"));
- }
-}
diff --git a/aai-resources/src/test/java/org/onap/aai/rest/LegacyMoxyConsumerTest.java b/aai-resources/src/test/java/org/onap/aai/rest/LegacyMoxyConsumerTest.java
index 3845fb0..028f596 100644
--- a/aai-resources/src/test/java/org/onap/aai/rest/LegacyMoxyConsumerTest.java
+++ b/aai-resources/src/test/java/org/onap/aai/rest/LegacyMoxyConsumerTest.java
@@ -21,6 +21,9 @@ package org.onap.aai.rest;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
+import org.json.JSONArray;
+import org.json.simple.parser.JSONParser;
+import org.json.simple.parser.ParseException;
import org.json.JSONException;
import org.json.JSONObject;
import org.junit.Before;
@@ -121,6 +124,8 @@ public class LegacyMoxyConsumerTest extends AAISetup {
Mockito.doReturn(null).when(queryParameters).remove(anyObject());
when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON);
+
+
}
@Test
@@ -731,6 +736,7 @@ public class LegacyMoxyConsumerTest extends AAISetup {
int timeout = legacyMoxyConsumer.getTimeoutLimit("JUNITTESTAPP2", AAIConfig.get(AAIConstants.AAI_CRUD_TIMEOUT_APP), AAIConfig.get(AAIConstants.AAI_CRUD_TIMEOUT_LIMIT));
assertEquals(-1, timeout);
}
+ @Ignore("Time sensitive test only times out if the response takes longer than 1 second")
@Test
public void testTimeoutGetCall() throws Exception{
String uri = getUri();
@@ -789,4 +795,197 @@ public class LegacyMoxyConsumerTest extends AAISetup {
assertEquals(Response.Status.NOT_FOUND.getStatusCode(), response.getStatus());
}
+
+ @Test
+ public void testGetRelationshipWithoutFormat() throws IOException, JSONException {
+ String payload = getRelationshipPayload("pserver-complex-relationship-list2");
+ String pserverData = getRelationshipPayload("pserver2");
+ String complexData = getRelationshipPayload("complex2");
+
+ String hostname = "590a8943-1200-43b3-825b-75dde6b8f44b";
+ String physicalLocationId ="e13d4587-19ad-4bf5-80f5-c021efb5b61d";
+
+ String pserverUri = String.format("cloud-infrastructure/pservers/pserver/%s", hostname);
+ String cloudRegionUri = String.format("cloud-infrastructure/complexes/complex/%s", physicalLocationId);
+
+ doSetupResource(pserverUri, pserverData);
+ doSetupResource(cloudRegionUri, complexData);
+
+ String cloudToPserverRelationshipData = getRelationshipPayload("pserver-complex-relationship2");
+ String cloudToPserverRelationshipUri = String.format(
+ "cloud-infrastructure/pservers/pserver/%s/relationship-list/relationship", hostname);
+ MockHttpServletRequest mockReq = new MockHttpServletRequest("PUT", cloudToPserverRelationshipUri);
+ Response response = legacyMoxyConsumer.updateRelationship(
+ cloudToPserverRelationshipData,
+ schemaVersions.getDefaultVersion().toString(),
+ cloudToPserverRelationshipUri,
+ httpHeaders,
+ uriInfo,
+ mockReq
+ );
+
+ assertNotNull("Response from the legacy moxy consumer returned null", response);
+ int code = response.getStatus();
+ if(!VALID_HTTP_STATUS_CODES.contains(code)){
+ System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity());
+ }
+
+ assertEquals("Expected to return status created from the response",
+ Response.Status.OK.getStatusCode(), response.getStatus());
+ logger.info("Response Code: " + code + "\tEntity: " + response.getEntity());
+
+ String getRelationshipMockRequestUri = String.format(
+ "cloud-infrastructure/pservers/pserver/%s/relationship-list", hostname);
+ String getRelationshipUri = String.format(
+ "cloud-infrastructure/pservers/pserver/%s", hostname);
+ response = legacyMoxyConsumer.getRelationshipList(
+ "1",
+ "1",
+ schemaVersions.getDefaultVersion().toString(),
+ getRelationshipUri,
+ "false",
+ httpHeaders,
+ uriInfo
+ );
+
+ String s = response.getEntity().toString();
+
+ code = response.getStatus();
+ if(!VALID_HTTP_STATUS_CODES.contains(code)){
+ System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity());
+ }
+
+ assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
+ JSONAssert.assertEquals(payload, response.getEntity().toString(), false);
+ }
+
+ @Test
+ public void testGetRelationshipWithFormat() throws IOException, JSONException, ParseException {
+ String payload = getRelationshipPayload("pserver-complex-relationship-list3");
+ String pserverData = getRelationshipPayload("pserver3");
+ String complexData = getRelationshipPayload("complex3");
+
+ String hostname = "590a8943-1200-43b3-825b-75dde6b8f44c";
+ String physicalLocationId ="e13d4587-19ad-4bf5-80f5-c021efb5b61e";
+
+ String pserverUri = String.format("cloud-infrastructure/pservers/pserver/%s", hostname);
+ String cloudRegionUri = String.format("cloud-infrastructure/complexes/complex/%s", physicalLocationId);
+
+ doSetupResource(pserverUri, pserverData);
+ doSetupResource(cloudRegionUri, complexData);
+
+ String cloudToPserverRelationshipData = getRelationshipPayload("pserver-complex-relationship3");
+ String cloudToPserverRelationshipUri = String.format(
+ "cloud-infrastructure/pservers/pserver/%s/relationship-list/relationship", hostname);
+ MockHttpServletRequest mockReq = new MockHttpServletRequest("PUT", cloudToPserverRelationshipUri);
+ Response response = legacyMoxyConsumer.updateRelationship(
+ cloudToPserverRelationshipData,
+ schemaVersions.getDefaultVersion().toString(),
+ cloudToPserverRelationshipUri,
+ httpHeaders,
+ uriInfo,
+ mockReq
+ );
+
+ assertNotNull("Response from the legacy moxy consumer returned null", response);
+ int code = response.getStatus();
+ if(!VALID_HTTP_STATUS_CODES.contains(code)){
+ System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity());
+ }
+
+ assertEquals("Expected to return status created from the response",
+ Response.Status.OK.getStatusCode(), response.getStatus());
+ logger.info("Response Code: " + code + "\tEntity: " + response.getEntity());
+
+ String getRelationshipMockRequestUri = String.format(
+ "cloud-infrastructure/pservers/pserver/%s/relationship-list", hostname);
+ String getRelationshipUri = String.format(
+ "cloud-infrastructure/pservers/pserver/%s", hostname);
+ queryParameters.add("format", "resource");
+ response = legacyMoxyConsumer.getRelationshipList(
+ "1",
+ "1",
+ schemaVersions.getDefaultVersion().toString(),
+ getRelationshipUri,
+ "false",
+ httpHeaders,
+ uriInfo
+ );
+ queryParameters.remove("format");
+
+ code = response.getStatus();
+ if(!VALID_HTTP_STATUS_CODES.contains(code)){
+ System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity());
+ }
+
+ assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
+
+ String responsePayload = response.getEntity().toString();
+ JSONObject payloadJsonObject = new JSONObject(payload);
+ JSONObject responseJsonObject = new JSONObject(responsePayload);
+
+ JSONArray payloadResultsArray = payloadJsonObject.getJSONArray("results");
+ JSONArray responseResultsArray = responseJsonObject.getJSONArray("results");
+ assertEquals(payloadResultsArray.length(), responseResultsArray.length());
+
+ for (int i = 0; i < payloadResultsArray.length(); i++) {
+ String payloadResults = payloadResultsArray.get(i).toString();
+ String responseResults = responseResultsArray.get(i).toString();
+
+ JSONObject pserverPayloadObject = new JSONObject(payloadResults);
+ JSONObject pserverResponseObject = new JSONObject(responseResults);
+ String pserverPayload = pserverPayloadObject.get("pserver").toString();
+ String pserverResponse = pserverResponseObject.get("pserver").toString();
+
+ JSONObject pserverPayloadFields = new JSONObject(pserverPayload);
+ JSONObject pserverResponseFields = new JSONObject(pserverResponse);
+ String pserverPayloadHostname = pserverPayloadFields.get("hostname").toString();
+ String pserverResponseHostname = pserverResponseFields.get("hostname").toString();
+ String pserverPayloadInmaint = pserverPayloadFields.get("in-maint").toString();
+ String pserverResponseInmaint = pserverResponseFields.get("in-maint").toString();
+ String pserverPayloadRelationshipList = pserverPayloadFields.get("relationship-list").toString();
+ String pserverResponseRelationshipList = pserverResponseFields.get("relationship-list").toString();
+
+ assertEquals(pserverPayloadHostname, pserverResponseHostname);
+ assertEquals(pserverPayloadInmaint, pserverResponseInmaint);
+ assertEquals(pserverPayloadRelationshipList, pserverResponseRelationshipList);
+ }
+ }
+
+ @Test
+ public void testGetRelationshipWithoutSuppliedRelationship() throws IOException, JSONException {
+ String pserverData = getRelationshipPayload("pserver4");
+ String complexData = getRelationshipPayload("complex4");
+
+ String hostname = "590a8943-1200-43b3-825b-75dde6b8f44d";
+ String physicalLocationId ="e13d4587-19ad-4bf5-80f5-c021efb5b61f";
+
+ String pserverUri = String.format("cloud-infrastructure/pservers/pserver/%s", hostname);
+ String cloudRegionUri = String.format("cloud-infrastructure/complexes/complex/%s", physicalLocationId);
+
+ doSetupResource(pserverUri, pserverData);
+ doSetupResource(cloudRegionUri, complexData);
+
+ String getRelationshipMockRequestUri = String.format(
+ "cloud-infrastructure/pservers/pserver/%s/relationship-list", hostname);
+ String getRelationshipUri = String.format(
+ "cloud-infrastructure/pservers/pserver/%s", hostname);
+ MockHttpServletRequest mockReq = new MockHttpServletRequest("GET_RELATIONSHIP", getRelationshipMockRequestUri);
+ Response response = legacyMoxyConsumer.getRelationshipList(
+ "1",
+ "1",
+ schemaVersions.getDefaultVersion().toString(),
+ getRelationshipUri,
+ "false",
+ httpHeaders,
+ uriInfo
+ );
+
+ int code = response.getStatus();
+ if(!VALID_HTTP_STATUS_CODES.contains(code)){
+ System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity());
+ }
+
+ assertEquals(Response.Status.NOT_FOUND.getStatusCode(), response.getStatus());
+ }
}
diff --git a/aai-resources/src/test/java/org/onap/aai/rest/retired/RetiredConsumerSpringTest.java b/aai-resources/src/test/java/org/onap/aai/rest/retired/RetiredConsumerSpringTest.java
index 1fae4a7..c629ca7 100644
--- a/aai-resources/src/test/java/org/onap/aai/rest/retired/RetiredConsumerSpringTest.java
+++ b/aai-resources/src/test/java/org/onap/aai/rest/retired/RetiredConsumerSpringTest.java
@@ -108,7 +108,7 @@ public class RetiredConsumerSpringTest extends AbstractSpringRestTest {
private void setupNamedQueriesRetired() {
httpStatusMap = new HashMap<>();
- httpStatusMap.put("/aai/v8/cloud-infrastructure/pservers/pserver/samomaisdjfajsfoas", HttpStatus.NOT_FOUND);
+ httpStatusMap.put("/aai/v13/cloud-infrastructure/pservers/pserver/samomaisdjfajsfoas", HttpStatus.NOT_FOUND);
httpStatusMap.put("/aai/v8/service-design-and-creation/named-queries/named-query/samomaisdjfajsfoas", HttpStatus.GONE);
}
@@ -130,13 +130,16 @@ public class RetiredConsumerSpringTest extends AbstractSpringRestTest {
httpStatusMap.put("/aai/v4/cloud-infrastructure/pservers/pserver/test-pserver1", HttpStatus.GONE);
httpStatusMap.put("/aai/v5/cloud-infrastructure/pservers/pserver/test-pserver1", HttpStatus.GONE);
httpStatusMap.put("/aai/v6/cloud-infrastructure/pservers/pserver/test-pserver1", HttpStatus.GONE);
+ httpStatusMap.put("/aai/v7/cloud-infrastructure/pservers/pserver/test-pserver1", HttpStatus.GONE);
+ httpStatusMap.put("/aai/v8/cloud-infrastructure/pservers/pserver/test-pserver1", HttpStatus.GONE);
+ httpStatusMap.put("/aai/v9/cloud-infrastructure/pservers/pserver/test-pserver1", HttpStatus.GONE);
}
private void setupModelsRetired() {
httpStatusMap = new HashMap<>();
- httpStatusMap.put("/aai/v8/cloud-infrastructure/pservers/pserver/samomaisdjfajsfoas", HttpStatus.NOT_FOUND);
+ httpStatusMap.put("/aai/v8/cloud-infrastructure/pservers/pserver/samomaisdjfajsfoas", HttpStatus.GONE);
httpStatusMap.put("/aai/v8/service-design-and-creation/models/model/samomaisdjfajsfoas", HttpStatus.GONE);
}
diff --git a/aai-resources/src/test/resources/application-test.properties b/aai-resources/src/test/resources/application-test.properties
index ade55fb..55717b9 100644
--- a/aai-resources/src/test/resources/application-test.properties
+++ b/aai-resources/src/test/resources/application-test.properties
@@ -50,9 +50,9 @@ schema.ingest.file=${server.local.startpath}/application.properties
# Schema Version Related Attributes
schema.uri.base.path=/aai
# Lists all of the versions in the schema
-schema.version.list=v8,v9,v10,v11,v12,v13,v14
+schema.version.list=v10,v11,v12,v13,v14,v15
# Specifies from which version should the depth parameter to default to zero
-schema.version.depth.start=v9
+schema.version.depth.start=v10
# Specifies from which version should the related link be displayed in response payload
schema.version.related.link.start=v10
# Specifies from which version should the client see only the uri excluding host info
@@ -63,4 +63,6 @@ schema.version.namespace.change.start=v12
# Specifies from which version should the client start seeing the edge label in payload
schema.version.edge.label.start=v12
# Specifies the version that the application should default to
-schema.version.api.default=v14
+schema.version.api.default=v15
+schema.translator.list=config
+
diff --git a/aai-resources/src/test/resources/etc/appprops/aaiconfig.properties b/aai-resources/src/test/resources/etc/appprops/aaiconfig.properties
index bc8b9b9..41862dc 100644
--- a/aai-resources/src/test/resources/etc/appprops/aaiconfig.properties
+++ b/aai-resources/src/test/resources/etc/appprops/aaiconfig.properties
@@ -31,23 +31,23 @@ aai.config.checktime=1000
aai.config.nodename=AutomaticallyOverwritten
aai.server.url.base=https://localhost:8443/aai/
-aai.server.url=https://localhost:8443/aai/v14/
+aai.server.url=https://localhost:8443/aai/v15/
aai.oldserver.url.base=https://localhost:8443/aai/servers/
aai.oldserver.url=https://localhost:8443/aai/servers/v2/
aai.global.callback.url=https://localhost:8443/aai/
-aai.notification.current.version=v14
+aai.notification.current.version=v15
aai.notificationEvent.default.status=UNPROCESSED
aai.notificationEvent.default.eventType=AAI-EVENT
aai.notificationEvent.default.domain=devINT1
aai.notificationEvent.default.sourceName=aai
aai.notificationEvent.default.sequenceNumber=0
aai.notificationEvent.default.severity=NORMAL
-aai.notificationEvent.default.version=v14
+aai.notificationEvent.default.version=v15
# This one lets us enable/disable resource-version checking on updates/deletes
aai.resourceversion.enableflag=true
aai.logging.maxStackTraceEntries=10
-aai.default.api.version=v14
+aai.default.api.version=v15
aai.realtime.clients=RO,SDNC,MSO
diff --git a/aai-resources/src/test/resources/payloads/relationship/complex2.json b/aai-resources/src/test/resources/payloads/relationship/complex2.json
new file mode 100644
index 0000000..19c76df
--- /dev/null
+++ b/aai-resources/src/test/resources/payloads/relationship/complex2.json
@@ -0,0 +1,16 @@
+{
+ "physical-location-id" : "e13d4587-19ad-4bf5-80f5-c021efb5b61d",
+ "physical-location-type" : "complextype2",
+ "street1" : "NewJerseyWay",
+ "city" : "Middletown",
+ "postal-code" : "07701",
+ "country" : "USA",
+ "region" : "NE",
+ "ctag-pools" : {
+ "ctag-pool" : [ {
+ "target-pe" : "5dbe73c6-cedf-4e68-a7c5-699ba6d90e1e",
+ "availability-zone-name" : "819ec2fa-fb9f-49f0-8fd8-5feb941aad1g",
+ "ctag-pool-purpose" : "4TMeWJ"
+ } ]
+ }
+} \ No newline at end of file
diff --git a/aai-resources/src/test/resources/payloads/relationship/complex3.json b/aai-resources/src/test/resources/payloads/relationship/complex3.json
new file mode 100644
index 0000000..c3589bd
--- /dev/null
+++ b/aai-resources/src/test/resources/payloads/relationship/complex3.json
@@ -0,0 +1,16 @@
+{
+ "physical-location-id" : "e13d4587-19ad-4bf5-80f5-c021efb5b61e",
+ "physical-location-type" : "complextype2",
+ "street1" : "NewJerseyWay",
+ "city" : "Middletown",
+ "postal-code" : "07701",
+ "country" : "USA",
+ "region" : "NE",
+ "ctag-pools" : {
+ "ctag-pool" : [ {
+ "target-pe" : "5dbe73c6-cedf-4e68-a7c5-699ba6d90e1e",
+ "availability-zone-name" : "819ec2fa-fb9f-49f0-8fd8-5feb941aad1g",
+ "ctag-pool-purpose" : "4TMeWJ"
+ } ]
+ }
+} \ No newline at end of file
diff --git a/aai-resources/src/test/resources/payloads/relationship/complex4.json b/aai-resources/src/test/resources/payloads/relationship/complex4.json
new file mode 100644
index 0000000..3535320
--- /dev/null
+++ b/aai-resources/src/test/resources/payloads/relationship/complex4.json
@@ -0,0 +1,16 @@
+{
+ "physical-location-id" : "e13d4587-19ad-4bf5-80f5-c021efb5b61f",
+ "physical-location-type" : "complextype2",
+ "street1" : "NewJerseyWay",
+ "city" : "Middletown",
+ "postal-code" : "07701",
+ "country" : "USA",
+ "region" : "NE",
+ "ctag-pools" : {
+ "ctag-pool" : [ {
+ "target-pe" : "5dbe73c6-cedf-4e68-a7c5-699ba6d90e1e",
+ "availability-zone-name" : "819ec2fa-fb9f-49f0-8fd8-5feb941aad1g",
+ "ctag-pool-purpose" : "4TMeWJ"
+ } ]
+ }
+} \ No newline at end of file
diff --git a/aai-resources/src/test/resources/payloads/relationship/pserver-complex-relationship-list2.json b/aai-resources/src/test/resources/payloads/relationship/pserver-complex-relationship-list2.json
new file mode 100644
index 0000000..09dfb95
--- /dev/null
+++ b/aai-resources/src/test/resources/payloads/relationship/pserver-complex-relationship-list2.json
@@ -0,0 +1 @@
+{"relationship":[{"related-to":"complex","relationship-label":"org.onap.relationships.inventory.LocatedIn","related-link":"/aai/v15/cloud-infrastructure/complexes/complex/e13d4587-19ad-4bf5-80f5-c021efb5b61d","relationship-data":[{"relationship-key":"complex.physical-location-id","relationship-value":"e13d4587-19ad-4bf5-80f5-c021efb5b61d"}]}]} \ No newline at end of file
diff --git a/aai-resources/src/test/resources/payloads/relationship/pserver-complex-relationship-list3.json b/aai-resources/src/test/resources/payloads/relationship/pserver-complex-relationship-list3.json
new file mode 100644
index 0000000..3e62e42
--- /dev/null
+++ b/aai-resources/src/test/resources/payloads/relationship/pserver-complex-relationship-list3.json
@@ -0,0 +1 @@
+{"results":[{"pserver":{"hostname":"590a8943-1200-43b3-825b-75dde6b8f44c","in-maint":false,"resource-version":"1544562911222","relationship-list":{"relationship":[{"related-to":"complex","relationship-label":"org.onap.relationships.inventory.LocatedIn","related-link":"/aai/v15/cloud-infrastructure/complexes/complex/e13d4587-19ad-4bf5-80f5-c021efb5b61e","relationship-data":[{"relationship-key":"complex.physical-location-id","relationship-value":"e13d4587-19ad-4bf5-80f5-c021efb5b61e"}]}]}}}]} \ No newline at end of file
diff --git a/aai-resources/src/test/resources/payloads/relationship/pserver-complex-relationship2.json b/aai-resources/src/test/resources/payloads/relationship/pserver-complex-relationship2.json
new file mode 100644
index 0000000..b9cca14
--- /dev/null
+++ b/aai-resources/src/test/resources/payloads/relationship/pserver-complex-relationship2.json
@@ -0,0 +1,8 @@
+{
+ "related-to" : "complex",
+ "related-link" : "/aai/v11/cloud-infrastructure/complexes/complex/e13d4587-19ad-4bf5-80f5-c021efb5b61d",
+ "relationship-data" : [{
+ "relationship-key" : "complex.physical-location-id",
+ "relationship-value" : "e13d4587-19ad-4bf5-80f5-c021efb5b61d"
+ }]
+} \ No newline at end of file
diff --git a/aai-resources/src/test/resources/payloads/relationship/pserver-complex-relationship3.json b/aai-resources/src/test/resources/payloads/relationship/pserver-complex-relationship3.json
new file mode 100644
index 0000000..f28fc5c
--- /dev/null
+++ b/aai-resources/src/test/resources/payloads/relationship/pserver-complex-relationship3.json
@@ -0,0 +1,8 @@
+{
+ "related-to" : "complex",
+ "related-link" : "/aai/v11/cloud-infrastructure/complexes/complex/e13d4587-19ad-4bf5-80f5-c021efb5b61e",
+ "relationship-data" : [{
+ "relationship-key" : "complex.physical-location-id",
+ "relationship-value" : "e13d4587-19ad-4bf5-80f5-c021efb5b61d"
+ }]
+} \ No newline at end of file
diff --git a/aai-resources/src/test/resources/payloads/relationship/pserver2.json b/aai-resources/src/test/resources/payloads/relationship/pserver2.json
new file mode 100644
index 0000000..cb40bed
--- /dev/null
+++ b/aai-resources/src/test/resources/payloads/relationship/pserver2.json
@@ -0,0 +1,4 @@
+{
+ "hostname" : "590a8943-1200-43b3-825b-75dde6b8f44b",
+ "in-maint" : false
+} \ No newline at end of file
diff --git a/aai-resources/src/test/resources/payloads/relationship/pserver3.json b/aai-resources/src/test/resources/payloads/relationship/pserver3.json
new file mode 100644
index 0000000..bf6b6fd
--- /dev/null
+++ b/aai-resources/src/test/resources/payloads/relationship/pserver3.json
@@ -0,0 +1,4 @@
+{
+ "hostname" : "590a8943-1200-43b3-825b-75dde6b8f44c",
+ "in-maint" : false
+} \ No newline at end of file
diff --git a/aai-resources/src/test/resources/payloads/relationship/pserver4.json b/aai-resources/src/test/resources/payloads/relationship/pserver4.json
new file mode 100644
index 0000000..0143ea2
--- /dev/null
+++ b/aai-resources/src/test/resources/payloads/relationship/pserver4.json
@@ -0,0 +1,4 @@
+{
+ "hostname" : "590a8943-1200-43b3-825b-75dde6b8f44d",
+ "in-maint" : false
+} \ No newline at end of file