@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 shouldCreateTimerGivenTheAttributeMapIfOnlyOnChangesIsNotCheckedInUI() { HashMap<String, String> mapOfTimerValues = new HashMap<String, String>(); mapOfTimerValues.put(TimerConfig.TIMER_SPEC, "0 0 * * * ?"); mapOfTimerValues.put(TimerConfig.TIMER_ONLY_ON_CHANGES, "0"); TimerConfig timer = TimerConfig.createTimer(mapOfTimerValues); assertThat(timer.getTimerSpec(), is("0 0 * * * ?")); assertThat(timer.getOnlyOnChanges(), is(false)); }