package org.apereo.cas.throttle;

import org.apereo.cas.web.support.ThrottledSubmission;

import lombok.val;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

import java.time.Clock;
import java.time.ZonedDateTime;
import java.util.UUID;

import static org.junit.jupiter.api.Assertions.*;

/**
 * This is {@link ConcurrentThrottledSubmissionsStoreTests}.
 *
 * @author Misagh Moayyed
 * @since 6.5.0
 */
@Tag("AuthenticationThrottling")
public class ConcurrentThrottledSubmissionsStoreTests {
    @Test
    public void verifyOperation() {
        val store = new ConcurrentThrottledSubmissionsStore();
        val key = UUID.randomUUID().toString();
        store.put(key, ZonedDateTime.now(Clock.systemUTC()));
        assertNotNull(store.get(key));
        ThrottledSubmission a;

        assertEquals(1, store.entries().count());
        store.removeIf(entry -> entry.getKey().equals(key));
        assertEquals(0, store.entries().count());
    }
}

@@ -31,64 +31,8 @@
 e;%0A%0A
-import org.apereo.cas.web.support.ThrottledSubmission;%0A%0A
 impo
@@ -712,40 +712,8 @@
 ));%0A
-        ThrottledSubmission a;%0A%0A
     

refactor how throttled submissions are tracked in a Map