### Question:
MonitorVnfmDeleteJobTask extends MonitorVnfmJobTask { public void getCurrentOperationStatus(final BuildingBlockExecution execution) { try { LOGGER.debug("Executing getCurrentOperationStatus ..."); final DeleteVnfResponse deleteVnfResponse = execution.getVariable(Constants.DELETE_VNF_RESPONSE_PARAM_NAME); execution.setVariable(OPERATION_STATUS_PARAM_NAME, getOperationStatus(execution, deleteVnfResponse.getJobId())); LOGGER.debug("Finished executing getCurrentOperationStatus ..."); } catch (final Exception exception) { final String message = "Unable to invoke get current Operation status"; LOGGER.error(message); exceptionUtil.buildAndThrowWorkflowException(execution, 1216, message); } } @Autowired  MonitorVnfmDeleteJobTask(final VnfmAdapterServiceProvider vnfmAdapterServiceProvider,
            final ExceptionBuilder exceptionUtil); void getCurrentOperationStatus(final BuildingBlockExecution execution); void timeOutLogFailue(final BuildingBlockExecution execution); void checkIfOperationWasSuccessful(final BuildingBlockExecution execution);  }### Answer:
@Test public void testGetCurrentOperationStatus() throws Exception { Optional<QueryJobResponse> queryJobResponse = getQueryJobResponse(); queryJobResponse.get().setOperationStatusRetrievalStatus(OperationStatusRetrievalStatusEnum.STATUS_FOUND); queryJobResponse.get().setOperationState(OperationStateEnum.COMPLETED); when(mockedVnfmAdapterServiceProvider.getInstantiateOperationJobStatus(JOB_ID)).thenReturn(queryJobResponse); objUnderTest.getCurrentOperationStatus(stubbedxecution); final Optional<OperationStateEnum> operationState = stubbedxecution.getVariable(Constants.OPERATION_STATUS_PARAM_NAME); assertNotNull(operationState); assertEquals(OperationStateEnum.COMPLETED, operationState.get()); }
@Test public void testGetCurrentOperationStatusFailed() throws Exception { Optional<QueryJobResponse> queryJobResponse = getQueryJobResponse(); queryJobResponse.get() .setOperationStatusRetrievalStatus(OperationStatusRetrievalStatusEnum.CANNOT_RETRIEVE_STATUS); queryJobResponse.get().setOperationState(OperationStateEnum.FAILED); when(mockedVnfmAdapterServiceProvider.getInstantiateOperationJobStatus(JOB_ID)).thenReturn(queryJobResponse); objUnderTest.getCurrentOperationStatus(stubbedxecution); final Optional<OperationStateEnum> operationState = stubbedxecution.getVariable(Constants.OPERATION_STATUS_PARAM_NAME); assertNotNull(operationState); assertEquals(OperationStateEnum.FAILED, operationState.get()); }
@Test public void testGetCurrentOperationStatusEmpty() throws Exception { Optional<QueryJobResponse> queryJobResponse = getQueryJobResponse(); queryJobResponse.get().setOperationStatusRetrievalStatus(OperationStatusRetrievalStatusEnum.STATUS_FOUND); when(mockedVnfmAdapterServiceProvider.getInstantiateOperationJobStatus(JOB_ID)).thenReturn(queryJobResponse); objUnderTest.getCurrentOperationStatus(stubbedxecution); final Optional<OperationStateEnum> operationState = stubbedxecution.getVariable(Constants.OPERATION_STATUS_PARAM_NAME); assertFalse(operationState.isPresent()); }
@Test public void testGetCurrentOperationStatusException() throws Exception { Optional<QueryJobResponse> queryJobResponse = getQueryJobResponse(); queryJobResponse.get().setOperationStatusRetrievalStatus(OperationStatusRetrievalStatusEnum.STATUS_FOUND); when(mockedVnfmAdapterServiceProvider.getInstantiateOperationJobStatus(JOB_ID)).thenReturn(queryJobResponse); objUnderTest.getCurrentOperationStatus(stubbedxecution); final Optional<OperationStateEnum> operationState = stubbedxecution.getVariable(Constants.OPERATION_STATUS_PARAM_NAME); assertFalse(operationState.isPresent()); }