Search in sources :

Example 81 with ZapXmlConfiguration

use of org.zaproxy.zap.utils.ZapXmlConfiguration in project zaproxy by zaproxy.

the class HttpSenderUnitTest method createOptions.

private static ConnectionParam createOptions() {
    ConnectionParam options = new ConnectionParam();
    options.load(new ZapXmlConfiguration());
    return options;
}
Also used : ZapXmlConfiguration(org.zaproxy.zap.utils.ZapXmlConfiguration)

Example 82 with ZapXmlConfiguration

use of org.zaproxy.zap.utils.ZapXmlConfiguration in project zaproxy by zaproxy.

the class WithConfigsTest method setUpZap.

/**
 * Sets up ZAP, by initialising the home/installation dirs and core classes (for example, {@link
 * Constant}, {@link Control}, {@link Model}).
 *
 * @throws Exception if an error occurred while setting up the dirs or core classes.
 */
@BeforeEach
void setUpZap() throws Exception {
    Constant.setZapInstall(zapInstallDir);
    Constant.setZapHome(zapHomeDir);
    model = mock(Model.class, withSettings().defaultAnswer(CALLS_REAL_METHODS));
    Model.setSingletonForTesting(model);
    extensionLoader = mock(ExtensionLoader.class, withSettings().lenient());
    // Init all the things
    Constant.getInstance();
    setUpConstantMessages();
    Control.initSingletonForTesting(Model.getSingleton(), extensionLoader);
    Model.getSingleton().getOptionsParam().load(new ZapXmlConfiguration());
}
Also used : Model(org.parosproxy.paros.model.Model) ZapXmlConfiguration(org.zaproxy.zap.utils.ZapXmlConfiguration) ExtensionLoader(org.parosproxy.paros.extension.ExtensionLoader) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ZapXmlConfiguration (org.zaproxy.zap.utils.ZapXmlConfiguration)82 Test (org.junit.jupiter.api.Test)37 Configuration (org.apache.commons.configuration.Configuration)19 WithConfigsTest (org.zaproxy.zap.WithConfigsTest)18 Context (org.zaproxy.zap.model.Context)17 ConfigurationException (org.apache.commons.configuration.ConfigurationException)15 File (java.io.File)11 IOException (java.io.IOException)9 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)7 ConversionException (org.apache.commons.configuration.ConversionException)6 XMLConfiguration (org.apache.commons.configuration.XMLConfiguration)5 InvalidParameterException (java.security.InvalidParameterException)4 HttpMessage (org.parosproxy.paros.network.HttpMessage)4 MalformedURLException (java.net.MalformedURLException)3 Path (java.nio.file.Path)3 ParseException (java.text.ParseException)3 ArrayList (java.util.ArrayList)3 Locale (java.util.Locale)3 NoSuchElementException (java.util.NoSuchElementException)3 URI (org.apache.commons.httpclient.URI)3