Replaced all tabs with spaces in java and pom.xml
[so.git] / bpmn / mso-infrastructure-bpmn / src / test / java / org / onap / so / bpmn / common / ConfirmVolumeGroupNameIT.java
index cc3ca94..ad0428c 100644 (file)
  * See the License for the specific language governing permissions and 
  * limitations under the License. 
  * ============LICENSE_END========================================================= 
- */ 
+ */
 
 package org.onap.so.bpmn.common;
 
 import static org.junit.Assert.assertEquals;
 import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetVolumeGroupById;
-
 import java.util.HashMap;
 import java.util.Map;
 import java.util.UUID;
-
 import org.camunda.bpm.engine.RuntimeService;
 import org.camunda.bpm.engine.test.Deployment;
 import org.junit.Ignore;
@@ -38,79 +36,83 @@ import org.onap.so.BaseIntegrationTest;
  */
 
 public class ConfirmVolumeGroupNameIT extends BaseIntegrationTest {
-       /**
-        * Sunny day scenario.
-        * 
-        * @throws Exception
-        */
-       @Test   
-       public void sunnyDay() throws Exception {
-               logStart();
-               MockGetVolumeGroupById(wireMockServer, "MDTWNJ21", "VOLUME_GROUP_ID_1", "aai-volume-group-id-info.xml");                
-               
-               Map<String, Object> variables = new HashMap<>();
-               variables.put("isDebugLogEnabled","true");
-               variables.put("ConfirmVolumeGroupName_volumeGroupId", "VOLUME_GROUP_ID_1");
-               variables.put("ConfirmVolumeGroupName_volumeGroupName", "VOLUME_GROUP_ID_1_NAME");
-               variables.put("ConfirmVolumeGroupName_aicCloudRegion", "MDTWNJ21");
-               variables.put("mso-request-id", UUID.randomUUID().toString());
-               String processId = invokeSubProcess("ConfirmVolumeGroupName", variables);
-               String responseCode = BPMNUtil.getVariable(processEngine, "ConfirmVolumeGroupName", "CVGN_queryVolumeGroupResponseCode",processId);
-                                       
-               assertEquals("200", responseCode);
-       
-               logEnd();
-       }
-       
-       /**
-        * Rainy day scenario - nonexisting volume group id.
-        * 
-        * @throws Exception
-        */
-       @Test
-       public void rainyDayNoVolumeGroupId() throws Exception {
-               logStart();
-               
-               // does not exist would return a 404 from AAI
-               MockGetVolumeGroupById(wireMockServer, "MDTWNJ21", "VOLUME_GROUP_ID_THAT_DOES_NOT_EXIST", "aai-volume-group-id-info.xml", 404);
-                                       
-               Map<String, Object> variables = new HashMap<>();
-               variables.put("isDebugLogEnabled","true");
-               variables.put("ConfirmVolumeGroupName_aicCloudRegion", "MDTWNJ21");
-               variables.put("ConfirmVolumeGroupName_volumeGroupId", "VOLUME_GROUP_ID_THAT_DOES_NOT_EXIST");
-               variables.put("ConfirmVolumeGroupName_volumeGroupName", "cee6d136-e378-4678-a024-2cd15f0ee0cg");
-               variables.put("mso-request-id", UUID.randomUUID().toString());
-               String processId = invokeSubProcess("ConfirmVolumeGroupName", variables);       
-               String responseCode = BPMNUtil.getVariable(processEngine, "ConfirmVolumeGroupName", "CVGN_queryVolumeGroupResponseCode",processId);
-                                       
-               assertEquals("404", responseCode);
-               
-               logEnd();
-       }
-       
-       /**
-        * Rainy day scenario - volume group name does not match the name in AAI
-        *
-        * 
-        * @throws Exception
-        */
-       @Test
-       public void rainyDayNameDoesNotMatch() throws Exception {
-               logStart();
-               
-               MockGetVolumeGroupById(wireMockServer, "MDTWNJ21", "VOLUME_GROUP_ID_1", "aai-volume-group-id-info.xml", 200);
-                               
-               Map<String, Object> variables = new HashMap<>();
-               variables.put("isDebugLogEnabled","true");
-               variables.put("ConfirmVolumeGroupName_volumeGroupId", "VOLUME_GROUP_ID_1");
-               variables.put("ConfirmVolumeGroupName_volumeGroupName", "BAD_VOLUME_GROUP_NAME");
-               variables.put("ConfirmVolumeGroupName_aicCloudRegion", "MDTWNJ21");
-               variables.put("mso-request-id", UUID.randomUUID().toString());
-               String processId = invokeSubProcess("ConfirmVolumeGroupName", variables);               
-               String volumeGroupNameMatches = BPMNUtil.getVariable(processEngine, "ConfirmVolumeGroupName", "CVGN_volumeGroupNameMatches",processId);
-               
-               assertEquals("false", volumeGroupNameMatches);
-               
-               logEnd();
-       }
+    /**
+     * Sunny day scenario.
+     * 
+     * @throws Exception
+     */
+    @Test
+    public void sunnyDay() throws Exception {
+        logStart();
+        MockGetVolumeGroupById(wireMockServer, "MDTWNJ21", "VOLUME_GROUP_ID_1", "aai-volume-group-id-info.xml");
+
+        Map<String, Object> variables = new HashMap<>();
+        variables.put("isDebugLogEnabled", "true");
+        variables.put("ConfirmVolumeGroupName_volumeGroupId", "VOLUME_GROUP_ID_1");
+        variables.put("ConfirmVolumeGroupName_volumeGroupName", "VOLUME_GROUP_ID_1_NAME");
+        variables.put("ConfirmVolumeGroupName_aicCloudRegion", "MDTWNJ21");
+        variables.put("mso-request-id", UUID.randomUUID().toString());
+        String processId = invokeSubProcess("ConfirmVolumeGroupName", variables);
+        String responseCode = BPMNUtil.getVariable(processEngine, "ConfirmVolumeGroupName",
+                "CVGN_queryVolumeGroupResponseCode", processId);
+
+        assertEquals("200", responseCode);
+
+        logEnd();
+    }
+
+    /**
+     * Rainy day scenario - nonexisting volume group id.
+     * 
+     * @throws Exception
+     */
+    @Test
+    public void rainyDayNoVolumeGroupId() throws Exception {
+        logStart();
+
+        // does not exist would return a 404 from AAI
+        MockGetVolumeGroupById(wireMockServer, "MDTWNJ21", "VOLUME_GROUP_ID_THAT_DOES_NOT_EXIST",
+                "aai-volume-group-id-info.xml", 404);
+
+        Map<String, Object> variables = new HashMap<>();
+        variables.put("isDebugLogEnabled", "true");
+        variables.put("ConfirmVolumeGroupName_aicCloudRegion", "MDTWNJ21");
+        variables.put("ConfirmVolumeGroupName_volumeGroupId", "VOLUME_GROUP_ID_THAT_DOES_NOT_EXIST");
+        variables.put("ConfirmVolumeGroupName_volumeGroupName", "cee6d136-e378-4678-a024-2cd15f0ee0cg");
+        variables.put("mso-request-id", UUID.randomUUID().toString());
+        String processId = invokeSubProcess("ConfirmVolumeGroupName", variables);
+        String responseCode = BPMNUtil.getVariable(processEngine, "ConfirmVolumeGroupName",
+                "CVGN_queryVolumeGroupResponseCode", processId);
+
+        assertEquals("404", responseCode);
+
+        logEnd();
+    }
+
+    /**
+     * Rainy day scenario - volume group name does not match the name in AAI
+     *
+     * 
+     * @throws Exception
+     */
+    @Test
+    public void rainyDayNameDoesNotMatch() throws Exception {
+        logStart();
+
+        MockGetVolumeGroupById(wireMockServer, "MDTWNJ21", "VOLUME_GROUP_ID_1", "aai-volume-group-id-info.xml", 200);
+
+        Map<String, Object> variables = new HashMap<>();
+        variables.put("isDebugLogEnabled", "true");
+        variables.put("ConfirmVolumeGroupName_volumeGroupId", "VOLUME_GROUP_ID_1");
+        variables.put("ConfirmVolumeGroupName_volumeGroupName", "BAD_VOLUME_GROUP_NAME");
+        variables.put("ConfirmVolumeGroupName_aicCloudRegion", "MDTWNJ21");
+        variables.put("mso-request-id", UUID.randomUUID().toString());
+        String processId = invokeSubProcess("ConfirmVolumeGroupName", variables);
+        String volumeGroupNameMatches =
+                BPMNUtil.getVariable(processEngine, "ConfirmVolumeGroupName", "CVGN_volumeGroupNameMatches", processId);
+
+        assertEquals("false", volumeGroupNameMatches);
+
+        logEnd();
+    }
 }