fn memory_store_read_cache_expired()

in aws_secretsmanager_caching/src/secret_store/memory_store/mod.rs [207:221]


    fn memory_store_read_cache_expired() {
        // Set TTL to 1ms to invalidate results right after GSV retrieval to store secret value
        let mut store = MemoryStore::new(NonZeroUsize::new(10).unwrap(), Duration::from_millis(0));

        store_secret(&mut store, None, None, None);

        thread::sleep(Duration::from_millis(1));

        let secret_value_output_read = store.get_secret_value(NAME, None, None);

        match secret_value_output_read {
            Err(SecretStoreError::CacheExpired(_)) => (),
            _ => panic!("Unexpected error"),
        }
    }