aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/test')
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/CompleteMsoProcessTest.groovy59
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java6
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/CompleteMsoProcessTest.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ConfirmVolumeGroupNameTest.java6
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ConfirmVolumeGroupTenantTest.java4
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/CreateAAIVfModuleTest.java16
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/CreateAAIVfModuleVolumeGroupTest.java6
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/DecomposeServiceTest.java4
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/DeleteAAIVfModuleTest.java16
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/FalloutHandlerTest.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericDeleteServiceTest.java18
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericDeleteVnfTest.java20
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetServiceTest.java36
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetVnfTest.java10
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericPutVnfTest.java12
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/HomingTest.java23
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ManualHandlingTest.java4
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/PrepareUpdateAAIVfModuleTest.java10
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/RainyDayHandlerTest.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ReceiveWorkflowMessageTest.java4
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/SDNCAdapterV1Test.java6
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/UpdateAAIGenericVnfTest.java8
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/UpdateAAIVfModuleTest.java6
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/VnfAdapterRestV1Test.java10
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java10
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java26
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/MockResource.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/MockResourceApplication.java4
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseDatabase.java8
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/ResponseExceptionMapperImplTest.java111
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerSupportTest.java83
31 files changed, 363 insertions, 171 deletions
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/CompleteMsoProcessTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/CompleteMsoProcessTest.groovy
index ab7ee7a689..5949c3af53 100644
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/CompleteMsoProcessTest.groovy
+++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/CompleteMsoProcessTest.groovy
@@ -16,23 +16,24 @@
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
- */
+ */
package org.openecomp.mso.bpmn.common.scripts
-import org.junit.runner.RunWith;
-import static org.junit.Assert.*
-import static org.mockito.Mockito.*
-
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
+import org.mockito.ArgumentCaptor
import org.mockito.MockitoAnnotations
import org.mockito.runners.MockitoJUnitRunner
import org.openecomp.mso.bpmn.core.WorkflowException
+import static org.assertj.core.api.Assertions.assertThat
+import static org.assertj.core.api.Assertions.assertThatThrownBy
+import static org.mockito.Matchers.eq
+import static org.mockito.Mockito.*
@RunWith(MockitoJUnitRunner.class)
class CompleteMsoProcessTest {
@@ -128,7 +129,7 @@ class CompleteMsoProcessTest {
when(mockExecution.getVariable("CMSO_mso-bpel-name")).thenReturn("BPEL")
when(mockExecution.getVariable("URN_mso_adapters_db_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC");
when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7");
-
+
CompleteMsoProcess completeMsoProcess = new CompleteMsoProcess()
completeMsoProcess.setUpdateDBstatustoSuccessPayload(mockExecution)
@@ -145,29 +146,25 @@ class CompleteMsoProcessTest {
</sdncadapterworkflow:MsoCompletionResponse>"""
*/
@Test
- public void testbuildDataError(){
-
- boolean thrown = false;
- String msg = "Some-Message";
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("CMSO_mso-bpel-name")).thenReturn("BPEL-NAME")
- when(mockExecution.getVariable("testProcessKey")).thenReturn("CompleteMsoProcess")
-
- WorkflowException exception = new WorkflowException("CompleteMsoProcess", 500, msg);
-
- try{
- CompleteMsoProcess completeMsoProcess = new CompleteMsoProcess()
- completeMsoProcess.buildDataError(mockExecution, msg)
- }
- catch (BpmnError e){
- thrown = true;
- }
-
-
- verify(mockExecution).setVariable("CompleteMsoProcessResponse",msoCompletionResponse)
- // Can't seem to figure out how to verify the exception and have spent way too much time on fixing this test case!
- //verify(mockExecution).setVariable("WorkflowException",exception)
- assertTrue(thrown);
- }
+ void testBuildDataError() {
+ // given
+ def message = "Some-Message"
+
+ def mockExecution = mock ExecutionEntity.class
+ when mockExecution.getVariable("CMSO_mso-bpel-name") thenReturn "BPEL-NAME"
+ when mockExecution.getVariable("testProcessKey") thenReturn "CompleteMsoProcess"
+
+ def completeMsoProcess = new CompleteMsoProcess()
+ // when
+ assertThatThrownBy { completeMsoProcess.buildDataError(mockExecution, message) } isInstanceOf BpmnError
+ // then
+ verify mockExecution setVariable("CompleteMsoProcessResponse", msoCompletionResponse)
+ def argumentCaptor = ArgumentCaptor.forClass WorkflowException.class
+ verify mockExecution setVariable(eq("WorkflowException"), argumentCaptor.capture())
+ def capturedException = argumentCaptor.value
+
+ assertThat capturedException.processKey isEqualTo "CompleteMsoProcess"
+ assertThat capturedException.errorCode isEqualTo 500
+ assertThat capturedException.errorMessage isEqualTo message
+ }
} \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java
index eef9ed8ee0..9fcde31e4f 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java
@@ -121,7 +121,7 @@ public class BPMNUtil {
private static void buildVariable(String key, String value, Map<String,Object> variableValueType) {
- Map<String, Object> host = new HashMap<String, Object>();
+ Map<String, Object> host = new HashMap<>();
host.put("value", value);
host.put("type", "String");
variableValueType.put(key, host);
@@ -131,7 +131,7 @@ public class BPMNUtil {
WorkflowResource workflowResource = new WorkflowResource();
VariableMapImpl variableMap = new VariableMapImpl();
- Map<String, Object> variableValueType = new HashMap<String, Object>();
+ Map<String, Object> variableValueType = new HashMap<>();
for (String key : variables.keySet()) {
buildVariable(key, variables.get(key), variableValueType);
}
@@ -203,7 +203,7 @@ public class BPMNUtil {
WorkflowAsyncResource workflowResource = new WorkflowAsyncResource();
VariableMapImpl variableMap = new VariableMapImpl();
- Map<String, Object> variableValueType = new HashMap<String, Object>();
+ Map<String, Object> variableValueType = new HashMap<>();
for (String key : variables.keySet()) {
buildVariable(key, variables.get(key), variableValueType);
}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/CompleteMsoProcessTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/CompleteMsoProcessTest.java
index b050a81f18..9d4dac2333 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/CompleteMsoProcessTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/CompleteMsoProcessTest.java
@@ -42,7 +42,7 @@ public class CompleteMsoProcessTest extends WorkflowTest {
mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
//String changeFeatureActivateRequest = FileUtil.readResourceFile("__files/SDN-ETHERNET-INTERNET/ChangeFeatureActivateV1/" + inputRequestFile);
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
variables.put("CompleteMsoProcessRequest",inputRequestFile);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CompleteMsoProcess", variables);
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ConfirmVolumeGroupNameTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ConfirmVolumeGroupNameTest.java
index 1925c0a1b9..845f06045a 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ConfirmVolumeGroupNameTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ConfirmVolumeGroupNameTest.java
@@ -51,7 +51,7 @@ public class ConfirmVolumeGroupNameTest extends WorkflowTest {
System.out.println("Before starting process");
RuntimeService runtimeService = processEngineRule.getRuntimeService();
- Map<String, Object> variables = new HashMap<String, Object>();
+ 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");
@@ -83,7 +83,7 @@ public class ConfirmVolumeGroupNameTest extends WorkflowTest {
System.out.println("Before starting process");
RuntimeService runtimeService = processEngineRule.getRuntimeService();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
variables.put("ConfirmVolumeGroupName_volumeGroupId", "VOLUME_GROUP_ID_THAT_DOES_NOT_EXIST");
variables.put("ConfirmVolumeGroupName_volumeGroupName", "cee6d136-e378-4678-a024-2cd15f0ee0cg");
@@ -116,7 +116,7 @@ public class ConfirmVolumeGroupNameTest extends WorkflowTest {
System.out.println("Before starting process");
RuntimeService runtimeService = processEngineRule.getRuntimeService();
- Map<String, Object> variables = new HashMap<String, Object>();
+ 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");
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ConfirmVolumeGroupTenantTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ConfirmVolumeGroupTenantTest.java
index 3856f7b5e1..457128f104 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ConfirmVolumeGroupTenantTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ConfirmVolumeGroupTenantTest.java
@@ -46,7 +46,7 @@ public class ConfirmVolumeGroupTenantTest extends WorkflowTest {
public void testRemoveLayer3Service_success() throws Exception{
MockGetVolumeGroupById("MDTWNJ21", "a8399879-31b3-4973-be26-0a0cbe776b58", "CRTGVNF_queryAAIResponseVolume.xml");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "ConfirmVolumeGroupTenant", variables);
@@ -66,7 +66,7 @@ public class ConfirmVolumeGroupTenantTest extends WorkflowTest {
public void testRemoveLayer3Service_idsNotMatch() throws Exception{
MockGetVolumeGroupById("MDTWNJ21", "a8399879-31b3-4973-be26-0a0cbe776b58", "CRTGVNF_queryAAIResponseVolume_idsNotMatch.xml");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "ConfirmVolumeGroupTenant", variables);
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/CreateAAIVfModuleTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/CreateAAIVfModuleTest.java
index 045bd6f9c7..b2b7760327 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/CreateAAIVfModuleTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/CreateAAIVfModuleTest.java
@@ -51,7 +51,7 @@ public class CreateAAIVfModuleTest extends WorkflowTest {
MockAAICreateGenericVnf();
MockAAIVfModulePUT(true);
RuntimeService runtimeService = processEngineRule.getRuntimeService();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
variables.put("isVidRequest", "false");
variables.put("vnfName", "STMTN5MMSC22");
@@ -78,7 +78,7 @@ public class CreateAAIVfModuleTest extends WorkflowTest {
MockAAICreateGenericVnf();
MockAAIVfModulePUT(true);
RuntimeService runtimeService = processEngineRule.getRuntimeService();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
variables.put("isVidRequest", "false");
variables.put("vnfId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
@@ -103,7 +103,7 @@ public class CreateAAIVfModuleTest extends WorkflowTest {
MockAAICreateGenericVnf();
MockAAIVfModulePUT(true);
RuntimeService runtimeService = processEngineRule.getRuntimeService();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
variables.put("isVidRequest", "false");
variables.put("vnfName", "STMTN5MMSC23");
@@ -128,7 +128,7 @@ public class CreateAAIVfModuleTest extends WorkflowTest {
MockAAICreateGenericVnf();
MockAAIVfModulePUT(true);
RuntimeService runtimeService = processEngineRule.getRuntimeService();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
variables.put("isVidRequest", "false");
variables.put("vnfName", "STMTN5MMSC21");
@@ -153,7 +153,7 @@ public class CreateAAIVfModuleTest extends WorkflowTest {
MockAAICreateGenericVnf();
MockAAIVfModulePUT(true);
RuntimeService runtimeService = processEngineRule.getRuntimeService();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
variables.put("isVidRequest", "false");
variables.put("vnfId", "2f6aee38-1e2a-11e6-82d1-ffc7d9ee8aa4");
@@ -178,7 +178,7 @@ public class CreateAAIVfModuleTest extends WorkflowTest {
MockAAICreateGenericVnf();
MockAAIVfModulePUT(true);
RuntimeService runtimeService = processEngineRule.getRuntimeService();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
variables.put("isVidRequest", "false");
variables.put("vnfName", "STMTN5MMSC22");
@@ -203,7 +203,7 @@ public class CreateAAIVfModuleTest extends WorkflowTest {
MockAAICreateGenericVnf();
MockAAIVfModulePUT(true);
RuntimeService runtimeService = processEngineRule.getRuntimeService();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
variables.put("isVidRequest", "false");
variables.put("vnfId", "768073c7-f41f-4822-9323-b75962763d74");
@@ -228,7 +228,7 @@ public class CreateAAIVfModuleTest extends WorkflowTest {
MockAAICreateGenericVnf();
MockAAIVfModulePUT(true);
RuntimeService runtimeService = processEngineRule.getRuntimeService();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
variables.put("isVidRequest", "false");
variables.put("vnfId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/CreateAAIVfModuleVolumeGroupTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/CreateAAIVfModuleVolumeGroupTest.java
index 5845ec1a56..5cc26459e8 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/CreateAAIVfModuleVolumeGroupTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/CreateAAIVfModuleVolumeGroupTest.java
@@ -55,7 +55,7 @@ public class CreateAAIVfModuleVolumeGroupTest extends WorkflowTest {
MockPutVfModuleIdNoResponse("skask", "PCRF", "lukewarm");
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", "999-99-9999");
variables.put("isDebugLogEnabled","true");
variables.put("CreateAAIVfModuleVolumeGroupRequest", updateAAIVfModuleRequest);
@@ -86,7 +86,7 @@ public class CreateAAIVfModuleVolumeGroupTest extends WorkflowTest {
MockGetVfModuleId("skask", ".*", "VfModularity/VfModule-supercool.xml", 404);
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", "999-99-9999");
variables.put("isDebugLogEnabled","true");
variables.put("CreateAAIVfModuleVolumeGroupRequest", updateAAIVfModuleRequest);
@@ -117,7 +117,7 @@ public class CreateAAIVfModuleVolumeGroupTest extends WorkflowTest {
MockGetVfModuleId("skask", "lukewarm", "VfModularity/VfModule-lukewarm.xml", 200);
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", "999-99-9999");
variables.put("isDebugLogEnabled","true");
variables.put("CreateAAIVfModuleVolumeGroupRequest", updateAAIVfModuleRequest);
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/DecomposeServiceTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/DecomposeServiceTest.java
index bda6dd953c..7295cd8e10 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/DecomposeServiceTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/DecomposeServiceTest.java
@@ -49,7 +49,7 @@ public class DecomposeServiceTest extends WorkflowTest {
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
setVariablesSuccess(variables, "testRequestId123", "ff5256d2-5a33-55df-13ab-12abad84e7ff");
invokeSubProcess("DecomposeService", businessKey, variables);
@@ -66,7 +66,7 @@ public class DecomposeServiceTest extends WorkflowTest {
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
setVariablesSuccess(variables, "testRequestId123", "ff5256d2-5a33-55df-13ab-12abad84e7ff");
invokeSubProcess("DecomposeService", businessKey, variables);
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/DeleteAAIVfModuleTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/DeleteAAIVfModuleTest.java
index bb2fc03163..564927a854 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/DeleteAAIVfModuleTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/DeleteAAIVfModuleTest.java
@@ -52,7 +52,7 @@ public class DeleteAAIVfModuleTest extends WorkflowTest {
MockAAIDeleteGenericVnf();
MockAAIDeleteVfModule();
RuntimeService runtimeService = processEngineRule.getRuntimeService();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
variables.put("DeleteAAIVfModuleRequest","<vnf-request xmlns=\"http://openecomp.org/mso/infra/vnf-request/v1\"> <request-info> <action>DELETE_VF_MODULE</action> <source>PORTAL</source> </request-info> <vnf-inputs> <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnf-id> <vnf-name>STMTN5MMSC21</vnf-name> <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id> <vf-module-name>STMTN5MMSC21-MMSC::module-0-0</vf-module-name> </vnf-inputs> <vnf-params xmlns:tns=\"http://openecomp.org/mso/infra/vnf-request/v1\"/> </vnf-request>");
runtimeService.startProcessInstanceByKey("DeleteAAIVfModule", variables);
@@ -88,7 +88,7 @@ public class DeleteAAIVfModuleTest extends WorkflowTest {
MockAAIDeleteGenericVnf();
MockAAIDeleteVfModule();
RuntimeService runtimeService = processEngineRule.getRuntimeService();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
variables.put("DeleteAAIVfModuleRequest",request);
runtimeService.startProcessInstanceByKey("DeleteAAIVfModule", variables);
@@ -123,7 +123,7 @@ public class DeleteAAIVfModuleTest extends WorkflowTest {
MockAAIDeleteGenericVnf();
MockAAIDeleteVfModule();
RuntimeService runtimeService = processEngineRule.getRuntimeService();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
variables.put("DeleteAAIVfModuleRequest",request);
runtimeService.startProcessInstanceByKey("DeleteAAIVfModule", variables);
@@ -158,7 +158,7 @@ public class DeleteAAIVfModuleTest extends WorkflowTest {
MockAAIDeleteGenericVnf();
MockAAIDeleteVfModule();
RuntimeService runtimeService = processEngineRule.getRuntimeService();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
variables.put("DeleteAAIVfModuleRequest",request);
runtimeService.startProcessInstanceByKey("DeleteAAIVfModule", variables);
@@ -193,7 +193,7 @@ public class DeleteAAIVfModuleTest extends WorkflowTest {
MockAAIDeleteGenericVnf();
MockAAIDeleteVfModule();
RuntimeService runtimeService = processEngineRule.getRuntimeService();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
variables.put("DeleteAAIVfModuleRequest",request);
runtimeService.startProcessInstanceByKey("DeleteAAIVfModule", variables);
@@ -228,7 +228,7 @@ public class DeleteAAIVfModuleTest extends WorkflowTest {
MockAAIDeleteGenericVnf();
MockAAIDeleteVfModule();
RuntimeService runtimeService = processEngineRule.getRuntimeService();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
variables.put("DeleteAAIVfModuleRequest",request);
runtimeService.startProcessInstanceByKey("DeleteAAIVfModule", variables);
@@ -263,7 +263,7 @@ public class DeleteAAIVfModuleTest extends WorkflowTest {
MockAAIDeleteGenericVnf();
MockAAIDeleteVfModule();
RuntimeService runtimeService = processEngineRule.getRuntimeService();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
variables.put("DeleteAAIVfModuleRequest",request);
runtimeService.startProcessInstanceByKey("DeleteAAIVfModule", variables);
@@ -284,7 +284,7 @@ public class DeleteAAIVfModuleTest extends WorkflowTest {
MockAAIDeleteGenericVnf();
MockAAIDeleteVfModule();
RuntimeService runtimeService = processEngineRule.getRuntimeService();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
variables.put("DeleteAAIVfModuleRequest","<vnf-request xmlns=\"http://openecomp.org/mso/infra/vnf-request/v1\"> <request-info> <action>DELETE_VF_MODULE</action> <source>PORTAL</source> </request-info> <vnf-inputs> <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c720</vnf-id> <vnf-name>STMTN5MMSC20</vnf-name> <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a76</vf-module-id> <vf-module-name>STMTN5MMSC20-MMSC::module-2-0</vf-module-name> </vnf-inputs> <vnf-params xmlns:tns=\"http://openecomp.org/mso/infra/vnf-request/v1\"/> </vnf-request>");
runtimeService.startProcessInstanceByKey("DeleteAAIVfModule", variables);
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/FalloutHandlerTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/FalloutHandlerTest.java
index 8281687dec..257cec9b11 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/FalloutHandlerTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/FalloutHandlerTest.java
@@ -58,7 +58,7 @@ public class FalloutHandlerTest extends WorkflowTest {
System.out.println("STARTED TEST: " + method);
//String changeFeatureActivateRequest = FileUtil.readResourceFile("__files/SDN-ETHERNET-INTERNET/ChangeFeatureActivateV1/" + inputRequestFile);
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
variables.put("FalloutHandlerRequest",inputRequestFile);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "FalloutHandler", variables);
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericDeleteServiceTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericDeleteServiceTest.java
index cced8c1860..125a9ad916 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericDeleteServiceTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericDeleteServiceTest.java
@@ -51,7 +51,7 @@ public class GenericDeleteServiceTest extends WorkflowTest {
@Deployment(resources = {"subprocess/GenericDeleteService.bpmn"})
public void testGenericDeleteService_success_serviceInstance() throws Exception{
MockDeleteServiceInstance("1604-MVM-26", "SDN-ETHERNET-INTERNET", "MIS%252F1604%252F0026%252FSW_INTERNET", "1234");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", "1604-MVM-26", "SDN-ETHERNET-INTERNET", "1234");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables);
waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
@@ -70,7 +70,7 @@ public class GenericDeleteServiceTest extends WorkflowTest {
MockDeleteServiceInstance("1604-MVM-26", "SDN-ETHERNET-INTERNET", "1234", 204);
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesSubscription(variables, "", "1604-MVM-26", "SDN-ETHERNET-INTERNET", "1234");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables);
@@ -94,7 +94,7 @@ public class GenericDeleteServiceTest extends WorkflowTest {
MockGetServiceInstance("1604-MVM-26", "SDN-ETHERNET-INTERNET", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceSubscription.xml");
MockDeleteServiceInstance("1604-MVM-26", "SDN-ETHERNET-INTERNET", "MIS%252F1604%252F0026%252FSW_INTERNET", "1234");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", "1604-MVM-26", "SDN-ETHERNET-INTERNET", null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables);
@@ -118,7 +118,7 @@ public class GenericDeleteServiceTest extends WorkflowTest {
MockGetServiceSubscription("1604-MVM-26", "SDN-ETHERNET-INTERNET", "GenericFlows/getServiceSubscription.xml");
MockDeleteServiceInstance("1604-MVM-26", "SDN-ETHERNET-INTERNET", "1234", 204);
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesSubscription(variables, null, "1604-MVM-26", "SDN-ETHERNET-INTERNET", null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables);
@@ -142,7 +142,7 @@ public class GenericDeleteServiceTest extends WorkflowTest {
MockGetServiceInstance_404("1604-MVM-26", "SDN-ETHERNET-INTERNET", "MIS%252F1604%252F0026%252FSW_INTERNET");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", "1604-MVM-26", "SDN-ETHERNET-INTERNET", null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables);
@@ -164,7 +164,7 @@ public class GenericDeleteServiceTest extends WorkflowTest {
public void testGenericDeleteService_success_subscriptionGetEmpty200() throws Exception{
MockGetServiceInstance("1604-MVM-26", "SDN-ETHERNET-INTERNET", "1234", 200);
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesSubscription(variables, "", "1604-MVM-26", "SDN-ETHERNET-INTERNET", "");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables);
@@ -189,7 +189,7 @@ public class GenericDeleteServiceTest extends WorkflowTest {
MockGetServiceInstance("1604-MVM-26", "SDN-ETHERNET-INTERNET", "MIS%252F1604%252F0026%252FSW_INTERNET", "GENDSI_getServiceInstanceResponse.xml");
MockDeleteServiceInstance_404("1604-MVM-26", "SDN-ETHERNET-INTERNET", "MIS%252F1604%252F0026%252FSW_INTERNET", "1234");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", "1604-MVM-26", "SDN-ETHERNET-INTERNET", "1234");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables);
@@ -210,7 +210,7 @@ public class GenericDeleteServiceTest extends WorkflowTest {
@Deployment(resources = {"subprocess/GenericDeleteService.bpmn"})
public void testGenericDeleteService_error_invalidVariables() throws Exception{
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, "SDN-ETHERNET-INTERNET", "1234");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables);
@@ -236,7 +236,7 @@ public class GenericDeleteServiceTest extends WorkflowTest {
MockGetServiceInstance_500("1604-MVM-26", "SDN-ETHERNET-INTERNET", "MIS%252F1604%252F0026%252FSW_INTERNET", "aaiFault.xml");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", "1604-MVM-26", "SDN-ETHERNET-INTERNET", null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables);
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericDeleteVnfTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericDeleteVnfTest.java
index 473f6c8195..add9a32d61 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericDeleteVnfTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericDeleteVnfTest.java
@@ -51,7 +51,7 @@ public class GenericDeleteVnfTest extends WorkflowTest {
public void testGenericDeleteVnf_success_genericVnf() throws Exception{
MockDeleteGenericVnf("testVnfId123", "testReVer123");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables, "testVnfId123", "generic-vnf", "testReVer123");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables);
@@ -66,7 +66,7 @@ public class GenericDeleteVnfTest extends WorkflowTest {
public void testGenericDeleteVnf_success_vce() throws Exception{
MockDeleteVce("testVnfId123", "testReVer123", 204);
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables, "testVnfId123", "vce", "testReVer123");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables);
@@ -83,7 +83,7 @@ public class GenericDeleteVnfTest extends WorkflowTest {
MockGetGenericVnfById("/testVnfId123", "GenericFlows/getGenericVnfByNameResponse.xml", 200);
MockDeleteGenericVnf("testVnfId123", "testReVer123");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables, "testVnfId123", "generic-vnf", "");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables);
@@ -99,7 +99,7 @@ public class GenericDeleteVnfTest extends WorkflowTest {
MockDeleteVce("testVnfId123", "testReVer123", 204);
MockGetVceById("testVnfId123", "GenericFlows/getVceResponse.xml");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables, "testVnfId123", "vce", null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables);
@@ -114,7 +114,7 @@ public class GenericDeleteVnfTest extends WorkflowTest {
public void testGenericDeleteVnf_success_genericVnf404() throws Exception{
MockDeleteGenericVnf("testVnfId123", "testReVer123", 404);
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables, "testVnfId123", "generic-vnf", "testReVer123");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables);
@@ -129,7 +129,7 @@ public class GenericDeleteVnfTest extends WorkflowTest {
public void testGenericDeleteVnf_success_vce404() throws Exception{
MockDeleteVce("testVnfId123", "testReVer123", 404);
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables, "testVnfId123", "vce", "testReVer123");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables);
@@ -144,7 +144,7 @@ public class GenericDeleteVnfTest extends WorkflowTest {
public void testGenericDeleteVnf_success_genericVnfNoResourceVersion404() throws Exception{
MockGetGenericVnfById_404("testVnfId123");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables, "testVnfId123", "generic-vnf", "");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables);
@@ -158,7 +158,7 @@ public class GenericDeleteVnfTest extends WorkflowTest {
@Deployment(resources = {"subprocess/GenericDeleteVnf.bpmn"})
public void testGenericDeleteVnf_error_missingVariables() throws Exception{
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables, "testVnfId123", "", "testReVer123");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables);
@@ -173,7 +173,7 @@ public class GenericDeleteVnfTest extends WorkflowTest {
public void testGenericDeleteVnf_error_genericVnf500() throws Exception{
MockDeleteGenericVnf_500("testVnfId123", "testReVer123");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables, "testVnfId123", "generic-vnf", "testReVer123");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables);
@@ -188,7 +188,7 @@ public class GenericDeleteVnfTest extends WorkflowTest {
public void testGenericDeleteVnf_error_genericVnf412() throws Exception{
MockDeleteGenericVnf("testVnfId123", "testReVer123", 412);
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables, "testVnfId123", "generic-vnf", "testReVer123");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables);
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetServiceTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetServiceTest.java
index 82cceb0b70..0198395750 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetServiceTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetServiceTest.java
@@ -56,7 +56,7 @@ public class GenericGetServiceTest extends WorkflowTest {
@Deployment(resources = {"subprocess/GenericGetService.bpmn"})
public void testGenericGetService_success_serviceInstance() throws Exception{
MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, "SDN-ETHERNET-INTERNET", "123456789");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
@@ -81,7 +81,7 @@ public class GenericGetServiceTest extends WorkflowTest {
MockGetServiceSubscription("1604-MVM-26", "SDN-ETHERNET-INTERNET", "GenericFlows/getServiceSubscription.xml");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesSubscription(variables, "", null , "1604-MVM-26", "SDN-ETHERNET-INTERNET");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
@@ -109,7 +109,7 @@ public class GenericGetServiceTest extends WorkflowTest {
MockNodeQueryServiceInstanceByName("1604-MVM-26", "GenericFlows/getSIUrlByName.xml");
MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesInstance(variables, null, "1604-MVM-26", null, null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
@@ -139,7 +139,7 @@ public class GenericGetServiceTest extends WorkflowTest {
MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlById.xml");
MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, null, null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
@@ -168,7 +168,7 @@ public class GenericGetServiceTest extends WorkflowTest {
MockGetServiceInstance_404("SDN-ETHERNET-INTERNET", "123456789", "MIS%2F1604%2F0026%2FSW_INTERNET");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, "SDN-ETHERNET-INTERNET", "123456789");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
@@ -192,7 +192,7 @@ public class GenericGetServiceTest extends WorkflowTest {
public void testGenericGetService_success_serviceSubscription404() throws Exception{
MockGetServiceSubscription("1604-MVM-26", "SDN-ETHERNET-INTERNET", 404);
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesSubscription(variables, "", "", "SDN-ETHERNET-INTERNET", "1604-MVM-26");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
@@ -219,7 +219,7 @@ public class GenericGetServiceTest extends WorkflowTest {
MockNodeQueryServiceInstanceByName_404("1604-MVM-26");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesInstance(variables, "", "1604-MVM-26", null, null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
@@ -246,7 +246,7 @@ public class GenericGetServiceTest extends WorkflowTest {
MockNodeQueryServiceInstanceById_404("MIS%2F1604%2F0026%2FSW_INTERNET");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, null, null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
@@ -273,7 +273,7 @@ public class GenericGetServiceTest extends WorkflowTest {
MockGetServiceInstance("1604-MVM-26", "SDN-ETHERNET-INTERNET", "MIS%252F1604%252F0026%252FSW_INTERNET", " ");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, "SDN-ETHERNET-INTERNET", "123456789");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
@@ -297,7 +297,7 @@ public class GenericGetServiceTest extends WorkflowTest {
public void testGenericGetService_success_serviceInstanceByNameEmpty() throws Exception{
MockNodeQueryServiceInstanceByName("1604-MVM-26", "");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesInstance(variables, "", "1604-MVM-26", null, null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
@@ -324,7 +324,7 @@ public class GenericGetServiceTest extends WorkflowTest {
MockNodeQueryServiceInstanceById("MIS[%]2F1604[%]2F0026[%]2FSW_INTERNET", "");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, null, null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
@@ -350,7 +350,7 @@ public class GenericGetServiceTest extends WorkflowTest {
@Deployment(resources = {"subprocess/GenericGetService.bpmn"})
public void testGenericGetService_error_serviceInstanceInvalidVariables() throws Exception{
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesInstance(variables, null, null, "SDN-ETHERNET-INTERNET", null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
@@ -375,7 +375,7 @@ public class GenericGetServiceTest extends WorkflowTest {
@Deployment(resources = {"subprocess/GenericGetService.bpmn"})
public void testGenericGetService_success_serviceSubscriptionInvalidVariables() throws Exception{
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesSubscription(variables, "", "", "SDN-ETHERNET-INTERNET", null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
@@ -403,7 +403,7 @@ public class GenericGetServiceTest extends WorkflowTest {
MockGetServiceInstance_500("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", "1604-MVM-26", "SDN-ETHERNET-INTERNET", "123456789");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
@@ -430,7 +430,7 @@ public class GenericGetServiceTest extends WorkflowTest {
MockNodeQueryServiceInstanceById_500("MIS%2F1604%2F0026%2FSW_INTERNET");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, null, null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
@@ -459,7 +459,7 @@ public class GenericGetServiceTest extends WorkflowTest {
MockNodeQueryServiceInstanceByName_500("1604-MVM-26");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesInstance(variables, null, "1604-MVM-26", null, null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
@@ -489,7 +489,7 @@ public class GenericGetServiceTest extends WorkflowTest {
MockNodeQueryServiceInstanceByName("1604-MVM-26", "GenericFlows/getSIUrlByNameMultiCustomer.xml");
MockGetServiceInstance("XyCorporation", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesInstance(variables, null, "1604-MVM-26", "XyCorporation", null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
@@ -517,7 +517,7 @@ public class GenericGetServiceTest extends WorkflowTest {
MockNodeQueryServiceInstanceByName("1604-MVM-26", "GenericFlows/getSIUrlByNameMultiCustomer.xml");
MockGetServiceInstance("CorporationNotPresent", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariablesInstance(variables, null, "1604-MVM-26", "CorporationNotPresent", null);
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetVnfTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetVnfTest.java
index 126a5fda62..4922263744 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetVnfTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetVnfTest.java
@@ -52,7 +52,7 @@ public class GenericGetVnfTest extends WorkflowTest {
public void testGenericGetVnf_success_genericVnf() throws Exception{
MockGetGenericVnfByIdWithDepth("testVnfId123", 1, "GenericFlows/getGenericVnfByNameResponse.xml");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables, "testVnfId123", "testVnfName123", "generic-vnf");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetVnf", variables);
@@ -79,7 +79,7 @@ public class GenericGetVnfTest extends WorkflowTest {
public void testGenericGetVnf_success_vce() throws Exception{
MockGetVceById("testVnfId123[?]depth=1", "GenericFlows/getVceResponse.xml");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables, "testVnfId123", "testVnfName123", "vce");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetVnf", variables);
@@ -106,7 +106,7 @@ public class GenericGetVnfTest extends WorkflowTest {
public void testGenericGetVnf_success_genericVnfByName() throws Exception{
MockGetGenericVnfByNameWithDepth("testVnfName123", 1, "GenericFlows/getGenericVnfResponse.xml");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables, "", "testVnfName123", "generic-vnf");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetVnf", variables);
@@ -133,7 +133,7 @@ public class GenericGetVnfTest extends WorkflowTest {
public void testGenericGetVnf_success_vceByName() throws Exception{
MockGetGenericVceByNameWithDepth("testVnfName123", 1, "GenericFlows/getVceByNameResponse.xml");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables, null, "testVnfName123", "vce");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetVnf", variables);
@@ -162,7 +162,7 @@ public class GenericGetVnfTest extends WorkflowTest {
MockGetGenericVnfById_500("testVnfId123");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables, "testVnfId123", "testVnfName123", "generic-vnf");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetVnf", variables);
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericPutVnfTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericPutVnfTest.java
index 149f8aead2..0e0a237090 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericPutVnfTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericPutVnfTest.java
@@ -51,7 +51,7 @@ public class GenericPutVnfTest extends WorkflowTest {
MockPutGenericVnf("testVnfId123");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables, "testVnfId123", genericVnfPayload, "generic-vnf");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericPutVnf", variables);
@@ -71,7 +71,7 @@ public class GenericPutVnfTest extends WorkflowTest {
MockPutVce("testVnfId123");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables, "testVnfId123", vcePayload, "vce");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericPutVnf", variables);
@@ -91,7 +91,7 @@ public class GenericPutVnfTest extends WorkflowTest {
MockPutGenericVnf("testVnfId123");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables, "testVnfId123", genericVnfPayload, "");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericPutVnf", variables);
@@ -113,7 +113,7 @@ public class GenericPutVnfTest extends WorkflowTest {
MockPutGenericVnf("testVnfId123");
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables, "testVnfId123", genericVnfPayload, "");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericPutVnf", variables);
@@ -133,7 +133,7 @@ public class GenericPutVnfTest extends WorkflowTest {
@Deployment(resources = {"subprocess/GenericPutVnf.bpmn"})
public void testGenericPutVnf_error_404() throws Exception{
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables, "testVnfId123", genericVnfPayload, "generic-vnf");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericPutVnf", variables);
@@ -154,7 +154,7 @@ public class GenericPutVnfTest extends WorkflowTest {
MockPutGenericVnf("/testVnfId123", 400);
- Map<String, String> variables = new HashMap<String, String>();
+ Map<String, String> variables = new HashMap<>();
setVariables(variables, "testVnfId123", genericVnfPayload, "generic-vnf");
WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericPutVnf", variables);
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/HomingTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/HomingTest.java
index e49ef0032e..3210fe8fc7 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/HomingTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/HomingTest.java
@@ -23,7 +23,7 @@
*/
package org.openecomp.mso.bpmn.common;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockGetServiceResourcesCatalogData;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockGetServiceResourcesCatalogDataByModelUuid;
import static org.openecomp.mso.bpmn.mock.StubResponseSNIRO.*;
import static org.junit.Assert.*;
@@ -140,7 +140,7 @@ public class HomingTest extends WorkflowTest {
mockSNIRO();
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
setVariables(variables);
invokeSubProcess("Homing", businessKey, variables);
@@ -183,7 +183,7 @@ public class HomingTest extends WorkflowTest {
mockSNIRO();
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
setVariables2(variables);
invokeSubProcess("Homing", businessKey, variables);
@@ -235,9 +235,10 @@ public class HomingTest extends WorkflowTest {
// Create a Service Decomposition
//System.out.println("At start of testHoming_success_vnfResourceList");
- MockGetServiceResourcesCatalogData("1cc4e2e4-eb6e-404d-a66f-c8733cedcce8", "5.0", "/BuildingBlocks/catalogResp.json");
+ MockGetServiceResourcesCatalogDataByModelUuid("2f7f309d-c842-4644-a2e4-34167be5eeb4", "/BuildingBlocks/catalogResp.json");
+ //MockGetServiceResourcesCatalogData("1cc4e2e4-eb6e-404d-a66f-c8733cedcce8", "5.0", "/BuildingBlocks/catalogResp.json");
String busKey = UUID.randomUUID().toString();
- Map<String, Object> vars = new HashMap<String, Object>();
+ Map<String, Object> vars = new HashMap<>();
setVariablesForServiceDecomposition(vars, "testRequestId123", "ff5256d2-5a33-55df-13ab-12abad84e7ff");
invokeSubProcess("DecomposeService", busKey, vars);
@@ -252,7 +253,7 @@ public class HomingTest extends WorkflowTest {
mockSNIRO();
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled", "true");
variables.put("msoRequestId", "testRequestId");
variables.put("serviceInstanceId", "testServiceInstanceId");
@@ -288,7 +289,7 @@ public class HomingTest extends WorkflowTest {
public void testHoming_error_inputVariable() throws Exception {
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
setVariables3(variables);
invokeSubProcess("Homing", businessKey, variables);
@@ -307,7 +308,7 @@ public class HomingTest extends WorkflowTest {
mockSNIRO_500();
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
setVariables(variables);
invokeSubProcess("Homing", businessKey, variables);
@@ -326,7 +327,7 @@ public class HomingTest extends WorkflowTest {
mockSNIRO();
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
setVariables(variables);
invokeSubProcess("Homing", businessKey, variables);
@@ -347,7 +348,7 @@ public class HomingTest extends WorkflowTest {
mockSNIRO();
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
setVariables(variables);
invokeSubProcess("Homing", businessKey, variables);
@@ -368,7 +369,7 @@ public class HomingTest extends WorkflowTest {
mockSNIRO();
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
setVariables(variables);
invokeSubProcess("Homing", businessKey, variables);
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ManualHandlingTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ManualHandlingTest.java
index 6141ee021f..a7c2d19aa0 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ManualHandlingTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ManualHandlingTest.java
@@ -67,7 +67,7 @@ public class ManualHandlingTest extends WorkflowTest {
public void TestManualHandlingSuccess() {
RuntimeService runtimeService = processEngineRule.getRuntimeService();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
variables.put("msoRequestId", "testRequestId");
variables.put("serviceType", "X");
@@ -103,7 +103,7 @@ public class ManualHandlingTest extends WorkflowTest {
System.out.println("TASK NAME: " + task.getName());
try {
System.out.println("Completing the task");
- Map<String,Object> completeVariables = new HashMap<String,Object>();
+ Map<String,Object> completeVariables = new HashMap<>();
completeVariables.put("responseValue", "skip");
taskService.complete(task.getId(), completeVariables);
}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/PrepareUpdateAAIVfModuleTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/PrepareUpdateAAIVfModuleTest.java
index 441cefdb41..be74770e98 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/PrepareUpdateAAIVfModuleTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/PrepareUpdateAAIVfModuleTest.java
@@ -60,7 +60,7 @@ public class PrepareUpdateAAIVfModuleTest extends WorkflowTest {
MockPatchVfModuleId("skask", "supercool");
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", "999-99-9999");
variables.put("isDebugLogEnabled","true");
variables.put("PrepareUpdateAAIVfModuleRequest", prepareUpdateAAIVfModuleRequest);
@@ -94,7 +94,7 @@ public class PrepareUpdateAAIVfModuleTest extends WorkflowTest {
MockGetGenericVnfById_404("skask[?]depth=1");
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", "999-99-9999");
variables.put("isDebugLogEnabled","true");
variables.put("PrepareUpdateAAIVfModuleRequest", prepareUpdateAAIVfModuleRequest);
@@ -129,7 +129,7 @@ public class PrepareUpdateAAIVfModuleTest extends WorkflowTest {
MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", "999-99-9999");
variables.put("isDebugLogEnabled","true");
variables.put("PrepareUpdateAAIVfModuleRequest", prepareUpdateAAIVfModuleRequest);
@@ -159,7 +159,7 @@ public class PrepareUpdateAAIVfModuleTest extends WorkflowTest {
MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", "999-99-9999");
variables.put("isDebugLogEnabled","true");
variables.put("PrepareUpdateAAIVfModuleRequest", prepareUpdateAAIVfModuleRequest);
@@ -190,7 +190,7 @@ public class PrepareUpdateAAIVfModuleTest extends WorkflowTest {
MockAAIVfModuleBadPatch("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/supercool", 404);
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", "999-99-9999");
variables.put("isDebugLogEnabled","true");
variables.put("PrepareUpdateAAIVfModuleRequest", prepareUpdateAAIVfModuleRequest);
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/RainyDayHandlerTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/RainyDayHandlerTest.java
index 8a78f3206c..65575ba861 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/RainyDayHandlerTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/RainyDayHandlerTest.java
@@ -57,7 +57,7 @@ public class RainyDayHandlerTest extends WorkflowTest {
public void TestRainyDayHandlingSuccess() {
RuntimeService runtimeService = processEngineRule.getRuntimeService();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
variables.put("msoRequestId", "testRequestId");
variables.put("serviceType", "X");
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ReceiveWorkflowMessageTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ReceiveWorkflowMessageTest.java
index 4669192249..a806515974 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ReceiveWorkflowMessageTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ReceiveWorkflowMessageTest.java
@@ -85,7 +85,7 @@ public class ReceiveWorkflowMessageTest extends WorkflowTest {
logStart();
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", "dffbae0e-5588-4bd6-9749-b0f0adb52312");
variables.put("isDebugLogEnabled", "true");
variables.put("RCVWFMSG_timeout", "PT1M");
@@ -115,7 +115,7 @@ public class ReceiveWorkflowMessageTest extends WorkflowTest {
logStart();
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", "dffbae0e-5588-4bd6-9749-b0f0adb52312");
variables.put("isDebugLogEnabled", "true");
variables.put("RCVWFMSG_timeout", "PT0.1S");
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/SDNCAdapterV1Test.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/SDNCAdapterV1Test.java
index 778eec190e..0349b178cb 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/SDNCAdapterV1Test.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/SDNCAdapterV1Test.java
@@ -75,12 +75,12 @@ public class SDNCAdapterV1Test extends WorkflowTest {
private WorkflowResponse invokeFlow(String workflowRequest) {
- Map<String, Object>valueMap = new HashMap<String, Object>();
+ Map<String, Object>valueMap = new HashMap<>();
valueMap.put("value", workflowRequest);
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("sdncAdapterWorkflowRequest", valueMap);
- Map<String, Object> valueMap2 = new HashMap<String, Object>();
+ Map<String, Object> valueMap2 = new HashMap<>();
valueMap2.put("value", "true");
variables.put("isDebugLogEnabled", valueMap2);
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/UpdateAAIGenericVnfTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/UpdateAAIGenericVnfTest.java
index 20f6f6d264..7c557ffe63 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/UpdateAAIGenericVnfTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/UpdateAAIGenericVnfTest.java
@@ -59,7 +59,7 @@ public class UpdateAAIGenericVnfTest extends WorkflowTest {
MockPatchGenericVnf("skask");
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", "999-99-9999");
variables.put("isDebugLogEnabled","true");
variables.put("UpdateAAIGenericVnfRequest", updateAAIGenericVnfRequest);
@@ -92,7 +92,7 @@ public class UpdateAAIGenericVnfTest extends WorkflowTest {
MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", "999-99-9999");
variables.put("isDebugLogEnabled","true");
variables.put("UpdateAAIGenericVnfRequest", updateAAIGenericVnfRequest);
@@ -122,7 +122,7 @@ public class UpdateAAIGenericVnfTest extends WorkflowTest {
MockGetGenericVnfById_404("skask[?]depth=1");
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", "999-99-9999");
variables.put("isDebugLogEnabled","true");
variables.put("UpdateAAIGenericVnfRequest", updateAAIGenericVnfRequest);
@@ -156,7 +156,7 @@ public class UpdateAAIGenericVnfTest extends WorkflowTest {
MockAAIVfModuleBadPatch("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask", 404);
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", "999-99-9999");
variables.put("isDebugLogEnabled","true");
variables.put("UpdateAAIGenericVnfRequest", updateAAIGenericVnfRequest);
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/UpdateAAIVfModuleTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/UpdateAAIVfModuleTest.java
index 0e523cbfa3..30d7e6d8c6 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/UpdateAAIVfModuleTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/UpdateAAIVfModuleTest.java
@@ -58,7 +58,7 @@ public class UpdateAAIVfModuleTest extends WorkflowTest {
MockPatchVfModuleId("skask", "supercool");
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", "999-99-9999");
variables.put("isDebugLogEnabled","true");
variables.put("UpdateAAIVfModuleRequest", updateAAIVfModuleRequest);
@@ -89,7 +89,7 @@ public class UpdateAAIVfModuleTest extends WorkflowTest {
MockGetGenericVnfById("/skask/vf-modules/vf-module/.*", "VfModularity/VfModule-supercool.xml", 404);
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", "999-99-9999");
variables.put("isDebugLogEnabled","true");
variables.put("UpdateAAIVfModuleRequest", updateAAIVfModuleRequest);
@@ -122,7 +122,7 @@ public class UpdateAAIVfModuleTest extends WorkflowTest {
MockAAIVfModuleBadPatch("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/supercool", 404);
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", "999-99-9999");
variables.put("isDebugLogEnabled","true");
variables.put("UpdateAAIVfModuleRequest", updateAAIVfModuleRequest);
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/VnfAdapterRestV1Test.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/VnfAdapterRestV1Test.java
index 707fe46cc1..fb029fa740 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/VnfAdapterRestV1Test.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/VnfAdapterRestV1Test.java
@@ -241,7 +241,7 @@ public class VnfAdapterRestV1Test extends WorkflowTest {
String request = CREATE_VF_MODULE_REQUEST.replace("{{MESSAGE-ID}}", messageId);
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", requestId);
variables.put("isDebugLogEnabled", "true");
variables.put("vnfAdapterRestV1Request", request);
@@ -272,7 +272,7 @@ public class VnfAdapterRestV1Test extends WorkflowTest {
String request = UPDATE_VF_MODULE_REQUEST.replace("{{MESSAGE-ID}}", messageId);
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", requestId);
variables.put("isDebugLogEnabled", "true");
variables.put("vnfAdapterRestV1Request", request);
@@ -303,7 +303,7 @@ public class VnfAdapterRestV1Test extends WorkflowTest {
String request = DELETE_VF_MODULE_REQUEST.replace("{{MESSAGE-ID}}", messageId);
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", requestId);
variables.put("isDebugLogEnabled", "true");
variables.put("vnfAdapterRestV1Request", request);
@@ -334,7 +334,7 @@ public class VnfAdapterRestV1Test extends WorkflowTest {
String request = ROLLBACK_VF_MODULE_REQUEST.replace("{{MESSAGE-ID}}", messageId);
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", requestId);
variables.put("isDebugLogEnabled", "true");
variables.put("vnfAdapterRestV1Request", request);
@@ -365,7 +365,7 @@ public class VnfAdapterRestV1Test extends WorkflowTest {
String request = CREATE_VF_MODULE_REQUEST.replace("{{MESSAGE-ID}}", messageId);
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", requestId);
variables.put("isDebugLogEnabled", "true");
variables.put("vnfAdapterRestV1Request", request);
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java
index 426bceef4b..5f91298958 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java
@@ -42,7 +42,7 @@ public class WorkflowAsyncResourceTest extends WorkflowTest {
//it can be any request which asynchronously processed by the workflow
String request = "<aetgt:CreateTenantRequest xmlns:aetgt=\"http://org.openecomp/mso/workflow/schema/v1\" xmlns:sdncadapterworkflow=\"http://org.openecomp/mso/workflow/schema/v1\" xmlns:ns5=\"http://org.openecomp/mso/request/types/v1\"> <msoservtypes:service-information xmlns:msoservtypes=\"http://org.openecomp/mso/request/types/v1\"> <msoservtypes:service-type>SDN-ETHERNET-INTERNET</msoservtypes:service-type> <msoservtypes:service-instance-id>HI/VLXM/950604//SW_INTERNET</msoservtypes:service-instance-id> <msoservtypes:subscriber-name>SubName01</msoservtypes:subscriber-name> </msoservtypes:service-information> </aetgt:CreateTenantRequest>";
- Map<String,String> variables = new HashMap<String,String>();
+ Map<String,String> variables = new HashMap<>();
variables.put("testAsyncRequestMsg", request);
variables.put("mso-request-id", UUID.randomUUID().toString());
variables.put("mso-service-request-timeout", "5");
@@ -56,17 +56,17 @@ public class WorkflowAsyncResourceTest extends WorkflowTest {
WorkflowAsyncResource workflowResource = new WorkflowAsyncResource();
VariableMapImpl variableMap = new VariableMapImpl();
- Map<String, Object> variableValueType = new HashMap<String, Object>();
+ Map<String, Object> variableValueType = new HashMap<>();
- Map<String, Object> requestMsg = new HashMap<String, Object>();
+ Map<String, Object> requestMsg = new HashMap<>();
requestMsg.put("value", request);
requestMsg.put("type", "String");
- Map<String, Object> msorequestId = new HashMap<String, Object>();
+ Map<String, Object> msorequestId = new HashMap<>();
msorequestId.put("type", "String");
msorequestId.put("value",requestId);
- Map<String, Object> timeout = new HashMap<String, Object>();
+ Map<String, Object> timeout = new HashMap<>();
timeout.put("type", "String");
timeout.put("value","5");
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java
index ce8eb7afec..b71f708797 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java
@@ -327,7 +327,7 @@ public class WorkflowTest {
String businessKey, String request, Map<String, Object> injectedVariables,
boolean serviceInstantiationModel) {
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
// These variables may be overridded by injected variables.
variables.put("mso-service-request-timeout", "180");
@@ -422,7 +422,7 @@ public class WorkflowTest {
* @return a VariableMap
*/
private VariableMapImpl createVariableMapImpl(Map<String, Object> variables) {
- Map<String, Object> wrappedVariables = new HashMap<String, Object>();
+ Map<String, Object> wrappedVariables = new HashMap<>();
for (String key : variables.keySet()) {
Object value = variables.get(key);
@@ -441,7 +441,7 @@ public class WorkflowTest {
* @return the wrapped variable
*/
private Map<String, Object> wrapVariableValue(Object value) {
- HashMap<String, Object> valueMap = new HashMap<String, Object>();
+ HashMap<String, Object> valueMap = new HashMap<>();
valueMap.put("value", value);
return valueMap;
}
@@ -1634,11 +1634,7 @@ public class WorkflowTest {
return null;
}
- Collections.sort(processInstanceList, new Comparator<HistoricProcessInstance>() {
- public int compare(HistoricProcessInstance m1, HistoricProcessInstance m2) {
- return m1.getStartTime().compareTo(m2.getStartTime());
- }
- });
+ processInstanceList.sort((m1, m2) -> m1.getStartTime().compareTo(m2.getStartTime()));
HistoricProcessInstance processInstance = processInstanceList.get(0);
@@ -1672,11 +1668,7 @@ public class WorkflowTest {
return null;
}
- Collections.sort(processInstanceList, new Comparator<HistoricProcessInstance>() {
- public int compare(HistoricProcessInstance m1, HistoricProcessInstance m2) {
- return m1.getStartTime().compareTo(m2.getStartTime());
- }
- });
+ processInstanceList.sort((m1, m2) -> m1.getStartTime().compareTo(m2.getStartTime()));
HistoricProcessInstance processInstance = processInstanceList.get(subflowInstanceIndex);
@@ -1784,7 +1776,7 @@ public class WorkflowTest {
* An object that contains callback data for a "program".
*/
public class CallbackSet {
- private final Map<String, CallbackData> map = new HashMap<String, CallbackData>();
+ private final Map<String, CallbackData> map = new HashMap<>();
/**
* Add untyped callback data to the set.
@@ -1983,8 +1975,8 @@ public class WorkflowTest {
* A NamespaceContext class based on a Map.
*/
private class SimpleNamespaceContext implements NamespaceContext {
- private Map<String, String> prefixMap = new HashMap<String, String>();
- private Map<String, String> uriMap = new HashMap<String, String>();
+ private Map<String, String> prefixMap = new HashMap<>();
+ private Map<String, String> uriMap = new HashMap<>();
public synchronized void add(String prefix, String uri) {
prefixMap.put(prefix, uri);
@@ -1998,7 +1990,7 @@ public class WorkflowTest {
@Override
public Iterator<String> getPrefixes(String uri) {
- List<String> list = new ArrayList<String>();
+ List<String> list = new ArrayList<>();
String prefix = uriMap.get(uri);
if (prefix != null) {
list.add(prefix);
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/MockResource.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/MockResource.java
index fc97e69c5c..74f50ba438 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/MockResource.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/MockResource.java
@@ -45,7 +45,7 @@ public class MockResource {
private boolean started = false;
private final Integer defaultPort = 28090;
private WireMockServer wireMockServer = null;
- private static Map<String,String> mockProperties = new HashMap<String,String>();
+ private static Map<String,String> mockProperties = new HashMap<>();
public static String getMockProperties(String key) {
return mockProperties.get(key);
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/MockResourceApplication.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/MockResourceApplication.java
index ebbfea5cd1..ba48bffca0 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/MockResourceApplication.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/MockResourceApplication.java
@@ -31,8 +31,8 @@ import javax.ws.rs.core.Application;
@ApplicationPath("/console")
public class MockResourceApplication extends Application {
- private Set<Object> singletons = new HashSet<Object>();
- private Set<Class<?>> classes = new HashSet<Class<?>>();
+ private Set<Object> singletons = new HashSet<>();
+ private Set<Class<?>> classes = new HashSet<>();
public MockResourceApplication() {
singletons.add(new MockResource());
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseDatabase.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseDatabase.java
index c9f64d9b26..ffa6701a89 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseDatabase.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseDatabase.java
@@ -98,5 +98,13 @@ public class StubResponseDatabase {
.withBodyFile(responseFile)));
}
+ public static void MockGetServiceResourcesCatalogDataByModelUuid(String serviceModelUuid, String responseFile){
+ stubFor(get(urlEqualTo("/v2/serviceResources?serviceModelUuid=" + serviceModelUuid))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "application/json")
+ .withBodyFile(responseFile)));
+ }
+
}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/ResponseExceptionMapperImplTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/ResponseExceptionMapperImplTest.java
new file mode 100644
index 0000000000..8943014ad0
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/ResponseExceptionMapperImplTest.java
@@ -0,0 +1,111 @@
+/*-
+ * ============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.client;
+
+import static org.assertj.core.api.Assertions.assertThatCode;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import com.google.common.base.Charsets;
+import javax.ws.rs.BadRequestException;
+import javax.ws.rs.ForbiddenException;
+import javax.ws.rs.InternalServerErrorException;
+import javax.ws.rs.NotAcceptableException;
+import javax.ws.rs.NotAllowedException;
+import javax.ws.rs.NotAuthorizedException;
+import javax.ws.rs.NotFoundException;
+import javax.ws.rs.NotSupportedException;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.client.ClientResponseContext;
+import javax.ws.rs.core.Response.Status;
+import junitparams.JUnitParamsRunner;
+import junitparams.Parameters;
+import org.apache.commons.io.IOUtils;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(JUnitParamsRunner.class)
+public class ResponseExceptionMapperImplTest {
+
+ private static final ResponseExceptionMapperImpl mapper = new ResponseExceptionMapperImpl();
+
+ public static Object[][] statusesAndCorrespondingExceptions() {
+ return new Object[][]{
+ {Status.BAD_REQUEST, BadRequestException.class},
+ {Status.UNAUTHORIZED, NotAuthorizedException.class},
+ {Status.FORBIDDEN, ForbiddenException.class},
+ {Status.NOT_FOUND, NotFoundException.class},
+ {Status.METHOD_NOT_ALLOWED, NotAllowedException.class},
+ {Status.NOT_ACCEPTABLE, NotAcceptableException.class},
+ {Status.PRECONDITION_FAILED, PreconditionFailedException.class},
+ {Status.UNSUPPORTED_MEDIA_TYPE, NotSupportedException.class},
+ {Status.INTERNAL_SERVER_ERROR, InternalServerErrorException.class},
+ {Status.SERVICE_UNAVAILABLE, WebApplicationException.class},
+ {Status.BAD_GATEWAY, WebApplicationException.class},
+ };
+ }
+
+ @Test
+ @Parameters(method = "statusesAndCorrespondingExceptions")
+ public void shouldThrowExceptionWhenStatusIsNotOk(Status status, Class<Exception> expectedException) {
+ // given
+ ClientResponseContext responseContext = createMockResponseContext(status);
+ // when, then
+ assertThatThrownBy(() -> mapper.filter(null, responseContext)).isInstanceOf(expectedException);
+ }
+
+ @Test
+ public void shouldNotThrowExceptionWhenStatusIsOk() {
+ // given
+ ClientResponseContext responseContext = createMockResponseContext(Status.OK);
+ // when, then
+ assertThatCode(() -> mapper.filter(null, responseContext)).doesNotThrowAnyException();
+ }
+
+ @Test
+ public void shouldThrowExceptionWithCustomMessageWhenResponseHasEntity() {
+ // given
+ ClientResponseContext responseContext = createMockResponseContext(Status.BAD_REQUEST);
+ when(responseContext.hasEntity()).thenReturn(true);
+ when(responseContext.getEntityStream()).thenReturn(IOUtils.toInputStream("test message", Charsets.UTF_8));
+ // when, then
+ assertThatThrownBy(() -> mapper.filter(null, responseContext)).isInstanceOf(BadRequestException.class)
+ .hasMessage("test message");
+ }
+
+ @Test
+ public void shouldThrowExceptionWithDefaultMessageWhenResponseHasNoEntity() {
+ // given
+ ClientResponseContext responseContext = createMockResponseContext(Status.BAD_REQUEST);
+ when(responseContext.hasEntity()).thenReturn(false);
+ // when, then
+ assertThatThrownBy(() -> mapper.filter(null, responseContext)).isInstanceOf(BadRequestException.class)
+ .hasMessage("empty message");
+ }
+
+ private static ClientResponseContext createMockResponseContext(Status status) {
+ ClientResponseContext responseContext = mock(ClientResponseContext.class);
+ when(responseContext.getStatusInfo()).thenReturn(status);
+ when(responseContext.getStatus()).thenReturn(status.getStatusCode());
+ return responseContext;
+ }
+} \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerSupportTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerSupportTest.java
new file mode 100644
index 0000000000..0a323e43d8
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerSupportTest.java
@@ -0,0 +1,83 @@
+/*-
+ * ============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.client.appc;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import junitparams.JUnitParamsRunner;
+import junitparams.Parameters;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openecomp.appc.client.lcm.model.Status;
+import org.openecomp.mso.client.appc.ApplicationControllerSupport.StatusCategory;
+
+@RunWith(JUnitParamsRunner.class)
+public class ApplicationControllerSupportTest {
+
+ public static Object[][] statusesAndCategories() {
+ return new Object[][]{
+ {100, StatusCategory.NORMAL},
+ {200, StatusCategory.ERROR},
+ {300, StatusCategory.ERROR},
+ {400, StatusCategory.NORMAL},
+ {401, StatusCategory.ERROR},
+ {500, StatusCategory.NORMAL},
+ {501, StatusCategory.ERROR},
+ {502, StatusCategory.WARNING},
+ {800, StatusCategory.WARNING},
+ };
+ }
+
+ public static Object[][] statusesAndFinalities() {
+ return new Object[][]{
+ {100, false},
+ {200, true},
+ {300, true},
+ {400, true},
+ {500, false},
+ {800, true},
+ };
+ }
+
+ @Test
+ @Parameters(method = "statusesAndCategories")
+ public void shouldReturnCategoryForCode(int code, StatusCategory category) throws Exception {
+ // when
+ StatusCategory detectedCategory = ApplicationControllerSupport.getCategoryOf(createStatus(code));
+ // then
+ assertThat(detectedCategory).isEqualTo(category);
+ }
+
+ @Test
+ @Parameters(method = "statusesAndFinalities")
+ public void shouldReturnFinalityForCode(int code, boolean expectedFinality) throws Exception {
+ // when
+ boolean finality = ApplicationControllerSupport.getFinalityOf(createStatus(code));
+ // then
+ assertThat(finality).isEqualTo(expectedFinality);
+ }
+
+ private Status createStatus(int code) {
+ Status status = new Status();
+ status.setCode(code);
+ return status;
+ }
+} \ No newline at end of file