use of io.airlift.event.client.EventModule in project airlift by airlift.
the class TestHttpServerModule method testCanConstructServer.
@Test
public void testCanConstructServer() {
Map<String, String> properties = new ImmutableMap.Builder<String, String>().put("http-server.http.port", "0").put("http-server.log.path", new File(tempDir, "http-request.log").getAbsolutePath()).build();
Bootstrap app = new Bootstrap(new HttpServerModule(), new TestingNodeModule(), new EventModule(), binder -> binder.bind(Servlet.class).annotatedWith(TheServlet.class).to(DummyServlet.class));
Injector injector = app.setRequiredConfigurationProperties(properties).doNotInitializeLogging().initialize();
HttpServer server = injector.getInstance(HttpServer.class);
assertNotNull(server);
}
Aggregations