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);
}
Aggregations