@Test public void testShouldUpdateStateWhenStateIsProvided() { final State state = getState(); final State expectedState = new State(); when(stateRepository.save(state)).thenReturn(expectedState); final State actualState = stateService.update(state); assertEquals(expectedState, actualState); }
@Transactional public State update(final State state) { return stateRepository.save(state); }
StateService { @Transactional public State update(final State state) { return stateRepository.save(state); } }
StateService { @Transactional public State update(final State state) { return stateRepository.save(state); } @Autowired  StateService(final StateRepository stateRepository); }
StateService { @Transactional public State update(final State state) { return stateRepository.save(state); } @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 { @Transactional public State update(final State state) { return stateRepository.save(state); } @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);  }