@Test public void testBindResources(@Mocked final Binder binder) { underTest.configure(binder); new Verifications() {{ binder.bind(MyResource1.class); binder.bind(MyResource2.class); }}; }
@Override protected void configure() { for (Class<?> resource : resources) { bind(resource); } for (Class<?> provider : providers) { bind(provider).in(Scopes.SINGLETON); } if (!rootResourcesByVariant.isEmpty()) { MapBinder<Variant, RootResource> multiBinder = MapBinder.newMapBinder(binder(), Variant.class, RootResource.class); for (Map.Entry<Variant, Class<? extends RootResource>> rootResourceClassEntry : rootResourcesByVariant .entrySet()) { multiBinder.addBinding(rootResourceClassEntry.getKey()).to(rootResourceClassEntry.getValue()); } } }
RestModule extends AbstractModule { @Override protected void configure() { for (Class<?> resource : resources) { bind(resource); } for (Class<?> provider : providers) { bind(provider).in(Scopes.SINGLETON); } if (!rootResourcesByVariant.isEmpty()) { MapBinder<Variant, RootResource> multiBinder = MapBinder.newMapBinder(binder(), Variant.class, RootResource.class); for (Map.Entry<Variant, Class<? extends RootResource>> rootResourceClassEntry : rootResourcesByVariant .entrySet()) { multiBinder.addBinding(rootResourceClassEntry.getKey()).to(rootResourceClassEntry.getValue()); } } } }
RestModule extends AbstractModule { @Override protected void configure() { for (Class<?> resource : resources) { bind(resource); } for (Class<?> provider : providers) { bind(provider).in(Scopes.SINGLETON); } if (!rootResourcesByVariant.isEmpty()) { MapBinder<Variant, RootResource> multiBinder = MapBinder.newMapBinder(binder(), Variant.class, RootResource.class); for (Map.Entry<Variant, Class<? extends RootResource>> rootResourceClassEntry : rootResourcesByVariant .entrySet()) { multiBinder.addBinding(rootResourceClassEntry.getKey()).to(rootResourceClassEntry.getValue()); } } } RestModule(Collection<Class<?>> resources, Collection<Class<?>> providers,
            Map<Variant, Class<? extends RootResource>> rootResourcesByVariant); }
RestModule extends AbstractModule { @Override protected void configure() { for (Class<?> resource : resources) { bind(resource); } for (Class<?> provider : providers) { bind(provider).in(Scopes.SINGLETON); } if (!rootResourcesByVariant.isEmpty()) { MapBinder<Variant, RootResource> multiBinder = MapBinder.newMapBinder(binder(), Variant.class, RootResource.class); for (Map.Entry<Variant, Class<? extends RootResource>> rootResourceClassEntry : rootResourcesByVariant .entrySet()) { multiBinder.addBinding(rootResourceClassEntry.getKey()).to(rootResourceClassEntry.getValue()); } } } RestModule(Collection<Class<?>> resources, Collection<Class<?>> providers,
            Map<Variant, Class<? extends RootResource>> rootResourcesByVariant);  }
RestModule extends AbstractModule { @Override protected void configure() { for (Class<?> resource : resources) { bind(resource); } for (Class<?> provider : providers) { bind(provider).in(Scopes.SINGLETON); } if (!rootResourcesByVariant.isEmpty()) { MapBinder<Variant, RootResource> multiBinder = MapBinder.newMapBinder(binder(), Variant.class, RootResource.class); for (Map.Entry<Variant, Class<? extends RootResource>> rootResourceClassEntry : rootResourcesByVariant .entrySet()) { multiBinder.addBinding(rootResourceClassEntry.getKey()).to(rootResourceClassEntry.getValue()); } } } RestModule(Collection<Class<?>> resources, Collection<Class<?>> providers,
            Map<Variant, Class<? extends RootResource>> rootResourcesByVariant);   }