use of org.zaproxy.zap.utils.ZapXmlConfiguration in project zaproxy by zaproxy.
the class AbstractPluginUnitTest method shouldRetrieveConfigSet.
@Test
void shouldRetrieveConfigSet() {
// Given
AbstractPlugin plugin = createAbstractPlugin();
Configuration config = new ZapXmlConfiguration();
// WHen
plugin.setConfig(config);
// Then
assertThat(plugin.getConfig(), is(equalTo(config)));
}
use of org.zaproxy.zap.utils.ZapXmlConfiguration in project zaproxy by zaproxy.
the class AbstractPluginUnitTest method shouldFailToSaveToConfigIfConfigNotSet.
@Test
void shouldFailToSaveToConfigIfConfigNotSet() {
// Given
AbstractPlugin plugin = createAbstractPlugin();
Configuration config = new ZapXmlConfiguration();
// When / Then
assertThrows(NullPointerException.class, () -> plugin.saveTo(config));
}
use of org.zaproxy.zap.utils.ZapXmlConfiguration in project zaproxy by zaproxy.
the class PluginPassiveScannerUnitTest method createConfiguration.
private static Configuration createConfiguration(String classname, Boolean enabled, AlertThreshold alertThreshold) {
ZapXmlConfiguration configuration = new ZapXmlConfiguration();
setClassname(configuration, 0, classname);
setProperties(configuration, 0, enabled, alertThreshold);
return configuration;
}
use of org.zaproxy.zap.utils.ZapXmlConfiguration in project zaproxy by zaproxy.
the class RuleConfigParamUnitTest method setUp.
@BeforeEach
void setUp() throws Exception {
rcp = new RuleConfigParam();
configuration = new ZapXmlConfiguration();
rcp.load(configuration);
}
use of org.zaproxy.zap.utils.ZapXmlConfiguration in project zaproxy by zaproxy.
the class ExtensionSessionManagementUnitTest method shouldImportContextWithScriptSessionMgmtType.
@Test
void shouldImportContextWithScriptSessionMgmtType() throws ConfigurationException {
// Given
Context context = mock(Context.class);
Configuration config = new ZapXmlConfiguration();
int sessMgmtTypeId = 2;
config.addProperty(ExtensionSessionManagement.CONTEXT_CONFIG_SESSION_TYPE, sessMgmtTypeId);
// When
extSessMgmt.importContextData(context, config);
// Then
verify(context).setSessionManagementMethod(any(ScriptBasedSessionManagementMethod.class));
}
Aggregations