Search in sources :

Example 11 with Variant

use of org.parosproxy.paros.core.scanner.Variant in project zaproxy by zaproxy.

the class SessionStructureUnitTest method shouldReturnOverridenPathTree.

@Test
void shouldReturnOverridenPathTree() throws Exception {
    // Given
    URI uri = new URI("https://www.example.com/path?a=b", true);
    HttpMessage msg = new HttpMessage(uri);
    Variant variant = new PathTreeVariant();
    factory.addVariant(variant.getClass());
    List<String> expectedTreePath = variant.getTreePath(msg);
    // When
    List<String> actualTreePath = SessionStructure.getTreePath(model, msg);
    // Then
    assertThat(actualTreePath.size(), is(equalTo(expectedTreePath.size())));
    for (int i = 0; i < actualTreePath.size(); i++) {
        assertThat(actualTreePath.get(i), is(equalTo(expectedTreePath.get(i))));
    }
}
Also used : Variant(org.parosproxy.paros.core.scanner.Variant) HttpMessage(org.parosproxy.paros.network.HttpMessage) URI(org.apache.commons.httpclient.URI) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) WithConfigsTest(org.zaproxy.zap.WithConfigsTest)

Aggregations

Variant (org.parosproxy.paros.core.scanner.Variant)11 Test (org.junit.jupiter.api.Test)9 WithConfigsTest (org.zaproxy.zap.WithConfigsTest)9 ScannerParam (org.parosproxy.paros.core.scanner.ScannerParam)8 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)7 HttpMessage (org.parosproxy.paros.network.HttpMessage)6 ScriptWrapper (org.zaproxy.zap.extension.script.ScriptWrapper)4 NameValuePair (org.parosproxy.paros.core.scanner.NameValuePair)3 URI (org.apache.commons.httpclient.URI)2 VariantJSONQuery (org.parosproxy.paros.core.scanner.VariantJSONQuery)2 ZapXmlConfiguration (org.zaproxy.zap.utils.ZapXmlConfiguration)2 ArrayList (java.util.ArrayList)1 ScriptException (javax.script.ScriptException)1 ValueSource (org.junit.jupiter.params.provider.ValueSource)1 VariantCookie (org.parosproxy.paros.core.scanner.VariantCookie)1 VariantCustom (org.parosproxy.paros.core.scanner.VariantCustom)1 VariantDdnPath (org.parosproxy.paros.core.scanner.VariantDdnPath)1 VariantDirectWebRemotingQuery (org.parosproxy.paros.core.scanner.VariantDirectWebRemotingQuery)1 VariantFormQuery (org.parosproxy.paros.core.scanner.VariantFormQuery)1 VariantGWTQuery (org.parosproxy.paros.core.scanner.VariantGWTQuery)1