@Test
    public void testCachingProfile() {
        val c1 = new TokenCredentials("T1");
        val pc = new LocalCachingProfileCreator(SimpleProfileCreator.INSTANCE, 10, 1, TimeUnit.SECONDS);
        val optProfile = pc.create(new CallContext(MockWebContext.create(), new MockSessionStore()), c1);
        assertTrue(optProfile.isPresent());
        val profileId = optProfile.get().getId();
        assertEquals(profileId, pc.getStore().get(c1).get().getId());

        val optProfile2 = pc.create(new CallContext(MockWebContext.create(), new MockSessionStore()), c1);
        assertTrue(optProfile2.isPresent());
        val profileId2 = optProfile2.get().getId();
        assertEquals(profileId, pc.getStore().get(c1).get().getId());
        assertEquals(profileId, profileId2);

        TestsHelper.wait(1500);

        val optProfile3 = pc.create(new CallContext(MockWebContext.create(), new MockSessionStore()), c1);
        assertTrue(optProfile3.isPresent());
        val profileId3 = optProfile3.get().getId();
        assertEquals(profileId3, pc.getStore().get(c1).get().getId());
        assertNotEquals(profileId3, profileId2);
    }
Tests {@link LocalCachingProfileCreator}.

@author Jerome LELEU
@since 5.7.0
pac4j-core/src/test/java/org/pac4j/core/profile/creator/LocalCachingProfileCreatorTests.java