use of com.duosecurity.client.Http in project cas by apereo.
the class BasicDuoSecurityAuthenticationServiceTests method verifyGetAccountFail.
@Test
public void verifyGetAccountFail() throws Exception {
val props = casProperties.getAuthn().getMfa().getDuo().get(0);
val service = new BasicDuoSecurityAuthenticationService(props, httpClient, List.of(MultifactorAuthenticationPrincipalResolver.identical()), Caffeine.newBuilder().build()) {
private static final long serialVersionUID = 6245462449489284549L;
@Override
protected String getHttpResponse(final Http userRequest) throws Exception {
return MAPPER.writeValueAsString(Map.of("stat", "FAIL", "code", "100000"));
}
};
assertEquals(DuoSecurityUserAccountStatus.UNAVAILABLE, service.getUserAccount("casuser").getStatus());
}
Aggregations