@Test
    void verifyDuoSecurityUniversalPromptCredential() throws Throwable {
        val authentication = CoreAuthenticationTestUtils.getAuthentication();
        val duoService = mock(UniversalPromptDuoSecurityAuthenticationService.class);
        when(duoService.authenticate(any(Credential.class)))
            .thenReturn(DuoSecurityAuthenticationResult.builder()
                .success(true).username(authentication.getPrincipal().getId()).build());
        val provider = mock(DuoSecurityMultifactorAuthenticationProvider.class);
        when(provider.getId()).thenReturn(DuoSecurityMultifactorAuthenticationProperties.DEFAULT_IDENTIFIER);
        when(provider.getDuoAuthenticationService()).thenReturn(duoService);
        when(provider.matches(anyString())).thenReturn(true);

        val handler = getAuthenticationHandler(provider);
        val credential = new DuoSecurityUniversalPromptCredential("token", authentication);
        credential.setProviderId(DuoSecurityMultifactorAuthenticationProperties.DEFAULT_IDENTIFIER);
        assertTrue(handler.supports(credential));

        val result = handler.authenticate(credential, mock(Service.class));
        assertNotNull(result);
    }
This is {@link DuoSecurityAuthenticationHandlerTests}.

@author Misagh Moayyed
@since 6.2.0
support/cas-server-support-duo-core/src/test/java/org/apereo/cas/adaptors/duo/authn/DuoSecurityAuthenticationHandlerTests.java