Search in sources :

Example 1 with HealthCheckResponse

use of com.duosecurity.model.HealthCheckResponse in project cas by apereo.

the class UniversalPromptDuoSecurityAuthenticationServiceTests method verifyPing.

@Test
public void verifyPing() throws Exception {
    val duoClient = mock(Client.class);
    when(duoClient.healthCheck()).thenReturn(new HealthCheckResponse());
    val duoProperties = new DuoSecurityMultifactorAuthenticationProperties();
    val service = new UniversalPromptDuoSecurityAuthenticationService(duoProperties, mock(HttpClient.class), duoClient, List.of(MultifactorAuthenticationPrincipalResolver.identical()), Caffeine.newBuilder().build());
    assertTrue(service.getDuoClient().isPresent());
    assertTrue(service.ping());
}
Also used : lombok.val(lombok.val) DuoSecurityMultifactorAuthenticationProperties(org.apereo.cas.configuration.model.support.mfa.DuoSecurityMultifactorAuthenticationProperties) HealthCheckResponse(com.duosecurity.model.HealthCheckResponse) HttpClient(org.apereo.cas.util.http.HttpClient) Test(org.junit.jupiter.api.Test)

Aggregations

HealthCheckResponse (com.duosecurity.model.HealthCheckResponse)1 lombok.val (lombok.val)1 DuoSecurityMultifactorAuthenticationProperties (org.apereo.cas.configuration.model.support.mfa.DuoSecurityMultifactorAuthenticationProperties)1 HttpClient (org.apereo.cas.util.http.HttpClient)1 Test (org.junit.jupiter.api.Test)1