PeriodicalHealthChecksConfiguration { public static Builder.RequiredPeriod builder() { return Builder.ReadyToBuild::new; } @VisibleForTesting  PeriodicalHealthChecksConfiguration(Duration period); static Builder.RequiredPeriod builder(); static PeriodicalHealthChecksConfiguration from(Configuration configuration); Duration getPeriod(); @Override final boolean equals(Object o); @Override final int hashCode(); static final PeriodicalHealthChecksConfiguration DEFAULT_CONFIGURATION; }
@Test void builderShouldThrowWhenPeriodIsNull() { assertThatThrownBy(() -> PeriodicalHealthChecksConfiguration.builder() .period(null) .build()) .isInstanceOf(NullPointerException.class); }
@Test void builderShouldThrowWhenPeriodHasIncorrectFormat() { assertThatThrownBy(() -> PeriodicalHealthChecksConfiguration.builder() .period(DurationParser.parse(RANDOM_STRING)) .build()) .isInstanceOf(NumberFormatException.class); }
@Test void builderShouldThrowWhenPeriodIsLessThanMinimalValue() { assertThatThrownBy(() -> PeriodicalHealthChecksConfiguration.builder() .period(Duration.ofSeconds(1)) .build()) .isInstanceOf(IllegalArgumentException.class); }