@Test public void saveValidBreakTime() { when(breakTimeRepo.save(validBreakTime)).thenReturn(validBreakTime); assertEquals(validBreakTime, breakTimeService.save(validBreakTime)); }
@Override public BreakTime save(BreakTime breakTime) { log.info(LogMessage.IN_SAVE, breakTime); if (breakTime.getEndTime().getHour() < breakTime.getStartTime().getHour()) { throw new BadRequestException(ErrorMessage.END_TIME_LATE_THAN_START_TIME); } return repo.save(breakTime); }
BreakTimeServiceImpl implements BreakTimeService { @Override public BreakTime save(BreakTime breakTime) { log.info(LogMessage.IN_SAVE, breakTime); if (breakTime.getEndTime().getHour() < breakTime.getStartTime().getHour()) { throw new BadRequestException(ErrorMessage.END_TIME_LATE_THAN_START_TIME); } return repo.save(breakTime); } }
BreakTimeServiceImpl implements BreakTimeService { @Override public BreakTime save(BreakTime breakTime) { log.info(LogMessage.IN_SAVE, breakTime); if (breakTime.getEndTime().getHour() < breakTime.getStartTime().getHour()) { throw new BadRequestException(ErrorMessage.END_TIME_LATE_THAN_START_TIME); } return repo.save(breakTime); }  }
BreakTimeServiceImpl implements BreakTimeService { @Override public BreakTime save(BreakTime breakTime) { log.info(LogMessage.IN_SAVE, breakTime); if (breakTime.getEndTime().getHour() < breakTime.getStartTime().getHour()) { throw new BadRequestException(ErrorMessage.END_TIME_LATE_THAN_START_TIME); } return repo.save(breakTime); }  @Override BreakTime save(BreakTime breakTime); @Override BreakTime findById(Long id); @Override Long deleteById(Long id); @Override List<BreakTime> findAll(); }
BreakTimeServiceImpl implements BreakTimeService { @Override public BreakTime save(BreakTime breakTime) { log.info(LogMessage.IN_SAVE, breakTime); if (breakTime.getEndTime().getHour() < breakTime.getStartTime().getHour()) { throw new BadRequestException(ErrorMessage.END_TIME_LATE_THAN_START_TIME); } return repo.save(breakTime); }  @Override BreakTime save(BreakTime breakTime); @Override BreakTime findById(Long id); @Override Long deleteById(Long id); @Override List<BreakTime> findAll();  }