use of org.onap.so.db.catalog.beans.macro.RainyDayHandlerStatus in project so by onap.
the class ExecuteBuildingBlockRainyDayTest method queryRainyDayTableRollbackToCreated.
@Test
public void queryRainyDayTableRollbackToCreated() throws Exception {
customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
serviceInstance.getModelInfoServiceInstance().setServiceType("st1");
vnf.setVnfType("vnft1");
delegateExecution.setVariable("aLaCarte", true);
delegateExecution.setVariable("suppressRollback", false);
delegateExecution.setVariable("WorkflowExceptionCode", "7000");
RainyDayHandlerStatus rainyDayHandlerStatus = new RainyDayHandlerStatus();
rainyDayHandlerStatus.setErrorCode("7000");
rainyDayHandlerStatus.setFlowName("AssignServiceInstanceBB");
rainyDayHandlerStatus.setServiceType("st1");
rainyDayHandlerStatus.setVnfType("vnft1");
rainyDayHandlerStatus.setPolicy("RollbackToCreated");
rainyDayHandlerStatus.setWorkStep(ASTERISK);
rainyDayHandlerStatus.setSecondaryPolicy("Abort");
doReturn(rainyDayHandlerStatus).when(MOCK_catalogDbClient).getRainyDayHandlerStatus("AssignServiceInstanceBB", "st1", "vnft1", "7000", "*", "errorMessage", "*");
executeBuildingBlockRainyDay.queryRainyDayTable(delegateExecution, true);
assertEquals("RollbackToCreated", delegateExecution.getVariable("handlingCode"));
assertEquals(Status.ROLLED_BACK_TO_CREATED.toString(), delegateExecution.getVariable("rollbackTargetState"));
}
use of org.onap.so.db.catalog.beans.macro.RainyDayHandlerStatus in project so by onap.
the class ExecuteBuildingBlockRainyDayTest method queryRainyDayTableExists.
@Test
public void queryRainyDayTableExists() throws Exception {
customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
serviceInstance.getModelInfoServiceInstance().setServiceType("st1");
vnf.setVnfType("vnft1");
delegateExecution.setVariable("aLaCarte", true);
delegateExecution.setVariable("suppressRollback", false);
delegateExecution.setVariable("WorkflowExceptionCode", "7000");
RainyDayHandlerStatus rainyDayHandlerStatus = new RainyDayHandlerStatus();
rainyDayHandlerStatus.setErrorCode("7000");
rainyDayHandlerStatus.setFlowName("AssignServiceInstanceBB");
rainyDayHandlerStatus.setServiceType("st1");
rainyDayHandlerStatus.setVnfType("vnft1");
rainyDayHandlerStatus.setPolicy("Rollback");
rainyDayHandlerStatus.setWorkStep(ASTERISK);
doReturn(rainyDayHandlerStatus).when(MOCK_catalogDbClient).getRainyDayHandlerStatus("AssignServiceInstanceBB", "st1", "vnft1", "7000", "*", "errorMessage", "*");
executeBuildingBlockRainyDay.queryRainyDayTable(delegateExecution, true);
assertEquals("Rollback", delegateExecution.getVariable("handlingCode"));
}
use of org.onap.so.db.catalog.beans.macro.RainyDayHandlerStatus in project so by onap.
the class ExecuteBuildingBlockRainyDayTest method queryRainyDayTableSecondaryPolicyExists.
@Test
public void queryRainyDayTableSecondaryPolicyExists() throws Exception {
customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
serviceInstance.getModelInfoServiceInstance().setServiceType("st1");
vnf.setVnfType("vnft1");
delegateExecution.setVariable("aLaCarte", true);
delegateExecution.setVariable("suppressRollback", false);
delegateExecution.setVariable("WorkflowExceptionCode", "7000");
RainyDayHandlerStatus rainyDayHandlerStatus = new RainyDayHandlerStatus();
rainyDayHandlerStatus.setErrorCode("7000");
rainyDayHandlerStatus.setFlowName("AssignServiceInstanceBB");
rainyDayHandlerStatus.setServiceType("st1");
rainyDayHandlerStatus.setVnfType("vnft1");
rainyDayHandlerStatus.setPolicy("Retry");
rainyDayHandlerStatus.setWorkStep(ASTERISK);
rainyDayHandlerStatus.setSecondaryPolicy("Abort");
doReturn(rainyDayHandlerStatus).when(MOCK_catalogDbClient).getRainyDayHandlerStatus("AssignServiceInstanceBB", "st1", "vnft1", "7000", "*", "errorMessage", "*");
executeBuildingBlockRainyDay.queryRainyDayTable(delegateExecution, false);
assertEquals("Abort", delegateExecution.getVariable("handlingCode"));
}
use of org.onap.so.db.catalog.beans.macro.RainyDayHandlerStatus in project so by onap.
the class ExecuteBuildingBlockRainyDayTest method queryRainyDayTableDefault.
@Test
public void queryRainyDayTableDefault() throws Exception {
customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
serviceInstance.getModelInfoServiceInstance().setServiceType("st1");
vnf.setVnfType("vnft1");
delegateExecution.setVariable("aLaCarte", true);
delegateExecution.setVariable("suppressRollback", false);
delegateExecution.setVariable("WorkflowExceptionCode", ASTERISK);
RainyDayHandlerStatus rainyDayHandlerStatus = new RainyDayHandlerStatus();
rainyDayHandlerStatus.setErrorCode(ASTERISK);
rainyDayHandlerStatus.setFlowName("AssignServiceInstanceBB");
rainyDayHandlerStatus.setServiceType(ASTERISK);
rainyDayHandlerStatus.setVnfType(ASTERISK);
rainyDayHandlerStatus.setPolicy("Rollback");
rainyDayHandlerStatus.setWorkStep(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"));
}
use of org.onap.so.db.catalog.beans.macro.RainyDayHandlerStatus in project so by onap.
the class ExecuteBuildingBlockRainyDayTest method queryRainyDayTableRollbackToAssignedALaCarte.
@Test
public void queryRainyDayTableRollbackToAssignedALaCarte() throws Exception {
customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
serviceInstance.getModelInfoServiceInstance().setServiceType("st1");
vnf.setVnfType("vnft1");
delegateExecution.setVariable("aLaCarte", true);
delegateExecution.setVariable("suppressRollback", false);
delegateExecution.setVariable("WorkflowExceptionCode", "7000");
RainyDayHandlerStatus rainyDayHandlerStatus = new RainyDayHandlerStatus();
rainyDayHandlerStatus.setErrorCode("7000");
rainyDayHandlerStatus.setFlowName("AssignServiceInstanceBB");
rainyDayHandlerStatus.setServiceType("st1");
rainyDayHandlerStatus.setVnfType("vnft1");
rainyDayHandlerStatus.setPolicy("RollbackToAssigned");
rainyDayHandlerStatus.setWorkStep(ASTERISK);
rainyDayHandlerStatus.setSecondaryPolicy("Abort");
doReturn(rainyDayHandlerStatus).when(MOCK_catalogDbClient).getRainyDayHandlerStatus("AssignServiceInstanceBB", "st1", "vnft1", "7000", "*", "errorMessage", "*");
executeBuildingBlockRainyDay.queryRainyDayTable(delegateExecution, true);
assertEquals("RollbackToAssigned", delegateExecution.getVariable("handlingCode"));
assertEquals(Status.ROLLED_BACK_TO_ASSIGNED.toString(), delegateExecution.getVariable("rollbackTargetState"));
}
Aggregations