text
stringlengths
14
100k
source
stringclasses
1 value
repo
stringclasses
810 values
language
stringclasses
13 values
/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2023 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * Yo...
fim
zaproxy/zaproxy
java
<|fim_suffix|>operties; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.parosproxy.paros.extension.option.DatabaseParam; /** Unit test for {@link SqlTableHistory}. */ class SqlTableHistoryUnitTest { private SqlTableHistory table; ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2018 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>\",\"alert\":\"Alert Name\",\"param\":\"param\",\"attack\":\"attack\",\"name\":\"Alert Name\",\"risk\":\"Low\",\"id\":\"1\",\"alertRef\":\"1234-1\"}}"))); } @Test void shouldNotReturnFalsePositiveAlertsByDefault() throws Exception { // Given String name = "alerts"; JSO...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2025 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2025 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2016 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2017 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * Yo...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2023 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>; import static org.hamcrest.Matchers.startsWith; import java.util.Locale; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; import org.parosproxy.paros.Constant; import or...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2019 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>mport org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import org.parosproxy.paros.network.HttpMessage; import org.parosproxy.paros.network.HttpRequestHeader; ...
fim
zaproxy/zaproxy
java
<|fim_suffix|> // Given String name = null; String value = null; ApiResponseElement apiResponse = new ApiResponseElement(name, value); Document document = createDocument(); Element element = createElement(document, "response"); // When apiResponse.toXML(do...
fim
zaproxy/zaproxy
java
<|fim_suffix|>value1\"}")); list.add(new ApiResponseElement("key2", "{\"name2\":\"value2\"}")); ApiResponseList apiRespSet = new ApiResponseList("test", list); // When String jsonResponse = apiRespSet.toJSON().toString(); // Then assertEquals( jsonResponse...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2018 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>tring(), is(equalTo(parent + child))); } @Test void shouldDetectPathTraversalInChildPath() throws Exception { // Given String parent = "/tmp/test"; String child = "../file.txt"; // When ApiException e = assertThrows(ApiException.class, (...
fim
zaproxy/zaproxy
java
<|fim_suffix|>nfig(); param.setDisableKey(true); param.setKey("Key"); // When String key = param.getKey(); // Then assertThat(key, is(equalTo(""))); assertThat(param.getRealKey(), is(equalTo("Key"))); } @Test void shouldParseLoadedFileConfiguration() ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>tor api, List<? extends ApiElement> elements, RequestType type) { elements.sort((a, b) -> a.getName().compareTo(b.getName())); for (ApiElement element : elements) { assertThat( "API element: " + api.getPrefix() + "/" + element.getName(), ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2022 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2022 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2019 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * Yo...
fim
zaproxy/zaproxy
java
<|fim_suffix|>t.class); // When List<Variant> variants = factory.createSiteModifyingVariants(); // Then assertThat(variants.size(), is(equalTo(1))); assertThat(variants.get(0).getClass(), is(equalTo(TestVariant.class))); } @ParameterizedTest @ValueSource(booleans =...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>lterCriteria.EXCLUDE); Set<String> values = new HashSet<>(); values.add("Dummy1"); // When FilterResult filterResult = abstractGenericScanFilter.isFiltered(values); // Then assertThat(filterResult.isFiltered(), is(false)); } } <|fim_prefix|>/* * Zed ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The Z<|fim_suffix|>aproxy.zap.WithConfigsTest; import org.zaproxy.zap.authentication.AuthenticationMethod; import org.zaproxy.zap.authentication.Authentic...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|> @Test void shouldNotReturnUnauthorizedWithOr() { // Given authorizationMethod = new BasicAuthorizationDetectionMethod( STATUS_CODE + 1, "", RESPONSE_TARGET_TEXT + "EXTRA", LogicalOperator.OR); // When/Then assertEquals(autho...
fim
zaproxy/zaproxy
java
<|fim_suffix|>perty("context.authorization.type", Integer.MIN_VALUE); // When extensionAuthorization.importContextData(context, config); // Then verify(context, times(0)).setAuthorizationDetectionMethod(any()); } } <|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class file...
fim
zaproxy/zaproxy
java
/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2021 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * Yo...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2019 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2019 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>equest()); assertFalse(impl.isBreakResponse()); assertFalse(impl.isHoldMessage(msg)); // Deliberate duplicate check due to the side effects of stepping assertFalse(impl.isHoldMessage(msg)); assertFalse(impl.isStepping()); } @Test void shouldDrop() thro...
fim
zaproxy/zaproxy
java
<|fim_suffix|>eMatcherLocation.getCustomPagePageMatcherLocationWithId(id); // Then assertEquals(CustomPageMatcherLocation.getDefaultLocation(), location); } @ParameterizedTest @ValueSource(ints = {-1, 1, 2}) void shouldNotReturnNullOrEmptyStringRepresentation(int id) { // Given/...
fim
zaproxy/zaproxy
java
<|fim_suffix|>tNameKey())); } } <|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this...
fim
zaproxy/zaproxy
java
/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * Yo...
fim
zaproxy/zaproxy
java
<|fim_suffix|>(param.isExtensionEnabled("Extension 3"), is(equalTo(true))); assertThat(param.isExtensionEnabled("Extension 4"), is(equalTo(false))); assertThat(param.isExtensionEnabled("Extension 5"), is(equalTo(true))); assertThat(param.isExtensionEnabled("Extension 6"), is(equalTo(true))); ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>.class); extensionForcedUser = new ExtensionForcedUser(); } @Test void shouldImportContextWithNoForcedUser() { // Given Context context = mock(Context.class); Configuration config = new ZapXmlConfiguration(); // When extensionForcedUser.importC...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2012 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>r the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed un...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may no<|fim_suffix|>tDataOnlyIntoHeaderIfBodyEmpty()...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>{ return new RequestBodyByteHttpPanelViewModel(); } @Override protected Class<HttpRequestHeader> getHeaderClass() { return HttpRequestHeader.class; } @Override protected Class<HttpRequestBody> getBodyClass() { return HttpRequestBody.class; } @Over...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>n { willThrow(HttpMalformedHeaderException.class).given(message).setRequestHeader(anyString()); } @Override protected Class<HttpRequestBody> getBodyClass() { return HttpRequestBody.class; } @Override protected void prepareMessage() { given(message.getReque...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "Li<|fim_suffix|>uted under the License is distributed on an "AS IS" BA...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>ArgumentMatchers.anyString; import static org.mockito.BDDMockito.given; import static org.mockito.BDDMockito.willThrow; import static org.mockito.Mockito.verify; import org.junit.jupiter.api.Test; import org.parosproxy.paros.network.HttpMalformedHeaderException; import org.parosproxy.paros.network.HttpRe...
fim
zaproxy/zaproxy
java
<|fim_suffix|> protected void verifyBodyNotSet(HttpMessage message) { verify(message, times(0)).setResponseBody(anyString()); } } <|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP D...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2016 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2015 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Dev<|fim_suffix|> the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless requir...
fim
zaproxy/zaproxy
java
<|fim_suffix|>tThat(oldestTask.getURI().toString(), is(equalTo(exampleUrl1))); assertThat(oldestTask.getStartTime(), is(greaterThan(testStartTime))); assertThat(testEndTime, is(greaterThanOrEqualTo(oldestTask.getStartTime()))); assertThat(tasks.size(), is(equalTo(2))); assertThat(records...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|> Constant.messages = null; } @BeforeEach void setUp() { param = new PassiveScanParam(); configuration = new ZapXmlConfiguration(); param.load(configuration); } @ParameterizedTest @ValueSource(ints = {1, 2, 10}) void shouldLoadThreadsFromConfig(int ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>assiveScanner.class); when(scanner2.getName()).thenReturn("TestPassiveScanner"); psl.add(scanner2); // When PassiveScanner removedScanner = psl.removeScanner(scanner2.getClass().getName()); // Then assertThat(psl.list(), contains(scanner1)); assertTh...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2013 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2022 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>rException, DatabaseException { // Given HttpMessage msg = new HttpMessage(new URI("http://example.com/", true)); msg.setResponseBody(BODY.replace("@@body_two@@", "Lorem ipsum dolor sit amet, foo bar")); msg.setHistoryRef(mock(HistoryReference.class)); // When ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>at(rcp.getRuleConfig("key2").getDefaultValue(), is(equalTo("defaultValue2"))); assertThat(rcp.getRuleConfig("key2").getValue(), is(equalTo("defaultValue2"))); assertThat(configuration.getString("key1"), is(equalTo("defaultValue1"))); assertThat(configuration.getString("key2"), is(e...
fim
zaproxy/zaproxy
java
<|fim_suffix|>the specific language governing permissions and * limitations under the License. */ package org.zaproxy.zap.extension.script; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.nullVal...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2026 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>) throws Exception { // Given ProxyScript script = mockProxyScript(); Exception exception = mock(ScriptException.class); given(script.proxyRequest(any())).willThrow(exception); ScriptWrapper scriptWrapper = mock(ScriptWrapper.class); CachedScript<ProxyScript...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2023 The <|fim_suffix|>ig = mock(ZapXmlConfiguration.class); var scriptConfigs = List.of( mock(HierarchicalConf...
fim
zaproxy/zaproxy
java
<|fim_suffix|>ptVars.setScriptCustomVar( scriptContext, createKey(), createCustomValue())); } @Test void shouldNotSetScriptCustomVariableUsingNonStringScriptNameInScriptContext() { // Given ScriptContext scriptContext = createScriptContextWithName(10); ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>illReturn(true); given(scriptWrapper.getModCount()).willReturn(0); given(extensionScript.getInterface(scriptWrapper, targetInterface)).willReturn(script); return scriptWrapper; } private static void assertCachedScript( CachedScript<Script> cachedScript, ScriptW...
fim
zaproxy/zaproxy
java
<|fim_suffix|>gmtTypeId = 0; config.addProperty(ExtensionSessionManagement.CONTEXT_CONFIG_SESSION_TYPE, sessMgmtTypeId); // When extSessMgmt.importContextData(context, config); // Then verify(context).setSessionManagementMethod(any(CookieBasedSessionManagementMethod.class)); ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>nder the License. */ package org.zaproxy.zap.extension.stdmenus; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.mock; import org.junit...
fim
zaproxy/zaproxy
java
<|fim_suffix|>@Test void shouldNotHaveViewByDefault() { // Given / When ViewDelegate view = extension.getView(); // When assertThat(view, is(nullValue())); } } <|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing w...
fim
zaproxy/zaproxy
java
<|fim_suffix|> var endNode = new SiteNode( siteMap, HistoryReference.TYPE_ZAP_USER, "endpoint(param1)(param2)", "endpoint"); siteMap.getRoot().add(hostNode); hostNode.add(endNode); ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>er(), is(pub)); assertThat(events.get(0).getTarget(), is(nullValue())); Map<String, String> params = events.get(0).getParameters(); assertThat(params.size(), is(2)); assertThat(params.get(ScanEventPublisher.SCAN_ID), is("2")); assertThat(params.get(ScanEventPublishe...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>To(path))); } @Test void shouldRetrieveExistingSessionFileFromRelativePath() throws Exception { // Given String zapHome = createZapHome(); String session = "test.session"; // When Path sessionPath = SessionUtils.getSessionPath(session); // Then ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>pp2.getStructuralParameters().get(0), "page"); assertEquals(res.size(), 2); assertEquals(res.get("a"), "b&c"); assertEquals(res.get("b"), "c"); assertEquals(res2.size(), 2); assertEquals(res2.get(0).getName(), "a"); assertEquals(res2.get(0).getValue(), "b&...
fim
zaproxy/zaproxy
java
<|fim_suffix|> assertThat(snm.getType(), is(equalTo(StructuralNodeModifier.Type.StructuralParameter))); assertThat(snm.getPattern(), is(nullValue())); } } <|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Co...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|>2"))); assertThat(wasc2.getAlert(), is(equalTo("Alert 2"))); assertThat(wasc2.getDescription(), is(equalTo("Description 2"))); assertThat(wasc2.getSolution(), is(equalTo("Solution 2"))); assertThat(wasc2.getReferences().size(), is(equalTo(1))); assertThat(wasc2.getR...
fim
zaproxy/zaproxy
java
<|fim_suffix|> String DEFAULT_CHARSET_NAME = DEFAULT_CHARSET.name(); protected static final String UTF_8_NAME = StandardCharsets.UTF_8.name(); protected static final String BODY_1_STRING = "[Body1 A B C ぁ]"; protected static final byte[] BODY_1_BYTES_DEFAULT_CHARSET = BODY_1_STRING.getBytes(D...
fim
zaproxy/zaproxy
java
<|fim_suffix|>ception e) { throw new RuntimeException(e); } return baos.toByteArray(); } } <|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * ...
fim
zaproxy/zaproxy
java
/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * Yo...
fim
zaproxy/zaproxy
java
<|fim_suffix|>ertThat(httpBody.toString(), is(equalTo(BODY_1_STRING_UTF_8))); } @Test void shouldCreateBodyWithInitialCapacity() { // Given int initialCapacity = 1024; HttpResponseBody httpBody = new HttpResponseBody(initialCapacity); // When / Then assertThat(httpBo...
fim
zaproxy/zaproxy
java
/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2017 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * Yo...
fim
zaproxy/zaproxy
java
<|fim_suffix|> BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.zaproxy.zap.resources; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcre...
fim
zaproxy/zaproxy
java
<|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...
fim
zaproxy/zaproxy
java
<|fim_suffix|> event.getMessage().getFormattedMessage(), event.getThrown())); } public List<AppendedLogEvent> getLogEvents() { return logEvents; } public static class AppendedLogEvent { private final Level level; private final String message;...
fim
zaproxy/zaproxy
java
/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2022 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * Yo...
fim
zaproxy/zaproxy
java
<|fim_suffix|> } catch (IOException e) { System.err.println("Failed to read file " + file.toAbsolutePath()); throw new RuntimeException(e); } } } <|fim_prefix|>/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application...
fim
zaproxy/zaproxy
java
<|fim_suffix|>tchers.anyString; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.never; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import org.junit.jupiter.api.BeforeA...
fim
zaproxy/zaproxy
java
<|fim_suffix|> TestTableModelListener listener = createTestTableModelListener(); List<User> usersList = new ArrayList<>(); usersList.add(createUser()); usersList.add(createEnabledUser()); UsersTableModel usersTableModel = new UsersTableModel(usersList); usersTableModel.add...
fim
zaproxy/zaproxy
java