### Question:
WorkflowStatusServiceImpl implements IWorkflowStatusService { @Override public GetStatusResponse getWorkflowStatus(GetStatusRequest request, DpsHeaders headers) { log.debug("Request get workflow status with parameters : {}", request); validationService.validateGetStatusRequest(request); WorkflowStatus workflowStatus = workflowStatusRepository .findWorkflowStatus(request.getWorkflowId()); if (workflowStatus == null) { throw new WorkflowNotFoundException( String.format("Workflow for workflow id - %s not found", request.getWorkflowId())); } GetStatusResponse response = GetStatusResponse.builder() .workflowStatusType(workflowStatus.getWorkflowStatusType()).build(); log.debug("Get workflow status result: {}", response); return response; }  @Override GetStatusResponse getWorkflowStatus(GetStatusRequest request, DpsHeaders headers); @Override UpdateStatusResponse updateWorkflowStatus(UpdateStatusRequest request,
      DpsHeaders headers);  }### Answer:
@Test void shouldGetWorkflowStatus() { DpsHeaders headers = getMessageHeaders(); GetStatusRequest request = GetStatusRequest.builder().workflowId(WORKFLOW_ID).build(); WorkflowStatus workflowStatus = WorkflowStatus.builder() .workflowStatusType(WorkflowStatusType.SUBMITTED) .workflowId(WORKFLOW_ID) .submittedAt(new Date()).build(); given(workflowStatusRepository.findWorkflowStatus(eq(WORKFLOW_ID))).willReturn(workflowStatus); GetStatusResponse workflowStatusResponse = workflowStatusService .getWorkflowStatus(request, headers); then(workflowStatusResponse.getWorkflowStatusType()).isEqualTo(WorkflowStatusType.SUBMITTED); InOrder inOrder = Mockito.inOrder(validationService, workflowStatusRepository); inOrder.verify(validationService).validateGetStatusRequest(request); inOrder.verify(workflowStatusRepository) .findWorkflowStatus(eq(WORKFLOW_ID)); inOrder.verifyNoMoreInteractions(); }
@Test void shouldThrowExceptionIfThereIsNoWorkflow() { DpsHeaders headers = getMessageHeaders(); GetStatusRequest request = GetStatusRequest.builder().workflowId(WORKFLOW_ID).build(); given(workflowStatusRepository.findWorkflowStatus(eq(WORKFLOW_ID))).willReturn(null); Throwable thrown = catchThrowable( () -> workflowStatusService.getWorkflowStatus(request, headers)); then(thrown).isInstanceOf(WorkflowNotFoundException.class); }