aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/test
diff options
context:
space:
mode:
authorSmokowski, Steven <steve.smokowski@att.com>2019-05-10 10:01:06 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2019-05-10 10:26:10 -0400
commitc22110ebcc4df14891b0f3af3739a5a3fb4d51ef (patch)
tree880260bbe5c59fe2065d50a59e8536d232a75cc4 /bpmn/MSOCommonBPMN/src/test
parentb9bb7f60815cd1e07b81d72b34ea1dcb4fa8d8c9 (diff)
Update Rainy day handling to be more robust
Clean up unused tests and code, update UT Fix issue with junits and conflicts on id field Update Rainy day handling to be more robust Change-Id: I2ce9a1288457017613dece19357e44b8566867c5 Issue-ID: SO-1866 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/test')
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildlingBlockRainyDayTest.java43
1 files changed, 16 insertions, 27 deletions
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildlingBlockRainyDayTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildlingBlockRainyDayTest.java
index e8d597a823..c5da3cbd51 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildlingBlockRainyDayTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildlingBlockRainyDayTest.java
@@ -68,6 +68,8 @@ public class ExecuteBuildlingBlockRainyDayTest extends BaseTest {
delegateExecution.setVariable("WorkflowException", new WorkflowException("", 7000, ""));
delegateExecution.setVariable("buildingBlock", executeBuildingBlock);
delegateExecution.setVariable("lookupKeyMap", lookupKeyMap);
+
+ delegateExecution.setVariable("WorkflowException", new WorkflowException("processKey", 7000, "errorMessage"));
}
@Test
@@ -101,12 +103,10 @@ public class ExecuteBuildlingBlockRainyDayTest extends BaseTest {
rainyDayHandlerStatus.setPolicy("Rollback");
rainyDayHandlerStatus.setWorkStep(ASTERISK);
- doReturn(rainyDayHandlerStatus).when(MOCK_catalogDbClient)
- .getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(
- "AssignServiceInstanceBB", "st1", "vnft1", "7000", "*");
+ doReturn(rainyDayHandlerStatus).when(MOCK_catalogDbClient).getRainyDayHandlerStatus("AssignServiceInstanceBB",
+ "st1", "vnft1", "7000", "*", "errorMessage");
executeBuildingBlockRainyDay.queryRainyDayTable(delegateExecution, true);
-
assertEquals("Rollback", delegateExecution.getVariable("handlingCode"));
}
@@ -126,15 +126,9 @@ public class ExecuteBuildlingBlockRainyDayTest extends BaseTest {
rainyDayHandlerStatus.setPolicy("Rollback");
rainyDayHandlerStatus.setWorkStep(ASTERISK);
- doReturn(null).when(MOCK_catalogDbClient)
- .getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(
- "AssignServiceInstanceBB", "st1", "vnft1", "7000", ASTERISK);
- doReturn(rainyDayHandlerStatus).when(MOCK_catalogDbClient)
- .getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(
- "AssignServiceInstanceBB", ASTERISK, ASTERISK, ASTERISK, ASTERISK);
-
+ doReturn(rainyDayHandlerStatus).when(MOCK_catalogDbClient).getRainyDayHandlerStatus("AssignServiceInstanceBB",
+ "st1", "vnft1", ASTERISK, ASTERISK, "errorMessage");
executeBuildingBlockRainyDay.queryRainyDayTable(delegateExecution, true);
-
assertEquals("Rollback", delegateExecution.getVariable("handlingCode"));
assertEquals(5, delegateExecution.getVariable("maxRetries"));
}
@@ -145,9 +139,8 @@ public class ExecuteBuildlingBlockRainyDayTest extends BaseTest {
serviceInstance.getModelInfoServiceInstance().setServiceType("st1");
vnf.setVnfType("vnft1");
delegateExecution.setVariable("aLaCarte", true);
- doReturn(null).when(MOCK_catalogDbClient)
- .getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(isA(String.class),
- isA(String.class), isA(String.class), isA(String.class), isA(String.class));
+ doReturn(null).when(MOCK_catalogDbClient).getRainyDayHandlerStatus(isA(String.class), isA(String.class),
+ isA(String.class), isA(String.class), isA(String.class), isA(String.class));
delegateExecution.setVariable("suppressRollback", false);
executeBuildingBlockRainyDay.queryRainyDayTable(delegateExecution, true);
@@ -157,9 +150,8 @@ public class ExecuteBuildlingBlockRainyDayTest extends BaseTest {
@Test
public void queryRainyDayTableExceptionTest() {
- doThrow(RuntimeException.class).when(MOCK_catalogDbClient)
- .getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(isA(String.class),
- isA(String.class), isA(String.class), isA(String.class), isA(String.class));
+ doThrow(RuntimeException.class).when(MOCK_catalogDbClient).getRainyDayHandlerStatus(isA(String.class),
+ isA(String.class), isA(String.class), isA(String.class), isA(String.class), isA(String.class));
delegateExecution.setVariable("aLaCarte", true);
executeBuildingBlockRainyDay.queryRainyDayTable(delegateExecution, true);
delegateExecution.setVariable("suppressRollback", false);
@@ -184,9 +176,8 @@ public class ExecuteBuildlingBlockRainyDayTest extends BaseTest {
rainyDayHandlerStatus.setWorkStep(ASTERISK);
rainyDayHandlerStatus.setSecondaryPolicy("Abort");
- doReturn(rainyDayHandlerStatus).when(MOCK_catalogDbClient)
- .getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(
- "AssignServiceInstanceBB", "st1", "vnft1", "7000", "*");
+ doReturn(rainyDayHandlerStatus).when(MOCK_catalogDbClient).getRainyDayHandlerStatus("AssignServiceInstanceBB",
+ "st1", "vnft1", "7000", "*", "errorMessage");
executeBuildingBlockRainyDay.queryRainyDayTable(delegateExecution, false);
@@ -210,9 +201,8 @@ public class ExecuteBuildlingBlockRainyDayTest extends BaseTest {
rainyDayHandlerStatus.setWorkStep(ASTERISK);
rainyDayHandlerStatus.setSecondaryPolicy("Abort");
- doReturn(rainyDayHandlerStatus).when(MOCK_catalogDbClient)
- .getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(
- "AssignServiceInstanceBB", "st1", "vnft1", "7000", "*");
+ doReturn(rainyDayHandlerStatus).when(MOCK_catalogDbClient).getRainyDayHandlerStatus("AssignServiceInstanceBB",
+ "st1", "vnft1", "7000", "*", "errorMessage");
executeBuildingBlockRainyDay.queryRainyDayTable(delegateExecution, true);
@@ -236,9 +226,8 @@ public class ExecuteBuildlingBlockRainyDayTest extends BaseTest {
rainyDayHandlerStatus.setWorkStep(ASTERISK);
rainyDayHandlerStatus.setSecondaryPolicy("Abort");
- doReturn(rainyDayHandlerStatus).when(MOCK_catalogDbClient)
- .getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(
- "AssignServiceInstanceBB", "st1", "vnft1", "7000", "*");
+ doReturn(rainyDayHandlerStatus).when(MOCK_catalogDbClient).getRainyDayHandlerStatus("AssignServiceInstanceBB",
+ "st1", "vnft1", "7000", "*", "errorMessage");
executeBuildingBlockRainyDay.queryRainyDayTable(delegateExecution, true);