@Test
public void duration() throws Exception {

    prepareConfig("1000000");
    assertEquals(1000000,
            this.config.getDuration(XenonConfigurationTest.class, this.foundProperty, Duration.ofSeconds(33)));
    assertEquals(2000,
            this.config.getDuration(XenonConfigurationTest.class, this.undefined, Duration.ofMillis(2)));
    prepareConfig("alphanumeric");
    assertEquals(10000,
            this.config.getDuration(XenonConfigurationTest.class, this.foundProperty, Duration.ofMillis(10)));
    // valid suffix, bad value
    prepareConfig("sixtym");
    assertEquals(10000,
            this.config.getDuration(XenonConfigurationTest.class, this.foundProperty, Duration.ofMillis(10)));
    prepareConfig("1h");
    assertEquals(TimeUnit.HOURS.toMicros(1),
            this.config.getDuration(XenonConfigurationTest.class, this.foundProperty, Duration.ofMillis(2)));
    prepareConfig("1m");
    assertEquals(TimeUnit.MINUTES.toMicros(1),
            this.config.getDuration(XenonConfigurationTest.class, this.foundProperty, Duration.ofMillis(2)));
    prepareConfig("1ms");
    assertEquals(TimeUnit.MILLISECONDS.toMicros(1),
            this.config.getDuration(XenonConfigurationTest.class, this.foundProperty, Duration.ofMillis(2)));
    prepareConfig("1d");
    assertEquals(TimeUnit.DAYS.toMicros(1),
            this.config.getDuration(XenonConfigurationTest.class, this.foundProperty, Duration.ofMillis(2)));
}