@Test
    void verifyOperation() throws Exception {
        val principal = mock(Principal.class);
        when(principal.getId()).thenReturn("id");
        when(principal.getAttributes()).thenReturn(Map.of("name", List.of("CAS")));
        val context = SecurityContextUtils.createSecurityContext(principal, new MockHttpServletRequest());
        assertTrue(context.getAuthentication().isAuthenticated());
        assertEquals("id", context.getAuthentication().getName());
    }
This is {@link SecurityContextUtilsTests}.

@author Misagh Moayyed
@since 7.3.0
core/cas-server-core-util-api/src/test/java/org/apereo/cas/util/spring/SecurityContextUtilsTests.java