@Test public void shouldGetPropertyValue() { PropertiesConfiguration conf = new PropertiesConfiguration(); conf.setProperty("sonar.timemachine.period1", "5"); assertThat(PastSnapshotFinder.getPropertyValue(conf, 1), is("5")); assertThat(PastSnapshotFinder.getPropertyValue(conf, 999), nullValue()); }
@Test public void shouldGetDefaultPropertyValue() { PropertiesConfiguration conf = new PropertiesConfiguration(); conf.setProperty("sonar.timemachine.period1", "5"); assertThat( PastSnapshotFinder.getPropertyValue(conf, 2), is(CoreProperties.TIMEMACHINE_DEFAULT_PERIOD_2)); }