use of com.hotels.styx.support.matchers.LoggingTestSupport in project styx by ExpediaGroup.
the class PluginLoadingForStartupTest method attemptsToLoadAllPluginsEvenIfSomePluginFactoriesFailDuringExecution.
@Test
public void attemptsToLoadAllPluginsEvenIfSomePluginFactoriesFailDuringExecution() {
LoggingTestSupport log = new LoggingTestSupport(FailureHandling.class);
String yaml = "" + "plugins:\n" + " active: myPlugin1,myPlugin2,myPlugin3\n" + " all:\n" + " myPlugin1:\n" + " factory:\n" + " class: com.hotels.styx.startup.extensions.PluginLoadingForStartupTest$FailingPluginFactory\n" + " classPath: " + FIXTURES_CLASS_PATH + "\n" + " myPlugin2:\n" + " factory:\n" + " class: com.hotels.styx.startup.extensions.PluginLoadingForStartupTest$FailingPluginFactory\n" + " classPath: " + FIXTURES_CLASS_PATH + "\n" + " myPlugin3:\n" + " factory:\n" + " class: com.hotels.styx.startup.extensions.PluginLoadingForStartupTest$FailingPluginFactory\n" + " classPath: " + FIXTURES_CLASS_PATH + "\n";
Exception e = assertThrows(RuntimeException.class, () -> PluginLoadingForStartup.loadPlugins(environment(yaml)));
assertThat(e.getMessage(), matchesPattern("3 plugin\\(s\\) could not be loaded: failedPlugins=\\[myPlugin1, myPlugin2, myPlugin3\\]; failureCauses=\\[" + "myPlugin1: java.lang.RuntimeException: plugin factory error, " + "myPlugin2: java.lang.RuntimeException: plugin factory error, " + "myPlugin3: java.lang.RuntimeException: plugin factory error\\]"));
assertThat(log.log(), hasItem(loggingEvent(ERROR, "Could not load plugin: pluginName=myPlugin1; factoryClass=.*", RuntimeException.class, "plugin factory error")));
log.stop();
}
use of com.hotels.styx.support.matchers.LoggingTestSupport in project styx by ExpediaGroup.
the class HttpMessageLoggingInterceptorTest method before.
@BeforeEach
public void before() {
responseLogSupport = new LoggingTestSupport("com.hotels.styx.http-messages.inbound");
interceptor = new HttpMessageLoggingInterceptor(true, httpMessageFormatter);
}
use of com.hotels.styx.support.matchers.LoggingTestSupport in project styx by ExpediaGroup.
the class FlowControllingHttpContentProducerTest method setUp.
@BeforeEach
public void setUp() throws Exception {
contentChunk1 = copiedBuffer("aaa", UTF_8);
contentChunk2 = copiedBuffer("bbb", UTF_8);
logger = new LoggingTestSupport(FlowControllingHttpContentProducer.class);
}
use of com.hotels.styx.support.matchers.LoggingTestSupport in project styx by ExpediaGroup.
the class FileBackedBackendServicesRegistryTest method setUp.
@BeforeEach
public void setUp() {
log = new LoggingTestSupport(FileBackedBackendServicesRegistry.class);
fileBackedLog = new LoggingTestSupport(FileBackedRegistry.class);
}
use of com.hotels.styx.support.matchers.LoggingTestSupport in project styx by ExpediaGroup.
the class StyxServerTest method setUp.
@BeforeEach
public void setUp() {
log = new LoggingTestSupport(StyxServer.class);
pssLog = new LoggingTestSupport(StyxServer.class);
}
Aggregations