Search in sources :

Example 1 with Extractor

use of org.forgerock.openam.authentication.modules.deviceprint.extractors.Extractor in project OpenAM by OpenRock.

the class DevicePrintServiceTest method shouldGetCurrentDevicePrint.

@Test
public void shouldGetCurrentDevicePrint() {
    //Given
    HttpServletRequest request = mock(HttpServletRequest.class);
    Set<Extractor> extractors = new HashSet<Extractor>();
    Extractor extractorOne = mock(Extractor.class);
    Extractor extractorTwo = mock(Extractor.class);
    given(extractorFactory.getExtractors()).willReturn(extractors);
    extractors.add(extractorOne);
    extractors.add(extractorTwo);
    //When
    DevicePrint devicePrint = devicePrintService.getDevicePrint(request);
    //Then
    verify(extractorOne).extractData(Matchers.<DevicePrint>anyObject(), eq(request));
    verify(extractorTwo).extractData(Matchers.<DevicePrint>anyObject(), eq(request));
    assertNotNull(devicePrint);
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) DevicePrint(org.forgerock.openam.authentication.modules.deviceprint.model.DevicePrint) Extractor(org.forgerock.openam.authentication.modules.deviceprint.extractors.Extractor) HashSet(java.util.HashSet) Test(org.testng.annotations.Test)

Aggregations

HashSet (java.util.HashSet)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 Extractor (org.forgerock.openam.authentication.modules.deviceprint.extractors.Extractor)1 DevicePrint (org.forgerock.openam.authentication.modules.deviceprint.model.DevicePrint)1 Test (org.testng.annotations.Test)1