@Test
public void testQuota() {

    JobPercentagePerHourRelocationRateController quotaController = newJobPercentagePerHourRelocationRateController(
            exceptRate(REFERENCE_JOB, hourlyRatePercentage(50)),
            SelfJobDisruptionBudgetResolver.getInstance(),
            titusRuntime
    );
    assertThat(quotaController.getQuota(JOB_REFERENCE).getQuota()).isEqualTo(5);
    // Consume everything
    consumeAtInterval(quotaController, 5, TEN_MINUTES);
    assertThat(quotaController.getQuota(JOB_REFERENCE).getQuota()).isEqualTo(0);
    // Now shift time and consume again
    clock.advanceTime(TEN_MINUTES);
    clock.advanceTime(TEN_MINUTES);
    assertThat(quotaController.consume("someTaskId").isApproved()).isTrue();
    // Now move long into the future
    clock.advanceTime(Duration.ofHours(2));
    assertThat(quotaController.getQuota(JOB_REFERENCE).getQuota()).isEqualTo(5);
}