use of org.apereo.cas.trusted.web.flow.fingerprint.ClientIpDeviceFingerprintComponentManager in project cas by apereo.
the class ClientIpDeviceFingerprintComponentManagerTests method verifyClientIpFingerprintNotFound.
@Test
public void verifyClientIpFingerprintNotFound() {
val request = new MockHttpServletRequest();
val response = new MockHttpServletResponse();
ClientInfoHolder.setClientInfo(null);
val ex = new ClientIpDeviceFingerprintComponentManager();
assertFalse(ex.extractComponent("casuser", request, response).isPresent());
}
use of org.apereo.cas.trusted.web.flow.fingerprint.ClientIpDeviceFingerprintComponentManager in project cas by apereo.
the class ClientIpDeviceFingerprintComponentManagerTests method verifyClientIpFingerprintFound.
@Test
public void verifyClientIpFingerprintFound() {
val request = new MockHttpServletRequest();
val response = new MockHttpServletResponse();
request.setRemoteAddr("1.2.3.4");
val clientInfo = new ClientInfo(request);
ClientInfoHolder.setClientInfo(clientInfo);
val ex = new ClientIpDeviceFingerprintComponentManager();
assertTrue(ex.extractComponent("casuser", request, response).isPresent());
}
Aggregations