@Test
public void testNotSharedBucket() {

    TokenBucketAdmissionController controller = new TokenBucketAdmissionController(
            Collections.singletonList(NOT_SHARED_CONFIGURATION),
            titusRuntime
    );
    AdmissionControllerRequest user1Request = AdmissionControllerRequest.newBuilder()
            .withCallerId("myUser1")
            .withEndpointName("any")
            .build();
    AdmissionControllerRequest user2Request = AdmissionControllerRequest.newBuilder()
            .withCallerId("myUser2")
            .withEndpointName("any")
            .build();
    // We assume the loop below will complete in a sec so we account for single refill only.
    int limit = NOT_SHARED_CONFIGURATION.getCapacity() + NOT_SHARED_CONFIGURATION.getRefillRateInSec() + 1;
    int stoppedAt = 0;
    while (stoppedAt < limit) {
        AdmissionControllerResponse response1 = controller.apply(user1Request);
        AdmissionControllerResponse response2 = controller.apply(user2Request);
        if (response1.isAllowed() && response2.isAllowed()) {
            stoppedAt++;
        } else {
            break;
        }
    }
    assertThat(stoppedAt).isGreaterThanOrEqualTo(NOT_SHARED_CONFIGURATION.getCapacity());
    assertThat(stoppedAt).isLessThan(limit);
}