### Question:
WorkflowActionBBTasks { public void updateRequestStatusToComplete(DelegateExecution execution) { try { final String requestId = (String) execution.getVariable(G_REQUEST_ID); InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId); final String action = (String) execution.getVariable(G_ACTION); final boolean aLaCarte = (boolean) execution.getVariable(G_ALACARTE); final String resourceName = (String) execution.getVariable("resourceName"); String statusMessage = (String) execution.getVariable("StatusMessage"); String macroAction; if (statusMessage == null) { if (aLaCarte) { macroAction = "ALaCarte-" + resourceName + "-" + action + " request was executed correctly."; } else { macroAction = "Macro-" + resourceName + "-" + action + " request was executed correctly."; } } else { macroAction = statusMessage; } execution.setVariable("finalStatusMessage", macroAction); Timestamp endTime = new Timestamp(System.currentTimeMillis()); request.setEndTime(endTime); request.setFlowStatus("Successfully completed all Building Blocks"); request.setStatusMessage(macroAction); request.setProgress(100L); request.setRequestStatus("COMPLETE"); request.setLastModifiedBy("CamundaBPMN"); requestsDbListener.post(request, new DelegateExecutionImpl(execution)); requestDbclient.updateInfraActiveRequests(request); } catch (Exception ex) { workflowAction.buildAndThrowException(execution, "Error Updating Request Database", ex); } }  void selectBB(DelegateExecution execution); void updateFlowStatistics(DelegateExecution execution); void sendSyncAck(DelegateExecution execution); void sendErrorSyncAck(DelegateExecution execution); void updateRequestStatusToComplete(DelegateExecution execution); void checkRetryStatus(DelegateExecution execution); void rollbackExecutionPath(DelegateExecution execution); void postProcessingExecuteBB(DelegateExecution execution);  }### Answer:
@Test public void updateRequestStatusToCompleteTest() { String reqId = "reqId123"; execution.setVariable("mso-request-id", reqId); execution.setVariable("requestAction", "createInstance"); execution.setVariable("resourceName", "Service"); execution.setVariable("aLaCarte", true); InfraActiveRequests req = new InfraActiveRequests(); doReturn(req).when(requestsDbClient).getInfraActiveRequestbyRequestId(reqId); doNothing().when(requestsDbClient).updateInfraActiveRequests(isA(InfraActiveRequests.class)); workflowActionBBTasks.updateRequestStatusToComplete(execution); assertEquals("ALaCarte-Service-createInstance request was executed correctly.", execution.getVariable("finalStatusMessage")); }