use of org.zaproxy.zap.extension.script.ScriptsCache.Configuration in project zaproxy by zaproxy.
the class ProxyListenerScriptUnitTest method shouldCreateScriptsCacheWithExpectedConfiguration.
@Test
@SuppressWarnings("unchecked")
void shouldCreateScriptsCacheWithExpectedConfiguration() {
// Given / When
new ProxyListenerScript(extensionScript);
// Then
ArgumentCaptor<Configuration<ProxyScript>> argumentCaptor = ArgumentCaptor.forClass(Configuration.class);
verify(extensionScript).createScriptsCache(argumentCaptor.capture());
Configuration<ProxyScript> configuration = argumentCaptor.getValue();
assertThat(configuration.getScriptType(), is(equalTo(SCRIPT_TYPE)));
assertThat(configuration.getTargetInterface(), is(equalTo(TARGET_INTERFACE)));
InterfaceErrorMessageProvider errorMessageProvider = configuration.getInterfaceErrorMessageProvider();
assertThat(errorMessageProvider, is(not(nullValue())));
assertThat(errorMessageProvider.getErrorMessage(null), is(not(nullValue())));
}
Aggregations