### Question:
AppcRunTasks { protected void mapRollbackVariables(BuildingBlockExecution execution, Action action, String appcCode) { if ("0".equals(appcCode) && action != null) { if (action.equals(Action.Lock)) { execution.setVariable(ROLLBACK_VNF_LOCK, true); } else if (action.equals(Action.Unlock)) { execution.setVariable(ROLLBACK_VNF_LOCK, false); } else if (action.equals(Action.Start)) { execution.setVariable(ROLLBACK_VNF_STOP, false); } else if (action.equals(Action.Stop)) { execution.setVariable(ROLLBACK_VNF_STOP, true); } else if (action.equals(Action.QuiesceTraffic)) { execution.setVariable(ROLLBACK_QUIESCE_TRAFFIC, true); } else if (action.equals(Action.ResumeTraffic)) { execution.setVariable(ROLLBACK_QUIESCE_TRAFFIC, false); } } }  void preProcessActivity(BuildingBlockExecution execution); void runAppcCommand(BuildingBlockExecution execution, Action action); static final String ROLLBACK_VNF_STOP; static final String ROLLBACK_VNF_LOCK; static final String ROLLBACK_QUIESCE_TRAFFIC; static final String CONTROLLER_TYPE_DEFAULT; static final String GENERIC_APPC_ERROR_CODE; }### Answer:
@Test public void mapRollbackVariablesTest() { BuildingBlockExecution mock = mock(BuildingBlockExecution.class); appcRunTasks.mapRollbackVariables(mock, Action.Lock, "1"); verify(mock, times(0)).setVariable(any(String.class), any()); appcRunTasks.mapRollbackVariables(mock, Action.Lock, "0"); verify(mock, times(1)).setVariable("rollbackVnfLock", true); appcRunTasks.mapRollbackVariables(mock, Action.Unlock, "0"); verify(mock, times(1)).setVariable("rollbackVnfLock", false); appcRunTasks.mapRollbackVariables(mock, Action.Start, "0"); verify(mock, times(1)).setVariable("rollbackVnfStop", false); appcRunTasks.mapRollbackVariables(mock, Action.Stop, "0"); verify(mock, times(1)).setVariable("rollbackVnfStop", true); appcRunTasks.mapRollbackVariables(mock, Action.QuiesceTraffic, "0"); verify(mock, times(1)).setVariable("rollbackQuiesceTraffic", true); appcRunTasks.mapRollbackVariables(mock, Action.ResumeTraffic, "0"); verify(mock, times(1)).setVariable("rollbackQuiesceTraffic", false); }