@Test public void shouldUpdateAnExistingSchedule() throws Exception { ProcessingSchedule processingSchedule = new ProcessingSchedule("testScheduleCode", "testScheduleName"); repository.update(processingSchedule); verify(processingScheduleMapper).update(processingSchedule); }
public void update(ProcessingSchedule processingSchedule) { processingSchedule.validate(); try { processingScheduleMapper.update(processingSchedule); } catch (DuplicateKeyException duplicateKeyException) { throw new DataException("error.schedule.code.exist"); } }
ProcessingScheduleRepository { public void update(ProcessingSchedule processingSchedule) { processingSchedule.validate(); try { processingScheduleMapper.update(processingSchedule); } catch (DuplicateKeyException duplicateKeyException) { throw new DataException("error.schedule.code.exist"); } } }
ProcessingScheduleRepository { public void update(ProcessingSchedule processingSchedule) { processingSchedule.validate(); try { processingScheduleMapper.update(processingSchedule); } catch (DuplicateKeyException duplicateKeyException) { throw new DataException("error.schedule.code.exist"); } } @Autowired  ProcessingScheduleRepository(ProcessingScheduleMapper processingScheduleMapper); }
ProcessingScheduleRepository { public void update(ProcessingSchedule processingSchedule) { processingSchedule.validate(); try { processingScheduleMapper.update(processingSchedule); } catch (DuplicateKeyException duplicateKeyException) { throw new DataException("error.schedule.code.exist"); } } @Autowired  ProcessingScheduleRepository(ProcessingScheduleMapper processingScheduleMapper); List<ProcessingSchedule> getAll(); void create(ProcessingSchedule processingSchedule); ProcessingSchedule get(Long id); void update(ProcessingSchedule processingSchedule); ProcessingSchedule getByCode(String code); }
ProcessingScheduleRepository { public void update(ProcessingSchedule processingSchedule) { processingSchedule.validate(); try { processingScheduleMapper.update(processingSchedule); } catch (DuplicateKeyException duplicateKeyException) { throw new DataException("error.schedule.code.exist"); } } @Autowired  ProcessingScheduleRepository(ProcessingScheduleMapper processingScheduleMapper); List<ProcessingSchedule> getAll(); void create(ProcessingSchedule processingSchedule); ProcessingSchedule get(Long id); void update(ProcessingSchedule processingSchedule); ProcessingSchedule getByCode(String code);  }