@ParameterizedTest
    @ValueSource(strings = "email")
    @NullAndEmptySource
    void verifyAuth(final String principalAttribute) throws Throwable {
        val state = UUID.randomUUID().toString();
        val principal = RegisteredServiceTestUtils.getPrincipal("casuser",
            Map.of("email", List.of("cas@example.org")));
        val credential = new DuoSecurityUniversalPromptCredential(state,
            RegisteredServiceTestUtils.getAuthentication(principal));
        val token = buildDuoAuthenticationToken();
        val duoProperties = new DuoSecurityMultifactorAuthenticationProperties()
            .setPrincipalAttribute(principalAttribute);
        val service = buildAuthenticationService(token, duoProperties);
        val result = service.authenticate(credential);
        assertNotNull(result);
        assertTrue(result.isSuccess());
        assertEquals("CAS", result.getUsername());
        assertNotNull(result.getAttributes());
    }
This is {@link UniversalPromptDuoSecurityAuthenticationServiceTests}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-duo/src/test/java/org/apereo/cas/adaptors/duo/authn/UniversalPromptDuoSecurityAuthenticationServiceTests.java