binder.bind(Servlet.class).annotatedWith(TheServlet.class).to(DummyServlet.class);
binder.bind(Servlet.class).annotatedWith(TheAdminServlet.class).to(DummyServlet.class);
}
});
NodeInfo nodeInfo = injector.getInstance(NodeInfo.class);
HttpServer server = injector.getInstance(HttpServer.class);
assertNotNull(server);
server.start();
try {
HttpServerInfo httpServerInfo = injector.getInstance(HttpServerInfo.class);
assertNotNull(httpServerInfo);
assertNotNull(httpServerInfo.getHttpUri());
assertEquals(httpServerInfo.getHttpUri().getScheme(), "http");
assertEquals(httpServerInfo.getHttpUri().getHost(), nodeInfo.getInternalIp().getHostAddress());
assertNull(httpServerInfo.getHttpsUri());
}
catch (Exception e) {
server.stop();
}