aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/Constants.java2
-rw-r--r--plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/HttpServiceUtils.java25
-rw-r--r--plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/AaiSimulatorControllerTest.java3
-rw-r--r--plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/CloudRegionsControllerTest.java34
-rw-r--r--plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/ExternalSystemEsrControllerTest.java4
-rw-r--r--plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/GenericVnfsControllerTest.java15
-rw-r--r--plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/LinesOfBusinessControllerTest.java10
-rw-r--r--plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/NodesControllerTest.java10
-rw-r--r--plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/OwningEntityControllerTest.java9
-rw-r--r--plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/PlatformControllerTest.java8
-rw-r--r--plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/ProjectControllerTest.java11
-rw-r--r--plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/utils/TestConstants.java27
-rw-r--r--plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/resources/test-data/generic-vnf-relationship.json2
-rw-r--r--tests/so/etsi/etsi_tests.robot18
14 files changed, 108 insertions, 70 deletions
diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/Constants.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/Constants.java
index 297f4525..4099c2a0 100644
--- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/Constants.java
+++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/Constants.java
@@ -25,7 +25,7 @@ package org.onap.so.aaisimulator.utils;
*/
public class Constants {
- public static final String BASE_URL = "/aai/v15";
+ public static final String BASE_URL = "/aai/v{version:\\d+}";
public static final String NODES_URL = BASE_URL + "/nodes";
diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/HttpServiceUtils.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/HttpServiceUtils.java
index 10c1f258..81781025 100644
--- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/HttpServiceUtils.java
+++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/HttpServiceUtils.java
@@ -19,13 +19,14 @@
*/
package org.onap.so.aaisimulator.utils;
-import static org.onap.so.aaisimulator.utils.Constants.BASE_URL;
import static org.onap.so.aaisimulator.utils.Constants.BI_DIRECTIONAL_RELATIONSHIP_LIST_URL;
import static org.onap.so.aaisimulator.utils.Constants.RELATIONSHIP_LIST_RELATIONSHIP_URL;
import static org.springframework.http.MediaType.APPLICATION_XML;
import java.net.URI;
import java.util.Arrays;
import java.util.Enumeration;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import javax.servlet.http.HttpServletRequest;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
@@ -37,12 +38,30 @@ import org.springframework.web.util.UriComponentsBuilder;
*/
public class HttpServiceUtils {
+ private static final String START_WITH_FORWARD_SLASH = "(^/.*?)";
+ private static final String ALPHANUMERIC = "((?:v+[a-z0-9]*)/)";
+ private static final String REGEX = START_WITH_FORWARD_SLASH + ALPHANUMERIC;
+ private static final Pattern PATTERN = Pattern.compile(REGEX, Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
+
private HttpServiceUtils() {}
public static URI getBaseUrl(final HttpServletRequest request) {
final StringBuffer url = request.getRequestURL();
final String uri = request.getRequestURI();
- return UriComponentsBuilder.fromHttpUrl(url.substring(0, url.indexOf(uri))).path(BASE_URL).build().toUri();
+ return UriComponentsBuilder.fromHttpUrl(url.substring(0, url.indexOf(uri))).path(getBaseUrl(uri)).build()
+ .toUri();
+ }
+
+ private static String getBaseUrl(final String uri) {
+ final Matcher matcher = PATTERN.matcher(uri);
+ if (matcher.find()) {
+ final StringBuilder builder = new StringBuilder();
+ for (int index = 0; index < matcher.groupCount() - 1; index++) {
+ builder.append(matcher.group(index));
+ }
+ return builder.toString();
+ }
+ return uri;
}
public static URI getBaseUrl(final StringBuffer requestUrl, final String requestUri) {
@@ -58,7 +77,7 @@ public class HttpServiceUtils {
return getHeaders(request, APPLICATION_XML);
}
- public static HttpHeaders getHeaders(final HttpServletRequest request, MediaType mediaType) {
+ public static HttpHeaders getHeaders(final HttpServletRequest request, final MediaType mediaType) {
final HttpHeaders headers = new HttpHeaders();
for (final Enumeration<String> enumeration = request.getHeaderNames(); enumeration.hasMoreElements();) {
final String headerName = enumeration.nextElement();
diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/AaiSimulatorControllerTest.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/AaiSimulatorControllerTest.java
index 610aaa70..4fe5c403 100644
--- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/AaiSimulatorControllerTest.java
+++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/AaiSimulatorControllerTest.java
@@ -23,6 +23,7 @@ import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.onap.so.aaisimulator.utils.Constants;
+import org.onap.so.aaisimulator.utils.TestConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
@@ -58,7 +59,7 @@ public class AaiSimulatorControllerTest {
}
private String getBaseUrl() {
- return "https://localhost:" + port + Constants.BASE_URL;
+ return "https://localhost:" + port + TestConstants.BASE_URL_V17;
}
}
diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/CloudRegionsControllerTest.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/CloudRegionsControllerTest.java
index f8e7bf74..1b967596 100644
--- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/CloudRegionsControllerTest.java
+++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/CloudRegionsControllerTest.java
@@ -100,7 +100,7 @@ public class CloudRegionsControllerTest extends AbstractSpringBootTest {
@Test
public void test_putCloudRegion_successfullyAddedToCache() throws Exception {
- final String url = getUrl(Constants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);
+ final String url = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);
invokeCloudRegionHttpPutEndPointAndAssertResponse(url);
@@ -119,7 +119,7 @@ public class CloudRegionsControllerTest extends AbstractSpringBootTest {
@Test
public void test_getCloudRegionWithDepthValue_shouldReturnMatchedCloudRegion() throws Exception {
- final String url = getUrl(Constants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);
+ final String url = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);
invokeCloudRegionHttpPutEndPointAndAssertResponse(url);
@@ -140,11 +140,11 @@ public class CloudRegionsControllerTest extends AbstractSpringBootTest {
@Test
public void test_putGenericVnfRelationShipToPlatform_successfullyAddedToCache() throws Exception {
- final String url = getUrl(Constants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);
+ final String url = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);
invokeCloudRegionHttpPutEndPointAndAssertResponse(url);
- final String relationShipUrl = getUrl(Constants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME,
+ final String relationShipUrl = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME,
BI_DIRECTIONAL_RELATIONSHIP_LIST_URL);
final ResponseEntity<Relationship> responseEntity = testRestTemplateService.invokeHttpPut(relationShipUrl,
@@ -178,12 +178,12 @@ public class CloudRegionsControllerTest extends AbstractSpringBootTest {
@Test
public void test_putTenant_successfullyAddedToCache() throws Exception {
- final String cloudRegionUrl = getUrl(Constants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);
+ final String cloudRegionUrl = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);
invokeCloudRegionHttpPutEndPointAndAssertResponse(cloudRegionUrl);
- final String tenantUrl =
- getUrl(Constants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME + TENANTS_TENANT + TENANT_ID);
+ final String tenantUrl = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME,
+ "/" + CLOUD_REGION_NAME + TENANTS_TENANT + TENANT_ID);
addTenantAndAssertResponse(tenantUrl);
final ResponseEntity<Tenant> response = testRestTemplateService.invokeHttpGet(tenantUrl, Tenant.class);
@@ -204,15 +204,15 @@ public class CloudRegionsControllerTest extends AbstractSpringBootTest {
addCustomerServiceAndGenericVnf();
- final String cloudRegionUrl = getUrl(Constants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);
+ final String cloudRegionUrl = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);
invokeCloudRegionHttpPutEndPointAndAssertResponse(cloudRegionUrl);
- final String tenantUrl =
- getUrl(Constants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME, TENANTS_TENANT + TENANT_ID);
+ final String tenantUrl = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME,
+ TENANTS_TENANT + TENANT_ID);
addTenantAndAssertResponse(tenantUrl);
- final String tenantRelationShipUrl = getUrl(Constants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME,
- TENANTS_TENANT + TENANT_ID, RELATIONSHIP_LIST_RELATIONSHIP_URL);
+ final String tenantRelationShipUrl = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME,
+ "/" + CLOUD_REGION_NAME, TENANTS_TENANT + TENANT_ID, RELATIONSHIP_LIST_RELATIONSHIP_URL);
final ResponseEntity<Void> tenantRelationShipResponse = testRestTemplateService
.invokeHttpPut(tenantRelationShipUrl, TestUtils.getGenericVnfRelatedLink(), Void.class);
@@ -262,12 +262,12 @@ public class CloudRegionsControllerTest extends AbstractSpringBootTest {
@Test
public void test_putEsrSystemInfo_successfullyAddedToCache() throws Exception {
- final String url = getUrl(Constants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);
+ final String url = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);
invokeCloudRegionHttpPutEndPointAndAssertResponse(url);
- final String esrSystemInfoListUrl =
- getUrl(Constants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME, ESR_SYSTEM_INFO_LIST_URL);
+ final String esrSystemInfoListUrl = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME,
+ "/" + CLOUD_REGION_NAME, ESR_SYSTEM_INFO_LIST_URL);
final String esrSystemInfoUrl = esrSystemInfoListUrl + "/esr-system-info/" + ESR_SYSTEM_INFO_ID;
final ResponseEntity<Void> esrSystemInfoResponse =
@@ -298,7 +298,7 @@ public class CloudRegionsControllerTest extends AbstractSpringBootTest {
@Test
public void test_putVServer_successfullyAddedToCache() throws Exception {
- final String url = getUrl(Constants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);
+ final String url = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);
invokeCloudRegionHttpPutEndPointAndAssertResponse(url);
addCustomerServiceAndGenericVnf();
@@ -359,7 +359,7 @@ public class CloudRegionsControllerTest extends AbstractSpringBootTest {
@Test
public void test_deleteVServer_successfullyRemoveFromCache() throws Exception {
- final String url = getUrl(Constants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);
+ final String url = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);
invokeCloudRegionHttpPutEndPointAndAssertResponse(url);
addCustomerServiceAndGenericVnf();
diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/ExternalSystemEsrControllerTest.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/ExternalSystemEsrControllerTest.java
index fe656dda..2fd5f7b8 100644
--- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/ExternalSystemEsrControllerTest.java
+++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/ExternalSystemEsrControllerTest.java
@@ -23,7 +23,6 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-import static org.onap.so.aaisimulator.utils.Constants.EXTERNAL_SYSTEM_ESR_VNFM_LIST_URL;
import static org.onap.so.aaisimulator.utils.Constants.RELATIONSHIP_LIST_RELATIONSHIP_URL;
import static org.onap.so.aaisimulator.utils.TestConstants.CUSTOMERS_URL;
import static org.onap.so.aaisimulator.utils.TestConstants.ESR_PASSWORD;
@@ -58,6 +57,7 @@ import org.onap.aai.domain.yang.RelationshipList;
import org.onap.so.aaisimulator.service.providers.ExternalSystemCacheServiceProvider;
import org.onap.so.aaisimulator.service.providers.GenericVnfCacheServiceProvider;
import org.onap.so.aaisimulator.utils.Constants;
+import org.onap.so.aaisimulator.utils.TestConstants;
import org.onap.so.aaisimulator.utils.TestUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
@@ -103,7 +103,7 @@ public class ExternalSystemEsrControllerTest extends AbstractSpringBootTest {
final String esrVnfmUrl = getUrl(ESR_VNFM_URL, ESR_VNFM_ID);
addEsrVnfmAndAssertResponse(esrVnfmUrl);
- final String esrVnfmListUrl = getUrl(EXTERNAL_SYSTEM_ESR_VNFM_LIST_URL);
+ final String esrVnfmListUrl = getUrl(TestConstants.EXTERNAL_SYSTEM_ESR_VNFM_LIST_URL);
final ResponseEntity<EsrVnfmList> response =
testRestTemplateService.invokeHttpGet(esrVnfmListUrl, EsrVnfmList.class);
diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/GenericVnfsControllerTest.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/GenericVnfsControllerTest.java
index dca7f669..8b6ec8c7 100644
--- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/GenericVnfsControllerTest.java
+++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/GenericVnfsControllerTest.java
@@ -57,6 +57,7 @@ import org.onap.so.aaisimulator.service.providers.GenericVnfCacheServiceProvider
import org.onap.so.aaisimulator.service.providers.LinesOfBusinessCacheServiceProvider;
import org.onap.so.aaisimulator.service.providers.PlatformCacheServiceProvider;
import org.onap.so.aaisimulator.utils.Constants;
+import org.onap.so.aaisimulator.utils.TestConstants;
import org.onap.so.aaisimulator.utils.TestUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
@@ -188,7 +189,7 @@ public class GenericVnfsControllerTest extends AbstractSpringBootTest {
public void test_putGenericVnfRelationToPlatform_successfullyAddedToCache() throws Exception {
addCustomerServiceAndGenericVnf();
- final String platformUrl = getUrl(Constants.PLATFORMS_URL, PLATFORM_NAME);
+ final String platformUrl = getUrl(TestConstants.PLATFORMS_URL, PLATFORM_NAME);
final ResponseEntity<Void> platformResponse =
testRestTemplateService.invokeHttpPut(platformUrl, TestUtils.getPlatform(), Void.class);
assertEquals(HttpStatus.ACCEPTED, platformResponse.getStatusCode());
@@ -211,7 +212,7 @@ public class GenericVnfsControllerTest extends AbstractSpringBootTest {
assertEquals(Constants.USES, relationship.getRelationshipLabel());
assertFalse(relationship.getRelationshipData().isEmpty());
assertEquals(1, relationship.getRelationshipData().size());
- assertEquals(Constants.PLATFORMS_URL + PLATFORM_NAME, relationship.getRelatedLink());
+ assertEquals(TestConstants.PLATFORMS_URL + PLATFORM_NAME, relationship.getRelatedLink());
final List<RelationshipData> relationshipData = relationship.getRelationshipData();
@@ -227,7 +228,7 @@ public class GenericVnfsControllerTest extends AbstractSpringBootTest {
public void test_putGenericVnfRelationToLineOfBusiness_successfullyAddedToCache() throws Exception {
addCustomerServiceAndGenericVnf();
- final String url = getUrl(Constants.LINES_OF_BUSINESS_URL, LINE_OF_BUSINESS_NAME);
+ final String url = getUrl(TestConstants.LINES_OF_BUSINESS_URL, LINE_OF_BUSINESS_NAME);
final ResponseEntity<Void> responseEntity =
testRestTemplateService.invokeHttpPut(url, TestUtils.getLineOfBusiness(), Void.class);
assertEquals(HttpStatus.ACCEPTED, responseEntity.getStatusCode());
@@ -248,7 +249,7 @@ public class GenericVnfsControllerTest extends AbstractSpringBootTest {
final Relationship relationship = relationshipList.getRelationship().get(0);
assertEquals(Constants.USES, relationship.getRelationshipLabel());
- assertEquals(Constants.LINES_OF_BUSINESS_URL + LINE_OF_BUSINESS_NAME, relationship.getRelatedLink());
+ assertEquals(TestConstants.LINES_OF_BUSINESS_URL + LINE_OF_BUSINESS_NAME, relationship.getRelatedLink());
assertFalse(relationship.getRelationshipData().isEmpty());
assertEquals(1, relationship.getRelationshipData().size());
@@ -266,7 +267,7 @@ public class GenericVnfsControllerTest extends AbstractSpringBootTest {
public void test_putGenericVnfRelationToCloudRegion_successfullyAddedToCache() throws Exception {
addCustomerServiceAndGenericVnf();
- final String url = getUrl(Constants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);
+ final String url = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);
final ResponseEntity<Void> responseEntity =
testRestTemplateService.invokeHttpPut(url, TestUtils.getCloudRegion(), Void.class);
@@ -288,7 +289,7 @@ public class GenericVnfsControllerTest extends AbstractSpringBootTest {
final Relationship relationship = relationshipList.getRelationship().get(0);
assertEquals(Constants.LOCATED_IN, relationship.getRelationshipLabel());
- assertEquals(Constants.CLOUD_REGIONS + CLOUD_OWNER_NAME + "/" + CLOUD_REGION_NAME,
+ assertEquals(TestConstants.CLOUD_REGIONS + CLOUD_OWNER_NAME + "/" + CLOUD_REGION_NAME,
relationship.getRelatedLink());
assertFalse(relationship.getRelationshipData().isEmpty());
@@ -373,7 +374,7 @@ public class GenericVnfsControllerTest extends AbstractSpringBootTest {
addCustomerServiceAndGenericVnf();
final String selfLink = "http://localhost:9921/generic-vnf/" + VNF_ID;
- final String url = getUrl(Constants.GENERIC_VNFS_URL) + "?selflink=" + selfLink;
+ final String url = getUrl(TestConstants.GENERIC_VNFS_URL_1) + "?selflink=" + selfLink;
final ResponseEntity<GenericVnfs> response = testRestTemplateService.invokeHttpGet(url, GenericVnfs.class);
assertEquals(HttpStatus.OK, response.getStatusCode());
diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/LinesOfBusinessControllerTest.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/LinesOfBusinessControllerTest.java
index 111993ce..30b3d279 100644
--- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/LinesOfBusinessControllerTest.java
+++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/LinesOfBusinessControllerTest.java
@@ -62,7 +62,7 @@ public class LinesOfBusinessControllerTest extends AbstractSpringBootTest {
@Test
public void test_putLineOfBusiness_successfullyAddedToCache() throws Exception {
- final String url = getUrl(Constants.LINES_OF_BUSINESS_URL, LINE_OF_BUSINESS_NAME);
+ final String url = getUrl(TestConstants.LINES_OF_BUSINESS_URL, LINE_OF_BUSINESS_NAME);
final ResponseEntity<Void> lineOfBusinessResponse =
testRestTemplateService.invokeHttpPut(url, TestUtils.getLineOfBusiness(), Void.class);
assertEquals(HttpStatus.ACCEPTED, lineOfBusinessResponse.getStatusCode());
@@ -82,7 +82,7 @@ public class LinesOfBusinessControllerTest extends AbstractSpringBootTest {
@Test
public void test_getLineOfBusinessWithFormatCount() throws Exception {
- final String url = getUrl(Constants.LINES_OF_BUSINESS_URL, LINE_OF_BUSINESS_NAME);
+ final String url = getUrl(TestConstants.LINES_OF_BUSINESS_URL, LINE_OF_BUSINESS_NAME);
final ResponseEntity<Void> lineOfBusinessResponse =
testRestTemplateService.invokeHttpPut(url, TestUtils.getLineOfBusiness(), Void.class);
assertEquals(HttpStatus.ACCEPTED, lineOfBusinessResponse.getStatusCode());
@@ -103,13 +103,13 @@ public class LinesOfBusinessControllerTest extends AbstractSpringBootTest {
@Test
public void test_putGenericVnfRelationShipToPlatform_successfullyAddedToCache() throws Exception {
- final String url = getUrl(Constants.LINES_OF_BUSINESS_URL, LINE_OF_BUSINESS_NAME);
+ final String url = getUrl(TestConstants.LINES_OF_BUSINESS_URL, LINE_OF_BUSINESS_NAME);
final ResponseEntity<Void> response =
testRestTemplateService.invokeHttpPut(url, TestUtils.getLineOfBusiness(), Void.class);
assertEquals(HttpStatus.ACCEPTED, response.getStatusCode());
- final String relationShipUrl =
- getUrl(Constants.LINES_OF_BUSINESS_URL, LINE_OF_BUSINESS_NAME, BI_DIRECTIONAL_RELATIONSHIP_LIST_URL);
+ final String relationShipUrl = getUrl(TestConstants.LINES_OF_BUSINESS_URL, LINE_OF_BUSINESS_NAME,
+ BI_DIRECTIONAL_RELATIONSHIP_LIST_URL);
final ResponseEntity<Relationship> responseEntity = testRestTemplateService.invokeHttpPut(relationShipUrl,
TestUtils.getGenericVnfRelationShip(), Relationship.class);
diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/NodesControllerTest.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/NodesControllerTest.java
index 315f4fbb..378d77df 100644
--- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/NodesControllerTest.java
+++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/NodesControllerTest.java
@@ -23,7 +23,6 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-import static org.onap.so.aaisimulator.utils.Constants.NODES_URL;
import static org.onap.so.aaisimulator.utils.Constants.RESOURCE_LINK;
import static org.onap.so.aaisimulator.utils.Constants.RESOURCE_TYPE;
import static org.onap.so.aaisimulator.utils.Constants.SERVICE_RESOURCE_TYPE;
@@ -47,7 +46,7 @@ import org.onap.so.aaisimulator.models.Format;
import org.onap.so.aaisimulator.models.Results;
import org.onap.so.aaisimulator.service.providers.CustomerCacheServiceProvider;
import org.onap.so.aaisimulator.service.providers.NodesCacheServiceProvider;
-import org.onap.so.aaisimulator.utils.Constants;
+import org.onap.so.aaisimulator.utils.TestConstants;
import org.onap.so.aaisimulator.utils.TestUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
@@ -78,7 +77,7 @@ public class NodesControllerTest extends AbstractSpringBootTest {
invokeCustomerandServiceInstanceUrls();
final ResponseEntity<ServiceInstance> actual = testRestTemplateService
- .invokeHttpGet(getUrl(Constants.NODES_URL, SERVICE_INSTANCE_URL), ServiceInstance.class);
+ .invokeHttpGet(getUrl(TestConstants.NODES_URL, SERVICE_INSTANCE_URL), ServiceInstance.class);
assertEquals(HttpStatus.OK, actual.getStatusCode());
assertTrue(actual.hasBody());
@@ -97,7 +96,7 @@ public class NodesControllerTest extends AbstractSpringBootTest {
invokeCustomerandServiceInstanceUrls();
final ResponseEntity<Results> actual = testRestTemplateService.invokeHttpGet(
- getUrl(Constants.NODES_URL, SERVICE_INSTANCE_URL) + "?format=" + Format.PATHED.getValue(),
+ getUrl(TestConstants.NODES_URL, SERVICE_INSTANCE_URL) + "?format=" + Format.PATHED.getValue(),
Results.class);
assertEquals(HttpStatus.OK, actual.getStatusCode());
@@ -123,7 +122,8 @@ public class NodesControllerTest extends AbstractSpringBootTest {
testRestTemplateService.invokeHttpPut(genericVnfUrl, TestUtils.getGenericVnf(), Void.class);
assertEquals(HttpStatus.ACCEPTED, genericVnfResponse.getStatusCode());
- final String nodeGenericVnfsUrl = getUrl(NODES_URL, GENERIC_VNFS_URL) + "?vnf-name=" + GENERIC_VNF_NAME;
+ final String nodeGenericVnfsUrl =
+ getUrl(TestConstants.NODES_URL, GENERIC_VNFS_URL) + "?vnf-name=" + GENERIC_VNF_NAME;
final ResponseEntity<GenericVnfs> actual =
testRestTemplateService.invokeHttpGet(nodeGenericVnfsUrl, GenericVnfs.class);
diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/OwningEntityControllerTest.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/OwningEntityControllerTest.java
index f4fcadeb..015994a5 100644
--- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/OwningEntityControllerTest.java
+++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/OwningEntityControllerTest.java
@@ -44,6 +44,7 @@ import org.onap.so.aaisimulator.models.Results;
import org.onap.so.aaisimulator.service.providers.CustomerCacheServiceProvider;
import org.onap.so.aaisimulator.service.providers.OwnEntityCacheServiceProvider;
import org.onap.so.aaisimulator.utils.Constants;
+import org.onap.so.aaisimulator.utils.TestConstants;
import org.onap.so.aaisimulator.utils.TestUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
@@ -72,7 +73,7 @@ public class OwningEntityControllerTest extends AbstractSpringBootTest {
@Test
public void test_putOwningEntity_successfullyAddedToCache() throws Exception {
- final String url = getUrl(Constants.OWNING_ENTITY_URL, OWN_ENTITY_ID_VALUE);
+ final String url = getUrl(TestConstants.OWNING_ENTITY_URL, OWN_ENTITY_ID_VALUE);
final ResponseEntity<Void> actual =
testRestTemplateService.invokeHttpPut(url, TestUtils.getOwningEntity(), Void.class);
@@ -92,7 +93,7 @@ public class OwningEntityControllerTest extends AbstractSpringBootTest {
@Test
public void test_getOwningEntityCount_correctResult() throws Exception {
- final String url = getUrl(Constants.OWNING_ENTITY_URL, OWN_ENTITY_ID_VALUE);
+ final String url = getUrl(TestConstants.OWNING_ENTITY_URL, OWN_ENTITY_ID_VALUE);
final ResponseEntity<Void> actual =
testRestTemplateService.invokeHttpPut(url, TestUtils.getOwningEntity(), Void.class);
@@ -113,7 +114,7 @@ public class OwningEntityControllerTest extends AbstractSpringBootTest {
public void test_putOwningEntityRelationShip_successfullyAddedToCache() throws Exception {
addCustomerAndServiceInstance();
- final String url = getUrl(Constants.OWNING_ENTITY_URL, OWN_ENTITY_ID_VALUE);
+ final String url = getUrl(TestConstants.OWNING_ENTITY_URL, OWN_ENTITY_ID_VALUE);
final ResponseEntity<Void> actual =
testRestTemplateService.invokeHttpPut(url, TestUtils.getOwningEntity(), Void.class);
assertEquals(HttpStatus.ACCEPTED, actual.getStatusCode());
@@ -170,7 +171,7 @@ public class OwningEntityControllerTest extends AbstractSpringBootTest {
assertEquals(1, serviceRelationshipList.size());
final Relationship relationship = serviceRelationshipList.get(0);
assertEquals(Constants.BELONGS_TO, relationship.getRelationshipLabel());
- assertEquals(Constants.OWNING_ENTITY_URL + OWN_ENTITY_ID_VALUE, relationship.getRelatedLink());
+ assertEquals(TestConstants.OWNING_ENTITY_URL + OWN_ENTITY_ID_VALUE, relationship.getRelatedLink());
final List<RelationshipData> serviceRelationshipDataList = serviceRelationshipList.get(0).getRelationshipData();
assertFalse(serviceRelationshipDataList.isEmpty());
diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/PlatformControllerTest.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/PlatformControllerTest.java
index 331d9726..7e88eec5 100644
--- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/PlatformControllerTest.java
+++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/PlatformControllerTest.java
@@ -62,7 +62,7 @@ public class PlatformControllerTest extends AbstractSpringBootTest {
@Test
public void test_putPlatform_successfullyAddedToCache() throws Exception {
- final String platformUrl = getUrl(Constants.PLATFORMS_URL, PLATFORM_NAME);
+ final String platformUrl = getUrl(TestConstants.PLATFORMS_URL, PLATFORM_NAME);
final ResponseEntity<Void> platformResponse =
testRestTemplateService.invokeHttpPut(platformUrl, TestUtils.getPlatform(), Void.class);
assertEquals(HttpStatus.ACCEPTED, platformResponse.getStatusCode());
@@ -81,7 +81,7 @@ public class PlatformControllerTest extends AbstractSpringBootTest {
@Test
public void test_getPlatformWithFormatCount() throws Exception {
- final String platformUrl = getUrl(Constants.PLATFORMS_URL, PLATFORM_NAME);
+ final String platformUrl = getUrl(TestConstants.PLATFORMS_URL, PLATFORM_NAME);
final ResponseEntity<Void> platformResponse =
testRestTemplateService.invokeHttpPut(platformUrl, TestUtils.getPlatform(), Void.class);
@@ -103,13 +103,13 @@ public class PlatformControllerTest extends AbstractSpringBootTest {
@Test
public void test_putGenericVnfRelationShipToPlatform_successfullyAddedToCache() throws Exception {
- final String platformUrl = getUrl(Constants.PLATFORMS_URL, PLATFORM_NAME);
+ final String platformUrl = getUrl(TestConstants.PLATFORMS_URL, PLATFORM_NAME);
final ResponseEntity<Void> platformResponse =
testRestTemplateService.invokeHttpPut(platformUrl, TestUtils.getPlatform(), Void.class);
assertEquals(HttpStatus.ACCEPTED, platformResponse.getStatusCode());
final String platformRelationShipUrl =
- getUrl(Constants.PLATFORMS_URL, PLATFORM_NAME, BI_DIRECTIONAL_RELATIONSHIP_LIST_URL);
+ getUrl(TestConstants.PLATFORMS_URL, PLATFORM_NAME, BI_DIRECTIONAL_RELATIONSHIP_LIST_URL);
final ResponseEntity<Relationship> responseEntity = testRestTemplateService
.invokeHttpPut(platformRelationShipUrl, TestUtils.getGenericVnfRelationShip(), Relationship.class);
diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/ProjectControllerTest.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/ProjectControllerTest.java
index ecda94e3..678d417b 100644
--- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/ProjectControllerTest.java
+++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/ProjectControllerTest.java
@@ -43,6 +43,7 @@ import org.onap.so.aaisimulator.models.Results;
import org.onap.so.aaisimulator.service.providers.CustomerCacheServiceProvider;
import org.onap.so.aaisimulator.service.providers.ProjectCacheServiceProvider;
import org.onap.so.aaisimulator.utils.Constants;
+import org.onap.so.aaisimulator.utils.TestConstants;
import org.onap.so.aaisimulator.utils.TestRestTemplateService;
import org.onap.so.aaisimulator.utils.TestUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -78,7 +79,7 @@ public class ProjectControllerTest extends AbstractSpringBootTest {
@Test
public void test_putProject_successfullyAddedToCache() throws Exception {
- final String url = getUrl(Constants.PROJECT_URL, PROJECT_NAME_VALUE);
+ final String url = getUrl(TestConstants.PROJECT_URL, PROJECT_NAME_VALUE);
final ResponseEntity<Void> actual =
testRestTemplateService.invokeHttpPut(url, TestUtils.getBusinessProject(), Void.class);
@@ -98,13 +99,13 @@ public class ProjectControllerTest extends AbstractSpringBootTest {
public void test_putProjectRelationShip_successfullyAddedToCache() throws Exception {
addCustomerAndServiceInstance();
- final String url = getUrl(Constants.PROJECT_URL, PROJECT_NAME_VALUE);
+ final String url = getUrl(TestConstants.PROJECT_URL, PROJECT_NAME_VALUE);
final ResponseEntity<Void> actual =
testRestTemplateService.invokeHttpPut(url, TestUtils.getBusinessProject(), Void.class);
assertEquals(HttpStatus.ACCEPTED, actual.getStatusCode());
final String projectRelationshipUrl =
- getUrl(Constants.PROJECT_URL, PROJECT_NAME_VALUE, RELATIONSHIP_LIST_RELATIONSHIP_URL);
+ getUrl(TestConstants.PROJECT_URL, PROJECT_NAME_VALUE, RELATIONSHIP_LIST_RELATIONSHIP_URL);
final ResponseEntity<Void> putResponse = testRestTemplateService.invokeHttpPut(projectRelationshipUrl,
TestUtils.getBusinessProjectRelationship(), Void.class);
@@ -155,7 +156,7 @@ public class ProjectControllerTest extends AbstractSpringBootTest {
assertEquals(1, serviceRelationshipList.size());
final Relationship relationship = serviceRelationshipList.get(0);
assertEquals(Constants.USES, relationship.getRelationshipLabel());
- assertEquals(Constants.PROJECT_URL + PROJECT_NAME_VALUE, relationship.getRelatedLink());
+ assertEquals(TestConstants.PROJECT_URL + PROJECT_NAME_VALUE, relationship.getRelatedLink());
final List<RelationshipData> serviceRelationshipDataList = serviceRelationshipList.get(0).getRelationshipData();
@@ -171,7 +172,7 @@ public class ProjectControllerTest extends AbstractSpringBootTest {
@Test
public void test_getProjectCount_correctResult() throws Exception {
- final String url = getUrl(Constants.PROJECT_URL, PROJECT_NAME_VALUE);
+ final String url = getUrl(TestConstants.PROJECT_URL, PROJECT_NAME_VALUE);
final ResponseEntity<Void> actual =
testRestTemplateService.invokeHttpPut(url, TestUtils.getBusinessProject(), Void.class);
diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/utils/TestConstants.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/utils/TestConstants.java
index 79bf624a..b5758690 100644
--- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/utils/TestConstants.java
+++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/utils/TestConstants.java
@@ -19,15 +19,14 @@
*/
package org.onap.so.aaisimulator.utils;
-import static org.onap.so.aaisimulator.utils.Constants.EXTERNAL_SYSTEM_ESR_VNFM_LIST_URL;
-import org.onap.so.aaisimulator.utils.Constants;
-
/**
* @author waqas.ikram@ericsson.com
*
*/
public class TestConstants {
+ public static final String BASE_URL_V17 = "/aai/v17";
+
public static final String SERVICE_INSTANCES_URL = "/service-instances";
public static final String SERVICE_NAME = "ServiceTest";
@@ -44,13 +43,13 @@ public class TestConstants {
public static final String GLOBAL_CUSTOMER_ID = "DemoCustomer";
- public static final String CUSTOMERS_URL = Constants.CUSTOMER_URL + GLOBAL_CUSTOMER_ID;
+ public static final String CUSTOMERS_URL = BASE_URL_V17 + "/business/customers/customer/" + GLOBAL_CUSTOMER_ID;
public static final String VNF_ID = "dfd02fb5-d7fb-4aac-b3c4-cd6b60058701";
public static final String GENERIC_VNF_NAME = "EsyVnfInstantiationTest2";
- public static final String GENERIC_VNF_URL = Constants.GENERIC_VNFS_URL + "/generic-vnf/";
+ public static final String GENERIC_VNF_URL = BASE_URL_V17 + "/network/generic-vnfs/generic-vnf/";
public static final String GENERIC_VNFS_URL = "/generic-vnfs";
@@ -68,7 +67,9 @@ public class TestConstants {
public static final String TENANTS_TENANT = "/tenants/tenant/";
- public static final String ESR_VNFM_URL = EXTERNAL_SYSTEM_ESR_VNFM_LIST_URL + "/esr-vnfm/";
+ public static final String ESR_VNFM_URL = BASE_URL_V17 + "/external-system/esr-vnfm-list/esr-vnfm/";
+
+ public static final String EXTERNAL_SYSTEM_ESR_VNFM_LIST_URL = BASE_URL_V17 + "/external-system/esr-vnfm-list";
public static final String ESR_VNFM_ID = "c5e99cee-1996-4606-b697-838d51d4e1a3";
@@ -98,6 +99,20 @@ public class TestConstants {
public static final String VSERVER_ID = "f84fdb9b-ad7c-49db-a08f-e443b4cbd033";
+ public static final String OWNING_ENTITY_URL = BASE_URL_V17 + "/business/owning-entities/owning-entity/";
+
+ public static final String LINES_OF_BUSINESS_URL = BASE_URL_V17 + "/business/lines-of-business/line-of-business/";
+
+ public static final String PLATFORMS_URL = BASE_URL_V17 + "/business/platforms/platform/";
+
+ public static final String CLOUD_REGIONS = BASE_URL_V17 + "/cloud-infrastructure/cloud-regions/cloud-region/";
+
+ public static final String GENERIC_VNFS_URL_1 = BASE_URL_V17 + "/network/generic-vnfs";
+
+ public static final String NODES_URL = BASE_URL_V17 + "/nodes";
+
+ public static final String PROJECT_URL = BASE_URL_V17 + "/business/projects/project/";
+
private TestConstants() {}
}
diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/resources/test-data/generic-vnf-relationship.json b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/resources/test-data/generic-vnf-relationship.json
index a53ffa9c..25f317a5 100644
--- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/resources/test-data/generic-vnf-relationship.json
+++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/resources/test-data/generic-vnf-relationship.json
@@ -1,7 +1,7 @@
{
"related-to": "generic-vnf",
"relationship-label": "org.onap.relationships.inventory.Uses",
- "related-link": "/aai/v15/network/generic-vnfs/generic-vnf/dfd02fb5-d7fb-4aac-b3c4-cd6b60058701",
+ "related-link": "/aai/v17/network/generic-vnfs/generic-vnf/dfd02fb5-d7fb-4aac-b3c4-cd6b60058701",
"relationship-data": [{
"relationship-key": "generic-vnf.vnf-id",
"relationship-value": "dfd02fb5-d7fb-4aac-b3c4-cd6b60058701"
diff --git a/tests/so/etsi/etsi_tests.robot b/tests/so/etsi/etsi_tests.robot
index d7ba80c8..684034b7 100644
--- a/tests/so/etsi/etsi_tests.robot
+++ b/tests/so/etsi/etsi_tests.robot
@@ -24,7 +24,7 @@ Invoke Service Instantiation
${service_instantiation_request}= Post Request api_handler_session /onap/so/infra/serviceInstantiation/v7/serviceInstances data=${data} headers=${headers}
Run Keyword If '${service_instantiation_request.status_code}' == '200' log to console \nexecuted with expected result
log to console ${service_instantiation_request.content}
- ${service_instantiation_json_response}= Evaluate json.loads("""${service_instantiation_request.content}""", strict=False) json
+ ${service_instantiation_json_response}= Evaluate json.loads(r"""${service_instantiation_request.content}""", strict=False) json
${request_ID}= Set Variable ${service_instantiation_json_response}[requestReferences][requestId]
${service_instance_Id}= Set Variable ${service_instantiation_json_response}[requestReferences][instanceId]
SET GLOBAL VARIABLE ${service_instance_Id}
@@ -34,7 +34,7 @@ Invoke Service Instantiation
\ ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID}
\ Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result
\ log to console ${orchestration_status_request.content}
- \ ${orchestration_json_response}= Evaluate json.loads("""${orchestration_status_request.content}""", strict=False) json
+ \ ${orchestration_json_response}= Evaluate json.loads(r"""${orchestration_status_request.content}""", strict=False) json
\ ${actual_request_state}= SET VARIABLE ${orchestration_json_response}[request][requestStatus][requestState]
\ Log To Console Received actual repsonse status:${actual_request_state}
\ RUN KEYWORD IF '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED' Exit For Loop
@@ -51,13 +51,13 @@ Invoke VNF Instantiation
Create Session api_handler_session http://${REPO_IP}:8080
${data}= Get Binary File ${CURDIR}${/}data${/}vnfInstantiationRequest.json
- ${vnf_instantiate_request_json}= evaluate json.loads('''${data}''', strict=False) json
+ ${vnf_instantiate_request_json}= evaluate json.loads(r'''${data}''', strict=False) json
set to dictionary ${vnf_instantiate_request_json}[requestDetails][relatedInstanceList][0][relatedInstance] instanceId=${service_instance_Id}
${vnf_instantiate_request_string}= evaluate json.dumps(${vnf_instantiate_request_json}) json
&{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json
${vnf_instantiate_request}= Post Request api_handler_session /onap/so/infra/serviceInstantiation/v7/serviceInstances/${service_instance_Id}/vnfs data=${vnf_instantiate_request_string} headers=${headers}
Run Keyword If '${vnf_instantiate_request.status_code}' == '200' log to console \nexecuted with expected result
- ${vnf_instantiate_json_response}= Evaluate json.loads("""${vnf_instantiate_request.content}""") json
+ ${vnf_instantiate_json_response}= Evaluate json.loads(r"""${vnf_instantiate_request.content}""") json
${request_ID}= Set Variable ${vnf_instantiate_json_response}[requestReferences][requestId]
${actual_request_state}= SET VARIABLE ""
${vnf_instance_Id}= Set Variable ${vnf_instantiate_json_response}[requestReferences][instanceId]
@@ -67,7 +67,7 @@ Invoke VNF Instantiation
\ ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID}
\ Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result
\ Log To Console ${orchestration_status_request.content}
- \ ${orchestration_json_response}= Evaluate json.loads("""${orchestration_status_request.content}""", strict=False) json
+ \ ${orchestration_json_response}= Evaluate json.loads(r"""${orchestration_status_request.content}""", strict=False) json
\ ${actual_request_state}= SET VARIABLE ${orchestration_json_response}[request][requestStatus][requestState]
\ RUN KEYWORD IF '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED' Exit For Loop
\ Log To Console Will try again after ${SLEEP_INTERVAL_SEC} seconds
@@ -88,7 +88,7 @@ Delete VNF Instance
${data}= Get Binary File ${CURDIR}${/}data${/}vnfDeleteRequest.json
&{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json
${vnf_delete_request}= Delete Request api_handler_session /onap/so/infra/serviceInstantiation/v7/serviceInstances/${service_instance_Id}/vnfs/${vnf_instance_Id} data=${data} headers=${headers}
- ${vnf_delete_json_response}= Evaluate json.loads("""${vnf_delete_request.content}""") json
+ ${vnf_delete_json_response}= Evaluate json.loads(r"""${vnf_delete_request.content}""") json
Log to Console ${vnf_delete_json_response}
${request_ID}= Set Variable ${vnf_delete_json_response}[requestReferences][requestId]
${actual_request_state}= Set Variable ""
@@ -97,7 +97,7 @@ Delete VNF Instance
\ ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID}
\ Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result
\ Log To Console ${orchestration_status_request.content}
- \ ${orchestration_json_response}= Evaluate json.loads("""${orchestration_status_request.content}""") json
+ \ ${orchestration_json_response}= Evaluate json.loads(r"""${orchestration_status_request.content}""") json
\ ${actual_request_state}= SET VARIABLE ${orchestration_json_response}[request][requestStatus][requestState]
\ RUN KEYWORD IF '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED' Exit For Loop
\ Log To Console Will try again after ${SLEEP_INTERVAL_SEC} seconds
@@ -116,7 +116,7 @@ Delete Service Instance
${data}= Get Binary File ${CURDIR}${/}data${/}serviceDeleteRequest.json
&{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json
${service_delete_request}= Delete Request api_handler_session /onap/so/infra/serviceInstantiation/v7/serviceInstances/${service_instance_Id} data=${data} headers=${headers}
- ${service_delete_json_response}= Evaluate json.loads("""${service_delete_request.content}""") json
+ ${service_delete_json_response}= Evaluate json.loads(r"""${service_delete_request.content}""") json
Log to Console ${service_delete_json_response}
${request_ID}= Set Variable ${service_delete_json_response}[requestReferences][requestId]
${actual_request_state}= Set Variable ""
@@ -125,7 +125,7 @@ Delete Service Instance
\ ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID}
\ Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result
\ Log To Console ${orchestration_status_request.content}
- \ ${orchestration_json_response}= Evaluate json.loads("""${orchestration_status_request.content}""") json
+ \ ${orchestration_json_response}= Evaluate json.loads(r"""${orchestration_status_request.content}""") json
\ ${actual_request_state}= SET VARIABLE ${orchestration_json_response}[request][requestStatus][requestState]
\ RUN KEYWORD IF '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED' Exit For Loop
\ Log To Console Will try again after ${SLEEP_INTERVAL_SEC} seconds