Search in sources :

Example 1 with Constant

use of org.parosproxy.paros.Constant in project zaproxy by zaproxy.

the class PluginFactoryUnitTest method mockConstantClass.

private void mockConstantClass() {
    PluginFactory pf = PowerMockito.mock(PluginFactory.class);
    Whitebox.setInternalState(pf, "loadedPlugins", null);
    Constant constant = PowerMockito.mock(Constant.class);
    Whitebox.setInternalState(constant, "instance", constant);
    Whitebox.setInternalState(constant, "zapInstall", ".");
    I18N i18n = PowerMockito.mock(I18N.class);
    given(i18n.getString(anyString())).willReturn("");
    given(i18n.getString(anyString(), anyObject())).willReturn("");
    Whitebox.setInternalState(constant, "messages", i18n);
    Model.getSingleton().getOptionsParam().load(new ZapXmlConfiguration());
}
Also used : Constant(org.parosproxy.paros.Constant) ZapXmlConfiguration(org.zaproxy.zap.utils.ZapXmlConfiguration) I18N(org.zaproxy.zap.utils.I18N)

Example 2 with Constant

use of org.parosproxy.paros.Constant in project zaproxy by zaproxy.

the class UsersListModelUnitTest method mockConstantClass.

private void mockConstantClass() {
    Constant constant = PowerMockito.mock(Constant.class);
    I18N i18n = PowerMockito.mock(I18N.class);
    given(i18n.getString(anyString())).willReturn("");
    given(i18n.getString(anyString(), anyObject())).willReturn("");
    Whitebox.setInternalState(constant, "messages", i18n);
}
Also used : Constant(org.parosproxy.paros.Constant) I18N(org.zaproxy.zap.utils.I18N)

Example 3 with Constant

use of org.parosproxy.paros.Constant in project zaproxy by zaproxy.

the class UsersTableModelUnitTest method mockConstantClass.

private void mockConstantClass() {
    Constant constant = PowerMockito.mock(Constant.class);
    I18N i18n = PowerMockito.mock(I18N.class);
    given(i18n.getString(anyString())).willReturn("");
    given(i18n.getString(anyString(), anyObject())).willReturn("");
    Whitebox.setInternalState(constant, "messages", i18n);
}
Also used : Constant(org.parosproxy.paros.Constant) I18N(org.zaproxy.zap.utils.I18N)

Aggregations

Constant (org.parosproxy.paros.Constant)3 I18N (org.zaproxy.zap.utils.I18N)3 ZapXmlConfiguration (org.zaproxy.zap.utils.ZapXmlConfiguration)1