### Question:
FlowService { public FlowLogResponse getLastFlowByResourceName(String resourceName) { checkState(!Crn.isCrn(resourceName)); LOGGER.info("Getting last flow log by resource name {}", resourceName); return conversionService.convert(flowLogDBService.getLastFlowLogByResourceCrnOrName(resourceName), FlowLogResponse.class); }  FlowLogResponse getLastFlowById(String flowId); List<FlowLogResponse> getFlowLogsByFlowId(String flowId); FlowLogResponse getLastFlowByResourceName(String resourceName); FlowLogResponse getLastFlowByResourceCrn(String resourceCrn); List<FlowLogResponse> getFlowLogsByResourceCrn(String resourceCrn); List<FlowLogResponse> getFlowLogsByResourceName(String resourceName); FlowCheckResponse getFlowChainStateByResourceCrn(String chainId, String resourceCrn); FlowCheckResponse getFlowChainState(String chainId); FlowCheckResponse getFlowChainStateSafe(Long resourceId, String chainId); FlowCheckResponse getFlowState(String flowId);  }### Answer:
@Test public void testGetLastFlowByResourceNameInvalidInput() { thrown.expect(IllegalStateException.class); underTest.getLastFlowByResourceName(Crn.fromString(STACK_CRN).toString()); }
@Test public void testGetLastFlowByResourceName() { when(flowLogDBService.getLastFlowLogByResourceCrnOrName(anyString())).thenReturn(new FlowLog()); underTest.getLastFlowByResourceName("myLittleSdx"); verify(flowLogDBService).getLastFlowLogByResourceCrnOrName(anyString()); verify(conversionService).convert(any(), eq(FlowLogResponse.class)); }