@Test
    void verifyPrincipalId() throws Throwable {
        val context = MockRequestContext.create();

        val registrationRequest = new AccountRegistrationRequest(Map.of("username", "casuser"));
        AccountRegistrationUtils.putAccountRegistrationRequestUsername(context, "casuser");
        AccountRegistrationUtils.putAccountRegistrationRequest(context, registrationRequest);

        val accountService = mock(AccountRegistrationService.class);
        val resolver = new AccountRegistrationRequestAuditPrincipalIdResolver(accountService);
        assertNotNull(resolver.getPrincipalIdFrom(mock(JoinPoint.class), RegisteredServiceTestUtils.getAuthentication(), null, null));
        assertNotNull(resolver.getPrincipalIdFrom(mock(JoinPoint.class), RegisteredServiceTestUtils.getAuthentication(), registrationRequest, null));
    }
This is {@link AccountRegistrationRequestAuditPrincipalIdResolverTests}.

@author Misagh Moayyed
@since 6.5.0
support/cas-server-support-account-mgmt/src/test/java/org/apereo/cas/acct/AccountRegistrationRequestAuditPrincipalIdResolverTests.java