import org.openecomp.sdc.be.model.ArtifactDefinition;
import org.openecomp.sdc.be.model.ArtifactUiDownloadData;
import org.openecomp.sdc.be.model.Operation;
+import org.openecomp.sdc.be.resources.data.auditing.model.ResourceCommonInfo;
import org.openecomp.sdc.common.api.Constants;
import org.openecomp.sdc.common.log.wrappers.Logger;
import org.openecomp.sdc.exception.ResponseFormat;
}
+ @POST
+ @Path("/{assetType}/{uuid}/interfaces/{interfaceUUID}/operations/{operationUUID}/artifacts/{artifactUUID}")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiOperation(value = "uploads of artifact to component operation workflow", httpMethod = "POST", notes = "uploads of artifact to component operation workflow")
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Artifact uploaded", response = ArtifactDefinition.class),
+ @ApiResponse(code = 404, message = "Specified resource is not found - SVC4063"),
+ @ApiResponse(code = 400, message = "Invalid artifactType was defined as input - SVC4122"),
+ @ApiResponse(code = 400, message = "Artifact type (mandatory field) is missing in request - SVC4124"),
+ @ApiResponse(code = 400, message = "Artifact name given in input already exists in the context of the asset - SVC4125"),
+ @ApiResponse(code = 400, message = "Artifact name is missing in input - SVC4128"),
+ @ApiResponse(code = 400, message = "Asset is being edited by different user. Only one user can checkout and edit an asset on given time. The asset will be available for checkout after the other user will checkin the asset - SVC4086"),
+ @ApiResponse(code = 400, message = "Restricted Operation – the user provided does not have role of Designer or the asset is being used by another designer - SVC4301")})
+ @ApiImplicitParams({@ApiImplicitParam(required = true, dataType = "org.openecomp.sdc.be.model.ArtifactDefinition", paramType = "body", value = "json describe the artifact")})
+ public Response uploadInterfaceOperationArtifact(
+ @ApiParam(value = "Asset type") @PathParam("assetType") String assetType,
+ @ApiParam(value = "The uuid of the asset as published in the metadata", required = true)@PathParam("uuid") final String uuid,
+ @ApiParam(value = "The uuid of the interface", required = true)@PathParam("interfaceUUID") final String interfaceUUID,
+ @ApiParam(value = "The uuid of the operation", required = true)@PathParam("operationUUID") final String operationUUID,
+ @ApiParam(value = "The uuid of the artifact", required = true)@PathParam("artifactUUID") final String artifactUUID,
+ @ApiParam( hidden = true) String data,
+ @HeaderParam(value = Constants.USER_ID_HEADER) String userId,
+ @HeaderParam(value = Constants.MD5_HEADER) String origMd5,
+ @Context final HttpServletRequest request) {
+
+ String url = request.getMethod() + " " + request.getRequestURI();
+ log.debug("Start handle request of {}" , url);
+
+ try {
+ ServletContext context = request.getSession().getServletContext();
+ ArtifactsBusinessLogic artifactsLogic = getArtifactBL(context);
+ Either<ArtifactDefinition, ResponseFormat> uploadArtifactEither =
+ artifactsLogic.updateArtifactOnInterfaceOperationByResourceUUID(data, request,
+ ComponentTypeEnum.findByParamName(assetType), uuid, interfaceUUID, operationUUID, artifactUUID,
+ new ResourceCommonInfo(assetType), artifactsLogic.new ArtifactOperationInfo(true,
+ false, ArtifactOperationEnum.UPDATE));
+ if (uploadArtifactEither.isRight()) {
+ log.debug("failed to update artifact");
+ return buildErrorResponse(uploadArtifactEither.right().value());
+ }
+ return buildOkResponse(getComponentsUtils().getResponseFormat(ActionStatus.OK), uploadArtifactEither.left().value());
+ }
+ catch (Exception e) {
+ final String message = "failed to update artifact on a resource or service";
+ BeEcompErrorManager.getInstance().logBeRestApiGeneralError(message);
+ log.debug(message, e);
+ return buildErrorResponse(getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR));
+ }
+ }
+
// ////////// API END ///////////////////////////
// ************ private *********************
import org.junit.Rule;
import org.junit.rules.TestName;
import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
import org.openecomp.sdc.be.model.*;
import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.execute.interfaceoperation.InterfaceOperationsTest;
import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
import org.openecomp.sdc.ci.tests.utils.rest.*;
public class ArtifactServletTest extends ComponentBaseTest {
+ private static final String ARTIFACT_NAME_STR = "artifactName";
+ private static final String ARTIFACT_TYPE_STR = "artifactType";
+ private static final String ARTIFACT_DESCRIPTION_STR = "description";
+ private static final String ARTIFACT_PAYLOAD_DATA_STR = "payloadData";
private static Logger log = LoggerFactory.getLogger(ArtifactServletTest.class.getName());
protected static final String UPLOAD_ARTIFACT_PAYLOAD = "UHVUVFktVXNlci1LZXktRmlsZS0yOiBzc2gtcnNhDQpFbmNyeXB0aW9uOiBhZXMyNTYtY2JjDQpDb21tZW5wOA0K";
protected static final String UPLOAD_ARTIFACT_NAME = "TLV_prv.ppk";
protected String serviceVersion;
protected Resource resourceDetailsVFCcomp;
protected Service defaultService1;
+ protected Resource resource;
+ protected Resource pnfResource;
protected User sdncUserDetails;
Either<Service, RestResponse> defaultService1e = AtomicOperationUtils
.createDefaultService(UserRoleEnum.DESIGNER, true);
defaultService1 = defaultService1e.left().value();
+
+ Either<Resource, RestResponse> createDefaultResourceEither =
+ AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true);
+ resource = createDefaultResourceEither.left().value();
+
+ Either<Resource, RestResponse> createDefaultPNFResourceEither =
+ AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true);
+ pnfResource = createDefaultPNFResourceEither.left().value();
}
@Test
String artifactId = getLifecycleArtifactUid(response);
Map<String, Object> jsonBody = new HashMap<String, Object>();
- jsonBody.put("artifactName", "TLV_prv.ppk");
+ jsonBody.put(ARTIFACT_NAME_STR, "TLV_prv.ppk");
jsonBody.put("artifactDisplayName", "configure");
- jsonBody.put("artifactType", "SHELL");
+ jsonBody.put(ARTIFACT_TYPE_STR, "SHELL");
jsonBody.put("mandatory", "false");
String newDescription = "new something";
- jsonBody.put("description", newDescription);
+ jsonBody.put(ARTIFACT_DESCRIPTION_STR, newDescription);
jsonBody.put("artifactLabel", "configure");
userBodyJson = gson.toJson(jsonBody);
responseMap = (JSONObject) responseMap.get("operations");
responseMap = (JSONObject) responseMap.get(operationName.toLowerCase());
responseMap = (JSONObject) responseMap.get("implementation");
- String description = (String) responseMap.get("description");
+ String description = (String) responseMap.get(ARTIFACT_DESCRIPTION_STR);
AssertJUnit.assertEquals("the new description value was not set", newDescription, description);
protected String createUploadArtifactBodyJson() {
Map<String, Object> jsonBody = new HashMap<String, Object>();
- jsonBody.put("artifactName", UPLOAD_ARTIFACT_NAME);
+ jsonBody.put(ARTIFACT_NAME_STR, UPLOAD_ARTIFACT_NAME);
jsonBody.put("artifactDisplayName", "configure");
- jsonBody.put("artifactType", "SHELL");
+ jsonBody.put(ARTIFACT_TYPE_STR, "SHELL");
jsonBody.put("mandatory", "false");
- jsonBody.put("description", "ff");
- jsonBody.put("payloadData", UPLOAD_ARTIFACT_PAYLOAD);
+ jsonBody.put(ARTIFACT_DESCRIPTION_STR, "ff");
+ jsonBody.put(ARTIFACT_PAYLOAD_DATA_STR, UPLOAD_ARTIFACT_PAYLOAD);
jsonBody.put("artifactLabel", "configure");
return gson.toJson(jsonBody);
}
protected String createLoadArtifactBody() {
Map<String, Object> json = new HashMap<String, Object>();
- json.put("artifactName", "install_apache2.sh");
- json.put("artifactType", "SHELL");
- json.put("description", "ddd");
- json.put("payloadData", "UEsDBAoAAAAIAAeLb0bDQz");
+ json.put(ARTIFACT_NAME_STR, "install_apache2.sh");
+ json.put(ARTIFACT_TYPE_STR, "SHELL");
+ json.put(ARTIFACT_DESCRIPTION_STR, "ddd");
+ json.put(ARTIFACT_PAYLOAD_DATA_STR, "UEsDBAoAAAAIAAeLb0bDQz");
json.put("artifactLabel", "name123");
String jsonStr = gson.toJson(json);
CloseableHttpClient httpclient = HttpClients.createDefault();
try {
Map<String, Object> json = new HashMap<String, Object>();
- json.put("description", "desc");
- json.put("payloadData", "UEsDBAoAAAAIAAeLb0bDQz");
+ json.put(ARTIFACT_DESCRIPTION_STR, "desc");
+ json.put(ARTIFACT_PAYLOAD_DATA_STR, "UEsDBAoAAAAIAAeLb0bDQz");
json.put("Content-MD5", "YTg2Mjg4MWJhNmI5NzBiNzdDFkMWI=");
String jsonBody = gson.toJson(json);
CloseableHttpClient httpclient = HttpClients.createDefault();
try {
HashMap<String, Object> json = new HashMap<String, Object>();
- json.put("artifactName", "install_apache.sh");
- json.put("artifactType", "SHELL");
- json.put("description", "kjglkh");
- json.put("payloadData", "UEsDBYTEIWUYIFHWFMABCNAoAAAAIAAeLb0bDQz");
+ json.put(ARTIFACT_NAME_STR, "install_apache.sh");
+ json.put(ARTIFACT_TYPE_STR, "SHELL");
+ json.put(ARTIFACT_DESCRIPTION_STR, "kjglkh");
+ json.put(ARTIFACT_PAYLOAD_DATA_STR, "UEsDBYTEIWUYIFHWFMABCNAoAAAAIAAeLb0bDQz");
json.put("artifactLabel", "name123");
String url = String.format(Urls.ADD_ARTIFACT_TO_RESOURCE, config.getCatalogBeHost(),
config.getCatalogBePort(), resourceDetailsVFCcomp.getUniqueId());
CloseableHttpClient httpclient = HttpClients.createDefault();
try {
Map<String, Object> json = new HashMap<String, Object>();
- json.put("artifactName", "install_apache.sh");
- json.put("artifactType", "SHELL11");
- json.put("description", "fff");
- json.put("payloadData", "UEsDBAoAAAAIAAeLb0bDQz");
+ json.put(ARTIFACT_NAME_STR, "install_apache.sh");
+ json.put(ARTIFACT_TYPE_STR, "SHELL11");
+ json.put(ARTIFACT_DESCRIPTION_STR, "fff");
+ json.put(ARTIFACT_PAYLOAD_DATA_STR, "UEsDBAoAAAAIAAeLb0bDQz");
json.put("artifactLabel", "name123");
String jsonStr = gson.toJson(json);
}
AssertJUnit.assertTrue(isExist);
}
+
+ @Test
+ public void addInterfaceOperationArtifactOnResource() throws Exception {
+ try (CloseableHttpClient httpclient = HttpClients.createDefault()){
+ Map<String, Object> artifactData = new HashMap<>();
+ artifactData.put(ARTIFACT_NAME_STR, "TestWF-1_0.bpmn");
+ artifactData.put(ARTIFACT_TYPE_STR, "WORKFLOW");
+ artifactData.put(ARTIFACT_DESCRIPTION_STR, "Resource Workflow Artifact Description");
+ artifactData.put(ARTIFACT_PAYLOAD_DATA_STR, "Test Data of Resource");
+
+ String jsonStr = gson.toJson(artifactData);
+ RestResponse restResponse = InterfaceOperationsRestUtils.addInterfaceOperations(resource,
+ new InterfaceOperationsTest().buildInterfaceDefinitionForResource(resource,
+ null, null),
+ ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+ String interfaceDefStr = ResponseParser.getListFromJson(restResponse, "interfaces").get(0).toString();
+ InterfaceDefinition interfaceDefinition = ResponseParser.convertInterfaceDefinitionResponseToJavaObject(interfaceDefStr);
+ String interfaceUUID = interfaceDefinition.getUniqueId();
+ String operationUUID = interfaceDefinition.getOperationsMap().keySet().stream().findFirst().orElse(null);
+ String artifactUUID = interfaceDefinition.getOperationsMap().values().stream().findFirst().get().getImplementation().getArtifactUUID();
+
+ String url = String.format(Urls.UPLOAD_INTERFACE_OPERATION_ARTIFACT, config.getCatalogBeHost(),
+ config.getCatalogBePort(), ComponentTypeEnum.findParamByType(resource.getComponentType()),
+ resource.getUUID(), interfaceUUID, operationUUID, artifactUUID);
+ CloseableHttpResponse result = httpclient.execute(createPostAddArtifactRequeast(jsonStr, url, true));
+ int status = result.getStatusLine().getStatusCode();
+ AssertJUnit.assertEquals("add informational artifact request returned status: " + status, 200, status);
+ }
+ }
+
+ @Test
+ public void addInterfaceOperationArtifactOnPNFResource() throws Exception {
+ try (CloseableHttpClient httpclient = HttpClients.createDefault()){
+ Map<String, Object> artifactData = new HashMap<>();
+ artifactData.put(ARTIFACT_NAME_STR, "TestWF-1_0.bpmn");
+ artifactData.put(ARTIFACT_TYPE_STR, "WORKFLOW");
+ artifactData.put(ARTIFACT_DESCRIPTION_STR, "PNF Resource Workflow Artifact Description");
+ artifactData.put(ARTIFACT_PAYLOAD_DATA_STR, "Test Data of PNF Resource");
+
+ String jsonStr = gson.toJson(artifactData);
+ RestResponse restResponse = InterfaceOperationsRestUtils.addInterfaceOperations(pnfResource,
+ new InterfaceOperationsTest().buildInterfaceDefinitionForResource(pnfResource,
+ null, null),
+ ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+ String interfaceDefStr = ResponseParser.getListFromJson(restResponse, "interfaces").get(0).toString();
+ InterfaceDefinition interfaceDefinition = ResponseParser.convertInterfaceDefinitionResponseToJavaObject(interfaceDefStr);
+ String interfaceUUID = interfaceDefinition.getUniqueId();
+ String operationUUID = interfaceDefinition.getOperationsMap().keySet().stream().findFirst().orElse(null);
+ String artifactUUID = interfaceDefinition.getOperationsMap().values().stream().findFirst().get().getImplementation().getArtifactUUID();
+
+ String url = String.format(Urls.UPLOAD_INTERFACE_OPERATION_ARTIFACT, config.getCatalogBeHost(),
+ config.getCatalogBePort(), ComponentTypeEnum.findParamByType(pnfResource.getComponentType()),
+ pnfResource.getUUID(), interfaceUUID, operationUUID, artifactUUID);
+ CloseableHttpResponse result = httpclient.execute(createPostAddArtifactRequeast(jsonStr, url, true));
+ int status = result.getStatusLine().getStatusCode();
+ AssertJUnit.assertEquals("add informational artifact request returned status: " + status, 200, status);
+ }
+ }
+
+ @Test
+ public void addInterfaceOperationArtifactOnService() throws Exception {
+ try (CloseableHttpClient httpclient = HttpClients.createDefault()){
+ Map<String, Object> artifactData = new HashMap<>();
+ artifactData.put(ARTIFACT_NAME_STR, "TestWF-1_0.bpmn");
+ artifactData.put(ARTIFACT_TYPE_STR, "WORKFLOW");
+ artifactData.put(ARTIFACT_DESCRIPTION_STR, "Service Workflow Artifact Description");
+ artifactData.put(ARTIFACT_PAYLOAD_DATA_STR, "Test Data of Service");
+
+ String jsonStr = gson.toJson(artifactData);
+ RestResponse restResponse = InterfaceOperationsRestUtils.addInterfaceOperations(defaultService1,
+ new InterfaceOperationsTest().buildInterfaceDefinitionForService(),
+ ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+ String interfaceDefinitionStr = ResponseParser.getListFromJson(restResponse, "interfaces").get(0).toString();
+ InterfaceDefinition interfaceDefinition = ResponseParser.convertInterfaceDefinitionResponseToJavaObject(interfaceDefinitionStr);
+ String interfaceUUID = interfaceDefinition.getUniqueId();
+ String operationUUID = interfaceDefinition.getOperationsMap().keySet().stream().findFirst().orElse(null);
+ String artifactUUID = interfaceDefinition.getOperationsMap().values().stream().findFirst().get().getImplementation().getArtifactUUID();
+
+ String url = String.format(Urls.UPLOAD_INTERFACE_OPERATION_ARTIFACT, config.getCatalogBeHost(),
+ config.getCatalogBePort(), ComponentTypeEnum.findParamByType(defaultService1.getComponentType()),
+ defaultService1.getUUID(), interfaceUUID, operationUUID, artifactUUID);
+ CloseableHttpResponse result = httpclient.execute(createPostAddArtifactRequeast(jsonStr, url, true));
+ int status = result.getStatusLine().getStatusCode();
+ AssertJUnit.assertEquals("add informational artifact request returned status: " + status, 200, status);
+ }
+ }
+
}
import java.util.Map;
import fj.data.Either;
+import org.apache.commons.collections4.CollectionUtils;
import org.junit.Rule;
import org.junit.rules.TestName;
import org.openecomp.sdc.be.datatypes.elements.ListDataDefinition;
private static final String INTERFACES = "interfaces";
private static final String TOSCA_PRESENTATION = "toscaPresentation";
private static final User user = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+ private static final String WORKFLOW_ID_STR = "WorkflowId";
+ private static final String WORKFLOW_VERSION_ID_STR = "workflowVersionId";
+ private static final String WORKFLOW_ASSOCIATION_TYPE_NONE_STR = "NONE";
private static Service service;
private static Resource resource;
// Create default PNF resource
Either<Resource, RestResponse> createDefaultPNFResourceEither =
- AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true);
+ AtomicOperationUtils.createResourceByType(ResourceTypeEnum.PNF, UserRoleEnum.DESIGNER, true);
if (createDefaultPNFResourceEither.isRight()) {
fail("Error creating default pnf resource");
}
pnfResource = createDefaultPNFResourceEither.left().value();
}
- private Map<String, Object> buildInterfaceDefinitionForResource(String resourceInterfaceUniqueId,
+ public Map<String, Object> buildInterfaceDefinitionForResource(Resource resource,
+ String resourceInterfaceUniqueId,
String resourceOperationUniqueId) {
Operation operation = new Operation();
operation.setName("TestOperationOnResource");
- operation.setWorkflowId("WorkflowId");
- operation.setWorkflowVersionId("workflowVersionId");
- operation.setWorkflowAssociationType("NONE");
- PropertyDefinition property =
- resource.getInputs().stream().filter(a -> a.getName().equalsIgnoreCase("nf_naming")).findFirst()
- .orElse(new InputDefinition());
- ListDataDefinition<OperationInputDefinition> operationInputDefinitionList = new ListDataDefinition<>();
- operationInputDefinitionList.add(createOperationInputDefinition("TestInput1", property.getUniqueId()));
- operation.setInputs(operationInputDefinitionList);
+ operation.setWorkflowId(WORKFLOW_ID_STR);
+ operation.setWorkflowVersionId(WORKFLOW_VERSION_ID_STR);
+ operation.setWorkflowAssociationType(WORKFLOW_ASSOCIATION_TYPE_NONE_STR);
+ if(CollectionUtils.isNotEmpty(resource.getInputs())){
+ PropertyDefinition property =
+ resource.getInputs().stream().filter(a -> a.getName().equalsIgnoreCase("nf_naming")).findFirst()
+ .orElse(new InputDefinition());
+ ListDataDefinition<OperationInputDefinition> operationInputDefinitionList = new ListDataDefinition<>();
+ operationInputDefinitionList.add(createOperationInputDefinition("TestInput1", property.getUniqueId()));
+ operation.setInputs(operationInputDefinitionList);
+ }
ListDataDefinition<OperationOutputDefinition> operationOutputDefinitionList = new ListDataDefinition<>();
operationOutputDefinitionList.add(createOperationOutputDefinition("TestOutput1"));
operation.setOutputs(operationOutputDefinitionList);
private Map<String, Object> buildInterfaceDefinitionOfGlobalTypeForResource(Resource resource) {
Operation operation = new Operation();
operation.setName("create");
- operation.setWorkflowId("WorkflowId");
- operation.setWorkflowVersionId("workflowVersionId");
+ operation.setWorkflowId(WORKFLOW_ID_STR);
+ operation.setWorkflowVersionId(WORKFLOW_VERSION_ID_STR);
operation.setWorkflowAssociationType("NONE");
- PropertyDefinition property =
- resource.getInputs().stream().filter(a -> a.getName().equalsIgnoreCase("nf_naming")).findFirst()
- .orElse(new InputDefinition());
- ListDataDefinition<OperationInputDefinition> operationInputDefinitionList = new ListDataDefinition<>();
- operationInputDefinitionList.add(createOperationInputDefinition("TestInput1", property.getUniqueId()));
- operation.setInputs(operationInputDefinitionList);
+ if(CollectionUtils.isNotEmpty(resource.getInputs())){
+ PropertyDefinition property =
+ resource.getInputs().stream().filter(a -> a.getName().equalsIgnoreCase("nf_naming")).findFirst()
+ .orElse(new InputDefinition());
+ ListDataDefinition<OperationInputDefinition> operationInputDefinitionList = new ListDataDefinition<>();
+ operationInputDefinitionList.add(createOperationInputDefinition("TestInput1", property.getUniqueId()));
+ operation.setInputs(operationInputDefinitionList);
+ }
ListDataDefinition<OperationOutputDefinition> operationOutputDefinitionList = new ListDataDefinition<>();
operationOutputDefinitionList.add(createOperationOutputDefinition("TestOutput1"));
operation.setOutputs(operationOutputDefinitionList);
return objectAsMap;
}
- private Map<String, Object> buildInterfaceDefinitionForService() {
+ public Map<String, Object> buildInterfaceDefinitionForService() {
Operation operation = new Operation();
operation.setName("TestOperationOnService");
- operation.setWorkflowId("WorkflowId");
- operation.setWorkflowVersionId("workflowVersionId");
+ operation.setWorkflowId(WORKFLOW_ID_STR);
+ operation.setWorkflowVersionId(WORKFLOW_VERSION_ID_STR);
operation.setWorkflowAssociationType("NONE");
return buildInterfaceDefinitionMap(operation, "TestInterface", serviceInterfaceUniqueId,
serviceOperationUniqueId);
public void addInterfaceOperationsOnResource() throws Exception {
RestResponse restResponse = InterfaceOperationsRestUtils
.addInterfaceOperations(resource,
- buildInterfaceDefinitionForResource(resourceInterfaceUniqueId, resourceOperationUniqueId),
- user);
+ buildInterfaceDefinitionForResource(resource, 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();
public void updateInterfaceOperationsOnResource() throws Exception {
RestResponse restResponse = InterfaceOperationsRestUtils
.updateInterfaceOperations(resource,
- buildInterfaceDefinitionForResource(resourceInterfaceUniqueId, resourceOperationUniqueId),
+ buildInterfaceDefinitionForResource(resource, resourceInterfaceUniqueId, resourceOperationUniqueId),
user);
logger.info("updateInterfaceOperationsOnResource 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,
+ .addInterfaceOperations(pnfResource, buildInterfaceDefinitionForResource(pnfResource, pnfResourceInterfaceUniqueId,
pnfResourceOperationUniqueId), user);
logger.info("addInterfaceOperationsOnPNFResource Response Code:" + restResponse.getErrorCode());
Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
public void updateInterfaceOperationsOnPNFResource() throws Exception {
RestResponse restResponse = InterfaceOperationsRestUtils
.updateInterfaceOperations(pnfResource,
- buildInterfaceDefinitionForResource(pnfResourceInterfaceUniqueId,
+ buildInterfaceDefinitionForResource(pnfResource, pnfResourceInterfaceUniqueId,
pnfResourceOperationUniqueId), user);
logger.info("updateInterfaceOperationsOnPNFResource Response Code:" + restResponse.getErrorCode());
Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
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();
- InterfaceDefinition interfaceDefinition =
- ResponseParser.convertInterfaceDefinitionResponseToJavaObject(interfaceDefinitionStr);
}
@Test