use of com.hotels.styx.StyxConfig in project styx by ExpediaGroup.
the class StyxServerComponentsTest method createsEnvironment.
@Test
public void createsEnvironment() {
Configuration config = new Configuration.MapBackedConfiguration().set("foo", "abc").set("bar", "def");
StyxServerComponents components = new StyxServerComponents.Builder().registry(new MicrometerRegistry(new CompositeMeterRegistry())).styxConfig(new StyxConfig(config)).build();
Environment environment = components.environment();
assertThat(environment.configuration().get("foo", String.class), isValue("abc"));
assertThat(environment.configuration().get("bar", String.class), isValue("def"));
assertThat(environment.eventBus(), is(notNullValue()));
assertThat(environment.metricRegistry(), is(notNullValue()));
}
use of com.hotels.styx.StyxConfig in project styx by ExpediaGroup.
the class StyxServerComponentsTest method setsUpLoggingOnBuild.
@Test
public void setsUpLoggingOnBuild() {
LoggingSetUp loggingSetUp = mock(LoggingSetUp.class);
new StyxServerComponents.Builder().registry(new MicrometerRegistry(new CompositeMeterRegistry())).styxConfig(new StyxConfig()).loggingSetUp(loggingSetUp).build();
verify(loggingSetUp).setUp(any(Environment.class));
}
Aggregations