+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
package org.openecomp.mso.bpmn.infrastructure;
import static org.junit.Assert.assertEquals;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutServiceInstance;
import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockGetServiceResourcesCatalogData;
import java.io.IOException;
import java.util.HashMap;
import org.camunda.bpm.engine.test.Deployment;
import org.junit.Assert;
+import org.junit.Ignore;
import org.junit.Test;
import org.openecomp.mso.bpmn.common.BPMNUtil;
import org.openecomp.mso.bpmn.common.WorkflowTest;
+import org.openecomp.mso.bpmn.mock.FileUtil;
/**
* Unit test cases for DoCreateServiceInstance.bpmn
" <svc-request-id>((REQUEST-ID))</svc-request-id>" + EOL +
" <ack-final-indicator>Y</ack-final-indicator>" + EOL +
"</output>" + EOL;
-
+ private final String input = FileUtil.readResourceFile("__files/CreateServiceInstance/DoCreateServiceInstanceInput.json");
+
+
public DoCreateServiceInstanceTest() throws IOException {
callbacks.put("assign", sdncAdapterCallback);
}
*
* @throws Exception
*/
- //@Ignore // File not found - unable to run the test. Also, Stubs need updating..
@Test
+ @Ignore // 1802 merge
@Deployment(resources = {
"subprocess/DoCreateServiceInstance.bpmn",
"subprocess/SDNCAdapterV1.bpmn",
mockSDNCAdapter(200);
//DB
mockUpdateRequestDB(200, "DBUpdateResponse.xml");
+ //Catalog DB
+ MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef","InfrastructureFlows/DoCreateServiceInstance_request.json");
+
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
setupVariables(variables);
invokeSubProcess("DoCreateServiceInstance", businessKey, variables);
injectSDNCCallbacks(callbacks, "assign");
variables.put("isDebugLogEnabled", "true");
variables.put("msoRequestId", "RaaDSITestRequestId-1");
variables.put("serviceInstanceId","RaaTest-si-id");
- variables.put("serviceModelInfo", "{\"modelType\":\"service\",\"modelInvariantUuid\":\"uuid-miu-svc-011-abcdef\",\"modelVersionUuid\":\"ASDC_TOSCA_UUID\",\"modelName\":\"SIModelName1\",\"modelVersion\":\"2\"}");
+ variables.put("serviceModelInfo", "{\"modelType\":\"service\",\"modelInvariantUuid\":\"uuid-miu-svc-011-abcdef\",\"modelVersionUuid\":\"ASDC_TOSCA_UUID\",\"modelName\":\"SIModelName1\",\"modelVersion\":\"2\",\"projectName\":\"proj123\",\"owningEntityId\":\"id123\",\"owningEntityName\":\"name123\"}");
variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
variables.put("globalSubscriberId", "MCBH-1610");
variables.put("subscriptionServiceType", "viprsvc");
variables.put("instanceName", "RAATest-1");
+ variables.put("serviceInstanceName", "RAT-123");
+ variables.put("sdncVersion", "1611");
+ variables.put("serviceType", "PORT-MIRROR");
+ variables.put("requestJson", input);
}
}
\ No newline at end of file