@Test
void validateRate() {

    RateControl control = new RateControl(1);
    control.config("group", 1, 1, TimeUnit.DAYS);
    control.validateRate("group", "10.0.0.1");
    assertThatThrownBy(() -> control.validateRate("group", "10.0.0.1"))
            .isInstanceOf(TooManyRequestsException.class)
            .hasMessageContaining("exceeded");
}