### Question:
ScriptEngineConfigurator implements ServiceListener { @Override public void globalConfigChanged(String serviceName, String version, String groupName, String serviceComponent, int type) { if (!SERVICE_NAME.equals(serviceName) || StringUtils.isEmpty(serviceComponent)) { return; } serviceComponent = serviceComponent.startsWith("/") ? serviceComponent.substring(1).trim() : serviceComponent; String[] components = serviceComponent.toUpperCase().split("/"); if (components.length == 2 && ENGINE_CONFIGURATION.equalsIgnoreCase(components[1])) { try { updateConfig(ScriptContext.valueOf(components[0])); } catch (IllegalArgumentException e) { logger.error("Script Context does not exist: " + components[0], e); } } } @Inject  ScriptEngineConfigurator(@Named("ScriptLogger")Logger logger); void registerServiceListener(); @Override void schemaChanged(String serviceName, String version); @Override void organizationConfigChanged(String serviceName, String version, String orgName, String groupName,
                                          String serviceComponent, int type); @Override void globalConfigChanged(String serviceName, String version, String groupName, String serviceComponent,
                                    int type);  }### Answer:
@Test public void shouldLogErrorWhenContextNotFound() { String serviceComponent = "/NO_SUCH_CONTEXT/" + ENGINE_CONFIGURATION; engineConfigurator.globalConfigChanged(ScriptConstants.SERVICE_NAME, "", "", serviceComponent, 0); ArgumentCaptor<String> stringCaptor = ArgumentCaptor.forClass(String.class); verify(logger, times(1)).error(stringCaptor.capture(), any(IllegalArgumentException.class)); assertThat(stringCaptor.getValue()).isEqualTo("Script Context does not exist: NO_SUCH_CONTEXT"); }