@Test public void shouldCreateTimerGivenTheAttributeMapOnlyOnChangesIsNotPresent() { HashMap<String, String> mapOfTimerValues = new HashMap<String, String>(); mapOfTimerValues.put(TimerConfig.TIMER_SPEC, "0 0 * * * ?"); TimerConfig timer = TimerConfig.createTimer(mapOfTimerValues); assertThat(timer.getTimerSpec(), is("0 0 * * * ?")); assertThat(timer.shouldTriggerOnlyOnChanges(), is(false)); }
@Test public void shouldCreateTimerGivenTheAttributeMapIfOnlyOnChangesIsCheckedInUI() { HashMap<String, String> mapOfTimerValues = new HashMap<String, String>(); mapOfTimerValues.put(TimerConfig.TIMER_SPEC, "0 0 * * * ?"); mapOfTimerValues.put(TimerConfig.TIMER_ONLY_ON_CHANGES, "1"); TimerConfig timer = TimerConfig.createTimer(mapOfTimerValues); assertThat(timer.getTimerSpec(), is("0 0 * * * ?")); assertThat(timer.shouldTriggerOnlyOnChanges(), is(true)); }