use of org.zaproxy.zap.extension.ascan.filters.ScanFilter in project zaproxy by zaproxy.
the class HostProcessUnitTest method shouldHandleExceptionsThrownByFilters.
@Test
void shouldHandleExceptionsThrownByFilters() {
// Given
ScanFilter scanFilter = mock(ScanFilter.class);
given(scanFilter.isFiltered(any())).willThrow(RuntimeException.class);
given(scanner.getScanFilters()).willReturn(asList(scanFilter));
StructuralNode node = createLeafNode("GET:file", "GET", "http://localhost/file");
hostProcess.setStartNode(node);
// When
hostProcess.run();
// Then
assertThat(hostProcess.getTestTotalCount(), is(equalTo(1)));
verify(scanFilter).isFiltered(node);
verify(scanner, times(0)).notifyFilteredMessage(any(), any());
}
Aggregations