@Test public void testShouldReturnStateWhenStateIdIsSpecified() { final State expectedState = new State(); expectedState.setId(1L); when(stateRepository.findByIdAndTenantId(1L,"tenantId")).thenReturn(expectedState); final State actualState = stateService.getStateByIdAndTenantId(1L,"tenantId"); assertEquals(1, actualState.getId().intValue()); assertEquals(expectedState, actualState); }
public State getStateByIdAndTenantId(final Long id, final String tenantId) { return stateRepository.findByIdAndTenantId(id,tenantId); }
StateService { public State getStateByIdAndTenantId(final Long id, final String tenantId) { return stateRepository.findByIdAndTenantId(id,tenantId); } }
StateService { public State getStateByIdAndTenantId(final Long id, final String tenantId) { return stateRepository.findByIdAndTenantId(id,tenantId); } @Autowired  StateService(final StateRepository stateRepository); }
StateService { public State getStateByIdAndTenantId(final Long id, final String tenantId) { return stateRepository.findByIdAndTenantId(id,tenantId); } @Autowired  StateService(final StateRepository stateRepository); boolean isPositionUnderWorkflow(final Long posId, final Date givenDate); List<String> getAssignedWorkflowTypeNames(List<Long> ownerIds,List<String> enabledTypes); State getStateByIdAndTenantId(final Long id, final String tenantId); @Transactional State create(final State state); @Transactional State update(final State state); }
StateService { public State getStateByIdAndTenantId(final Long id, final String tenantId) { return stateRepository.findByIdAndTenantId(id,tenantId); } @Autowired  StateService(final StateRepository stateRepository); boolean isPositionUnderWorkflow(final Long posId, final Date givenDate); List<String> getAssignedWorkflowTypeNames(List<Long> ownerIds,List<String> enabledTypes); State getStateByIdAndTenantId(final Long id, final String tenantId); @Transactional State create(final State state); @Transactional State update(final State state);  }