summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsiddharth0905 <siddharth.singh4@amdocs.com>2019-01-21 12:02:57 +0530
committersiddharth0905 <siddharth.singh4@amdocs.com>2019-01-21 14:25:45 +0530
commit7d8c592bdd302fe59fe12b134af941c2dd6ab058 (patch)
tree93e7edc52de79df21a2f327db23778f9fa012403
parent6503c16035a75687c9edabd54449eeb4ec744906 (diff)
Operation on PNF
Operation on PNF Change-Id: I51448659eb5e730f42f30c6b5978809cfa1c9b6c Issue-ID: SDC-2054 Signed-off-by: siddharth0905 <siddharth.singh4@amdocs.com>
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/utils/ModelConverter.java60
-rw-r--r--catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/utils/ModelConverterTest.java12
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/interfaceoperation/InterfaceOperationsTest.java135
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/resource.xml23
4 files changed, 184 insertions, 46 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/utils/ModelConverter.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/utils/ModelConverter.java
index 82dcfef1ee..569491cef6 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/utils/ModelConverter.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/utils/ModelConverter.java
@@ -22,19 +22,68 @@ package org.openecomp.sdc.be.model.jsontitan.utils;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Optional;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.openecomp.sdc.be.dao.jsongraph.GraphVertex;
import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
-import org.openecomp.sdc.be.datatypes.elements.*;
+import org.openecomp.sdc.be.datatypes.elements.AdditionalInfoParameterDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.ArtifactDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.CapabilityDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.ComponentInstanceDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.CompositionDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.GroupDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.GroupInstanceDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.InterfaceDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.ListCapabilityDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.ListRequirementDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.MapArtifactDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.MapCapabilityProperty;
+import org.openecomp.sdc.be.datatypes.elements.MapGroupsDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.MapListCapabilityDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.MapListRequirementDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.MapPropertiesDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.PolicyDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.RelationshipInstDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.RequirementDataDefinition;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.*;
+import org.openecomp.sdc.be.model.AdditionalInformationDefinition;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.CapabilityDefinition;
+import org.openecomp.sdc.be.model.CapabilityRequirementRelationship;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.ComponentInstanceInput;
+import org.openecomp.sdc.be.model.ComponentInstanceProperty;
+import org.openecomp.sdc.be.model.DistributionStatusEnum;
+import org.openecomp.sdc.be.model.GroupDefinition;
+import org.openecomp.sdc.be.model.GroupInstance;
+import org.openecomp.sdc.be.model.InputDefinition;
+import org.openecomp.sdc.be.model.InterfaceDefinition;
+import org.openecomp.sdc.be.model.PolicyDefinition;
+import org.openecomp.sdc.be.model.PropertyDefinition;
+import org.openecomp.sdc.be.model.RelationshipImpl;
+import org.openecomp.sdc.be.model.RelationshipInfo;
+import org.openecomp.sdc.be.model.RequirementCapabilityRelDef;
+import org.openecomp.sdc.be.model.RequirementDefinition;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
import org.openecomp.sdc.be.model.jsontitan.datamodel.NodeType;
import org.openecomp.sdc.be.model.jsontitan.datamodel.TopologyTemplate;
import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElement;
@@ -46,11 +95,6 @@ import org.openecomp.sdc.be.resources.data.ResourceMetadataData;
import org.openecomp.sdc.be.resources.data.ServiceMetadataData;
import org.openecomp.sdc.common.log.wrappers.Logger;
-import java.util.*;
-import java.util.Map.Entry;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
public class ModelConverter {
public static final String CAP_PROP_DELIM = "#";
private static final Logger log = Logger.getLogger(ModelConverter.class);
@@ -178,7 +222,7 @@ public class ModelConverter {
} else {
TopologyTemplate topologyTemplate = (TopologyTemplate) toscaElement;
- if (resource.getResourceType() == ResourceTypeEnum.VF) {
+ if (resource.getResourceType() == ResourceTypeEnum.VF || resource.getResourceType() == ResourceTypeEnum.PNF) {
resource.setCsarUUID((String) topologyTemplate.getMetadataValue(JsonPresentationFields.CSAR_UUID));
resource.setCsarVersion((String) topologyTemplate.getMetadataValue(JsonPresentationFields.CSAR_VERSION));
resource.setImportedToscaChecksum((String) topologyTemplate.getMetadataValue(JsonPresentationFields.IMPORTED_TOSCA_CHECKSUM));
diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/utils/ModelConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/utils/ModelConverterTest.java
index 72f6617e01..f8713c6b78 100644
--- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/utils/ModelConverterTest.java
+++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/utils/ModelConverterTest.java
@@ -35,6 +35,7 @@ import org.mockito.InjectMocks;
import org.mockito.junit.MockitoJUnitRunner;
import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
import org.openecomp.sdc.be.model.Resource;
import org.openecomp.sdc.be.model.Service;
import org.openecomp.sdc.be.model.Component;
@@ -42,6 +43,7 @@ import org.openecomp.sdc.be.model.jsontitan.datamodel.TopologyTemplate;
import org.openecomp.sdc.be.model.jsontitan.datamodel.NodeType;
import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElementTypeEnum;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
@RunWith(MockitoJUnitRunner.class)
@@ -86,6 +88,16 @@ public class ModelConverterTest {
}
@Test
+ public void testConvertFromToscaElementResourceType()
+ {
+ TopologyTemplate topologyTemplate = new TopologyTemplate();
+ topologyTemplate.setComponentType(ComponentTypeEnum.RESOURCE);
+ topologyTemplate.setResourceType(ResourceTypeEnum.PNF);
+ Resource resource = test.convertFromToscaElement(topologyTemplate);
+ assertSame(ResourceTypeEnum.PNF, resource.getResourceType());
+ }
+
+ @Test
public void testIsAtomicComponent()
{
Resource component = new Resource();
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/interfaceoperation/InterfaceOperationsTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/interfaceoperation/InterfaceOperationsTest.java
index 8b2343c6c9..f26f175f9d 100644
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/interfaceoperation/InterfaceOperationsTest.java
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/interfaceoperation/InterfaceOperationsTest.java
@@ -4,9 +4,11 @@ import static org.testng.AssertJUnit.fail;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
-import fj.data.Either;
+
import java.util.HashMap;
import java.util.Map;
+
+import fj.data.Either;
import org.junit.Rule;
import org.junit.rules.TestName;
import org.openecomp.sdc.be.datatypes.elements.ListDataDefinition;
@@ -42,8 +44,11 @@ public class InterfaceOperationsTest extends ComponentBaseTest {
private static Service service;
private static Resource resource;
+ private static Resource pnfResource;
private String resourceInterfaceUniqueId;
private String resourceOperationUniqueId;
+ private String pnfResourceInterfaceUniqueId;
+ private String pnfResourceOperationUniqueId;
private String serviceInterfaceUniqueId;
private String serviceOperationUniqueId;
@@ -68,9 +73,18 @@ public class InterfaceOperationsTest extends ComponentBaseTest {
fail("Error creating default resource");
}
resource = createDefaultResourceEither.left().value();
+
+ // Create default PNF resource
+ Either<Resource, RestResponse> createDefaultPNFResourceEither =
+ AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true);
+ if (createDefaultPNFResourceEither.isRight()) {
+ fail("Error creating default pnf resource");
+ }
+ pnfResource = createDefaultPNFResourceEither.left().value();
}
- private Map<String, Object> buildInterfaceDefinitionForResource() {
+ private Map<String, Object> buildInterfaceDefinitionForResource(String resourceInterfaceUniqueId,
+ String resourceOperationUniqueId) {
Operation operation = new Operation();
operation.setName("TestOperationOnResource");
operation.setWorkflowId("WorkflowId");
@@ -85,10 +99,11 @@ public class InterfaceOperationsTest extends ComponentBaseTest {
ListDataDefinition<OperationOutputDefinition> operationOutputDefinitionList = new ListDataDefinition<>();
operationOutputDefinitionList.add(createOperationOutputDefinition("TestOutput1"));
operation.setOutputs(operationOutputDefinitionList);
- return buildInterfaceDefinitionMap(operation, "TestInterface", resourceInterfaceUniqueId, resourceOperationUniqueId);
+ return buildInterfaceDefinitionMap(operation, "TestInterface", resourceInterfaceUniqueId,
+ resourceOperationUniqueId);
}
- private Map<String, Object> buildInterfaceDefinitionOfGlobalTypeForResource() {
+ private Map<String, Object> buildInterfaceDefinitionOfGlobalTypeForResource(Resource resource) {
Operation operation = new Operation();
operation.setName("create");
operation.setWorkflowId("WorkflowId");
@@ -103,7 +118,8 @@ public class InterfaceOperationsTest extends ComponentBaseTest {
ListDataDefinition<OperationOutputDefinition> operationOutputDefinitionList = new ListDataDefinition<>();
operationOutputDefinitionList.add(createOperationOutputDefinition("TestOutput1"));
operation.setOutputs(operationOutputDefinitionList);
- return buildInterfaceDefinitionMap(operation,"tosca.interfaces.node.lifecycle.Standard", resourceInterfaceUniqueId, resourceOperationUniqueId);
+ return buildInterfaceDefinitionMap(operation, "tosca.interfaces.node.lifecycle.Standard",
+ resourceInterfaceUniqueId, resourceOperationUniqueId);
}
private OperationInputDefinition createOperationInputDefinition(String name, String inputId) {
@@ -123,8 +139,9 @@ public class InterfaceOperationsTest extends ComponentBaseTest {
return operationOutputDefinition;
}
- private Map<String, Object> buildInterfaceDefinitionMap(Operation operation, String interfaceType, String interfaceId,
- String operationId) {
+ private Map<String, Object> buildInterfaceDefinitionMap(Operation operation, String interfaceType,
+ String interfaceId,
+ String operationId) {
if (operationId != null) {
operation.setUniqueId(operationId);
}
@@ -164,14 +181,16 @@ public class InterfaceOperationsTest extends ComponentBaseTest {
operation.setWorkflowId("WorkflowId");
operation.setWorkflowVersionId("workflowVersionId");
operation.setWorkflowAssociationType("NONE");
- return buildInterfaceDefinitionMap(operation,"TestInterface", serviceInterfaceUniqueId, serviceOperationUniqueId);
+ return buildInterfaceDefinitionMap(operation, "TestInterface", serviceInterfaceUniqueId,
+ serviceOperationUniqueId);
}
@Test
public void addInterfaceOperationsOnResource() throws Exception {
RestResponse restResponse = InterfaceOperationsRestUtils
- .addInterfaceOperations(resource, buildInterfaceDefinitionForResource(),
- user);
+ .addInterfaceOperations(resource,
+ buildInterfaceDefinitionForResource(resourceInterfaceUniqueId, resourceOperationUniqueId),
+ user);
logger.info("addInterfaceOperationsOnResource Response Code:" + restResponse.getErrorCode());
Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
String interfaceDefinitionStr = ResponseParser.getListFromJson(restResponse, INTERFACES).get(0).toString();
@@ -184,8 +203,8 @@ public class InterfaceOperationsTest extends ComponentBaseTest {
@Test(dependsOnMethods = "addInterfaceOperationsOnResource")
public void getInterfaceOperationsFromResource() throws Exception {
RestResponse restResponse = InterfaceOperationsRestUtils
- .getInterfaceOperations(resource, resourceInterfaceUniqueId,
- resourceOperationUniqueId, user);
+ .getInterfaceOperations(resource, resourceInterfaceUniqueId,
+ resourceOperationUniqueId, user);
logger.info("getInterfaceOperationsFromResource Response Code:" + restResponse.getErrorCode());
Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
}
@@ -193,26 +212,70 @@ public class InterfaceOperationsTest extends ComponentBaseTest {
@Test(dependsOnMethods = "getInterfaceOperationsFromResource")
public void updateInterfaceOperationsOnResource() throws Exception {
RestResponse restResponse = InterfaceOperationsRestUtils
- .updateInterfaceOperations(resource, buildInterfaceDefinitionForResource(),
- user);
+ .updateInterfaceOperations(resource,
+ buildInterfaceDefinitionForResource(resourceInterfaceUniqueId, resourceOperationUniqueId),
+ user);
logger.info("updateInterfaceOperationsOnResource Response Code:" + restResponse.getErrorCode());
Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
}
- /*@Test(dependsOnMethods = "updateInterfaceOperationsOnResource")
+ @Test(dependsOnMethods = "updateInterfaceOperationsOnResource")
public void deleteInterfaceOperationsFromResource() throws Exception {
RestResponse restResponse = InterfaceOperationsRestUtils
- .deleteInterfaceOperations(resource, resourceInterfaceUniqueId,
- resourceOperationUniqueId, user);
+ .deleteInterfaceOperations(resource, resourceInterfaceUniqueId,
+ resourceOperationUniqueId, user);
logger.info("deleteInterfaceOperationsFromResource Response Code:" + restResponse.getErrorCode());
Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }*/
+ }
+
+ @Test
+ public void addInterfaceOperationsOnPNFResource() throws Exception {
+ RestResponse restResponse = InterfaceOperationsRestUtils
+ .addInterfaceOperations(pnfResource, buildInterfaceDefinitionForResource(pnfResourceInterfaceUniqueId,
+ pnfResourceOperationUniqueId), user);
+ logger.info("addInterfaceOperationsOnPNFResource Response Code:" + restResponse.getErrorCode());
+ Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
+ String interfaceDefinitionStr = ResponseParser.getListFromJson(restResponse, INTERFACES).get(0).toString();
+ InterfaceDefinition interfaceDefinition =
+ ResponseParser.convertInterfaceDefinitionResponseToJavaObject(interfaceDefinitionStr);
+ pnfResourceInterfaceUniqueId = interfaceDefinition.getUniqueId();
+ pnfResourceOperationUniqueId =
+ interfaceDefinition.getOperationsMap().keySet().stream().findFirst().orElse(null);
+ }
+
+ @Test(dependsOnMethods = "addInterfaceOperationsOnPNFResource")
+ public void getInterfaceOperationsFromPNFResource() throws Exception {
+ RestResponse restResponse = InterfaceOperationsRestUtils
+ .getInterfaceOperations(pnfResource, pnfResourceInterfaceUniqueId,
+ pnfResourceOperationUniqueId, user);
+ logger.info("getInterfaceOperationsFromPNFResource Response Code:" + restResponse.getErrorCode());
+ Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
+ }
+
+ @Test(dependsOnMethods = "getInterfaceOperationsFromPNFResource")
+ public void updateInterfaceOperationsOnPNFResource() throws Exception {
+ RestResponse restResponse = InterfaceOperationsRestUtils
+ .updateInterfaceOperations(pnfResource,
+ buildInterfaceDefinitionForResource(pnfResourceInterfaceUniqueId,
+ pnfResourceOperationUniqueId), user);
+ logger.info("updateInterfaceOperationsOnPNFResource Response Code:" + restResponse.getErrorCode());
+ Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
+ }
+
+ @Test(dependsOnMethods = "updateInterfaceOperationsOnPNFResource")
+ public void deleteInterfaceOperationsFromPNFResource() throws Exception {
+ RestResponse restResponse = InterfaceOperationsRestUtils
+ .deleteInterfaceOperations(pnfResource, pnfResourceInterfaceUniqueId,
+ pnfResourceOperationUniqueId, user);
+ logger.info("deleteInterfaceOperationsFromPNFResource Response Code:" + restResponse.getErrorCode());
+ Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
+ }
@Test
public void addInterfaceOperationsOnService() throws Exception {
RestResponse restResponse = InterfaceOperationsRestUtils
- .addInterfaceOperations(service, buildInterfaceDefinitionForService(),
- user);
+ .addInterfaceOperations(service, buildInterfaceDefinitionForService(),
+ user);
logger.info("addInterfaceOperationsOnService Response Code:" + restResponse.getErrorCode());
Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
String interfaceDefinitionStr = ResponseParser.getListFromJson(restResponse, INTERFACES).get(0).toString();
@@ -225,8 +288,8 @@ public class InterfaceOperationsTest extends ComponentBaseTest {
@Test(dependsOnMethods = "addInterfaceOperationsOnService")
public void getInterfaceOperationsFromService() throws Exception {
RestResponse restResponse = InterfaceOperationsRestUtils
- .getInterfaceOperations(service, serviceInterfaceUniqueId,
- serviceOperationUniqueId, user);
+ .getInterfaceOperations(service, serviceInterfaceUniqueId,
+ serviceOperationUniqueId, user);
logger.info("getInterfaceOperationsFromService Response Code:" + restResponse.getErrorCode());
Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
}
@@ -234,8 +297,8 @@ public class InterfaceOperationsTest extends ComponentBaseTest {
@Test(dependsOnMethods = "getInterfaceOperationsFromService")
public void updateInterfaceOperationsOnService() throws Exception {
RestResponse restResponse = InterfaceOperationsRestUtils
- .updateInterfaceOperations(service, buildInterfaceDefinitionForService(),
- user);
+ .updateInterfaceOperations(service, buildInterfaceDefinitionForService(),
+ user);
logger.info("updateInterfaceOperations Response Code:" + restResponse.getErrorCode());
Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
}
@@ -243,17 +306,18 @@ public class InterfaceOperationsTest extends ComponentBaseTest {
@Test(dependsOnMethods = "updateInterfaceOperationsOnService")
public void deleteInterfaceOperationsFromService() throws Exception {
RestResponse restResponse = InterfaceOperationsRestUtils
- .deleteInterfaceOperations(service, serviceInterfaceUniqueId,
- serviceOperationUniqueId, user);
+ .deleteInterfaceOperations(service, serviceInterfaceUniqueId,
+ serviceOperationUniqueId, user);
logger.info("deleteInterfaceOperations Response Code:" + restResponse.getErrorCode());
Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
}
@Test
public void addInterfaceOperationsOfGlobalTypeOnResource() throws Exception {
- RestResponse restResponse = InterfaceOperationsRestUtils
- .addInterfaceOperations(resource, buildInterfaceDefinitionOfGlobalTypeForResource(),
- user);
+ RestResponse restResponse =
+ InterfaceOperationsRestUtils.addInterfaceOperations(resource,
+ buildInterfaceDefinitionOfGlobalTypeForResource(resource), user);
+
logger.info("addInterfaceOperationsOnResource Response Code:" + restResponse.getErrorCode());
Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
String interfaceDefinitionStr = ResponseParser.getListFromJson(restResponse, INTERFACES).get(0).toString();
@@ -261,4 +325,17 @@ public class InterfaceOperationsTest extends ComponentBaseTest {
ResponseParser.convertInterfaceDefinitionResponseToJavaObject(interfaceDefinitionStr);
}
+ @Test
+ public void addInterfaceOperationsOfGlobalTypeOnPNFResource() throws Exception {
+ RestResponse restResponse =
+ InterfaceOperationsRestUtils.addInterfaceOperations(pnfResource,
+ buildInterfaceDefinitionOfGlobalTypeForResource(pnfResource), user);
+
+ logger.info("addInterfaceOperationsOnPNFResource Response Code:" + restResponse.getErrorCode());
+ Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
+ String interfaceDefinitionStr = ResponseParser.getListFromJson(restResponse, INTERFACES).get(0).toString();
+ InterfaceDefinition interfaceDefinition =
+ ResponseParser.convertInterfaceDefinitionResponseToJavaObject(interfaceDefinitionStr);
+ }
+
}
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/resource.xml b/test-apis-ci/src/main/resources/ci/testSuites/resource.xml
index 05080b25ac..313fbb26db 100644
--- a/test-apis-ci/src/main/resources/ci/testSuites/resource.xml
+++ b/test-apis-ci/src/main/resources/ci/testSuites/resource.xml
@@ -354,15 +354,20 @@
<include name="undoCheckOutProductByPm"/>
</methods>
</class>
- <class name="org.openecomp.sdc.ci.tests.execute.interfaceoperation.InterfaceOperationsTest">
- <methods>
- <include name="addInterfaceOperationsOfGlobalTypeOnResource"/>
- <include name="addInterfaceOperationsOnResource"/>
- <include name="getInterfaceOperationsFromResource"/>
- <include name="updateInterfaceOperationsOnResource"/>
- <include name="deleteInterfaceOperationsFromResource"/>
- </methods>
- </class>
+ <class name="org.openecomp.sdc.ci.tests.execute.interfaceoperation.InterfaceOperationsTest">
+ <methods>
+ <include name="addInterfaceOperationsOfGlobalTypeOnResource"/>
+ <include name="addInterfaceOperationsOnResource"/>
+ <include name="getInterfaceOperationsFromResource"/>
+ <include name="updateInterfaceOperationsOnResource"/>
+ <include name="deleteInterfaceOperationsFromResource"/>
+ <include name="addInterfaceOperationsOfGlobalTypeOnPNFResource"/>
+ <include name="addInterfaceOperationsOnPNFResource"/>
+ <include name="getInterfaceOperationsFromPNFResource"/>
+ <include name="updateInterfaceOperationsOnPNFResource"/>
+ <include name="deleteInterfaceOperationsFromPNFResource"/>
+ </methods>
+ </class>
<!-- Product tests end-->
</classes>
</test> <!-- Test -->