use of org.zaproxy.zap.extension.ascan.filters.FilterResult in project zaproxy by zaproxy.
the class GenericFilterUtilityTest method testIncludeCriteriaWithMoreFilterValues.
@Test
void testIncludeCriteriaWithMoreFilterValues() {
// Given
List<String> genericFilterData = new ArrayList<>();
genericFilterData.add("Dummy");
genericFilterData.add("Dummy1");
abstractGenericScanFilter.setFilterData(genericFilterData);
Set<String> values = new HashSet<>();
values.add("Dummy");
// When
FilterResult filterResult = abstractGenericScanFilter.isFiltered(values);
// Then
assertThat(filterResult.isFiltered(), is(false));
}
use of org.zaproxy.zap.extension.ascan.filters.FilterResult in project zaproxy by zaproxy.
the class GenericFilterUtilityTest method testShouldFailWhenSameValuesInExcludeCriteria.
@Test
void testShouldFailWhenSameValuesInExcludeCriteria() {
// Given
List<String> genericFilterData = new ArrayList<>();
genericFilterData.add("Dummy");
abstractGenericScanFilter.setFilterData(genericFilterData);
abstractGenericScanFilter.setFilterCriteria(FilterCriteria.EXCLUDE);
Set<String> values = new HashSet<>();
values.add("Dummy");
// When
FilterResult filterResult = abstractGenericScanFilter.isFiltered(values);
// Then
assertThat(filterResult.isFiltered(), is(true));
}
use of org.zaproxy.zap.extension.ascan.filters.FilterResult in project zaproxy by zaproxy.
the class GenericFilterUtilityTest method testEmptyValuesInExcludeCriteria.
@Test
void testEmptyValuesInExcludeCriteria() {
// Given
List<String> genericFilterData = new ArrayList<>();
genericFilterData.add("Dummy");
abstractGenericScanFilter.setFilterData(genericFilterData);
abstractGenericScanFilter.setFilterCriteria(FilterCriteria.EXCLUDE);
Set<String> values = new HashSet<>();
// When
FilterResult filterResult = abstractGenericScanFilter.isFiltered(values);
// Then
assertThat(filterResult.isFiltered(), is(false));
}
Aggregations