use of org.zaproxy.zap.spider.filters.FetchFilter.FetchStatus in project zaproxy by zaproxy.
the class DefaultFetchFilterUnitTest method shouldFilterOutOfScopeUriAsOutOfScope.
@Test
public void shouldFilterOutOfScopeUriAsOutOfScope() throws Exception {
// Given
filter.addScopeRegex("scope.example.com");
URI uri = createUri("http://example.com");
// When
FetchStatus status = filter.checkFilter(uri);
// Then
assertThat(status, is(equalTo(FetchStatus.OUT_OF_SCOPE)));
}
use of org.zaproxy.zap.spider.filters.FetchFilter.FetchStatus in project zaproxy by zaproxy.
the class DefaultFetchFilterUnitTest method shouldFilterAlwaysInScopeUriAsValid.
@Test
public void shouldFilterAlwaysInScopeUriAsValid() throws Exception {
// Given
filter.setDomainsAlwaysInScope(domainsAlwaysInScope("example.com"));
URI uri = createUri("https://example.com");
// When
FetchStatus status = filter.checkFilter(uri);
// Then
assertThat(status, is(equalTo(FetchStatus.VALID)));
}
use of org.zaproxy.zap.spider.filters.FetchFilter.FetchStatus in project zaproxy by zaproxy.
the class DefaultFetchFilterUnitTest method shouldFilterNonExcludedInContextUriAsValid.
@Test
public void shouldFilterNonExcludedInContextUriAsValid() throws Exception {
// Given
filter.setScanContext(contextInScope(true));
filter.setExcludeRegexes(excludeRegexes("subdomain\\.example\\.com.*"));
URI uri = createUri("http://example.com");
// When
FetchStatus status = filter.checkFilter(uri);
// Then
assertThat(status, is(equalTo(FetchStatus.VALID)));
}
use of org.zaproxy.zap.spider.filters.FetchFilter.FetchStatus in project zaproxy by zaproxy.
the class DefaultFetchFilterUnitTest method shouldFilterUriWithHttpsSchemeAsOutOfScopeByDefault.
@Test
public void shouldFilterUriWithHttpsSchemeAsOutOfScopeByDefault() throws Exception {
// Given
URI uri = createUri("https://example.com");
// When
FetchStatus status = filter.checkFilter(uri);
// Then
assertThat(status, is(equalTo(FetchStatus.OUT_OF_SCOPE)));
}
use of org.zaproxy.zap.spider.filters.FetchFilter.FetchStatus in project zaproxy by zaproxy.
the class DefaultFetchFilterUnitTest method shouldFilterInScopeUriAsValid.
@Test
public void shouldFilterInScopeUriAsValid() throws Exception {
// Given
filter.addScopeRegex("example.com");
URI uri = createUri("http://example.com");
// When
FetchStatus status = filter.checkFilter(uri);
// Then
assertThat(status, is(equalTo(FetchStatus.VALID)));
}
Aggregations