use of com.netflix.ribbon.guice.RibbonModule in project ribbon by Netflix.
the class RibbonModuleTest method shouldBind.
@Test
public void shouldBind() {
Injector injector = Guice.createInjector(new RibbonModule());
MyService service = injector.getInstance(MyService.class);
service.runExample();
}
use of com.netflix.ribbon.guice.RibbonModule in project ribbon by Netflix.
the class RxMovieProxyExampleTest method shouldBind.
@Test
public void shouldBind() {
ConfigurationManager.getConfigInstance().setProperty(MovieService.class.getSimpleName() + ".ribbon.listOfServers", "localhost:" + port);
Injector injector = Guice.createInjector(new RibbonModule(), new AbstractModule() {
@Override
protected void configure() {
bind(MovieService.class).toProvider(new RibbonResourceProvider<MovieService>(MovieService.class)).asEagerSingleton();
}
});
RxMovieProxyExample example = injector.getInstance(RxMovieProxyExample.class);
assertTrue(example.runExample());
}
Aggregations