@ParameterizedTest
    @ValueSource(booleans = {true, false})
    void verifyPing(final boolean pass) throws Throwable {
        val duoClient = mock(Client.class);
        if (pass) {
            when(duoClient.healthCheck()).thenReturn(new HealthCheckResponse());
        } else {
            when(duoClient.healthCheck()).thenThrow(new RuntimeException());
        }
        val duoProperties = new DuoSecurityMultifactorAuthenticationProperties();
        val client = mock(DuoSecurityClient.class);
        when(client.getInstance()).thenReturn(duoClient);
        val service = new UniversalPromptDuoSecurityAuthenticationService(duoProperties, mock(HttpClient.class), client,
            List.of(MultifactorAuthenticationPrincipalResolver.identical()), Caffeine.newBuilder().build(),
            mock(TenantExtractor.class));
        assertNotNull(service.getDuoClient());
        assertEquals(pass, service.ping());
    }
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