QuartzTriggerConverter extends ComponentSupport { @VisibleForTesting static String cronTimeParts(final Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); return String.format("0 %d %d", calendar.get(Calendar.MINUTE), calendar.get(Calendar.HOUR_OF_DAY)); } QuartzTriggerConverter(final ScheduleFactory scheduleFactory); TriggerBuilder convert(final Schedule schedule); Schedule convert(final Trigger trigger);  }
@Test public void verifyCronTimeParts() { Calendar cal = Calendar.getInstance(); cal.set(Calendar.HOUR_OF_DAY, 7); cal.set(Calendar.MINUTE, 15); assertThat(cronTimeParts(cal.getTime()), equalTo("0 15 7")); cal.set(Calendar.HOUR_OF_DAY, 22); cal.set(Calendar.MINUTE, 59); assertThat(cronTimeParts(cal.getTime()), equalTo("0 59 22")); cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); assertThat(cronTimeParts(cal.getTime()), equalTo("0 0 0")); }