use of io.joynr.capabilities.DummyDiscoveryModule in project joynr by bmwcarit.
the class LongPollingChannelLifecycleTest method setUp.
@Before
public void setUp() throws Exception {
server = new LocalTestServer(null, null);
server.register(CHANNELPATH, new HttpRequestHandler() {
@Override
public void handle(HttpRequest request, HttpResponse response, HttpContext context) throws HttpException, IOException {
response.setStatusCode(createChannelResponseCode);
response.setHeader("Location", bounceProxyUrl + "channels/" + channelId);
}
});
server.start();
serviceAddress = "http://" + server.getServiceAddress().getHostName() + ":" + server.getServiceAddress().getPort();
bounceProxyUrl = serviceAddress + BOUNCEPROXYPATH;
Properties properties = new Properties();
properties.put(MessagingPropertyKeys.CHANNELID, channelId);
properties.put(MessagingPropertyKeys.BOUNCE_PROXY_URL, bounceProxyUrl);
Injector injector = Guice.createInjector(new AbstractModule() {
@Override
public void configure() {
bind(HttpRequestFactory.class).to(ApacheHttpRequestFactory.class);
bind(CloseableHttpClient.class).toProvider(HttpClientProvider.class).in(Singleton.class);
bind(RequestConfig.class).toProvider(HttpDefaultRequestConfigProvider.class).in(Singleton.class);
bind(MessagingSettings.class).to(ConfigurableMessagingSettings.class);
}
}, new JoynrPropertiesModule(properties), new JsonMessageSerializerModule(), new DummyDiscoveryModule());
longpollingChannelLifecycle = injector.getInstance(LongPollingChannelLifecycle.class);
}
Aggregations