use of org.glassfish.jersey.internal.inject.ProviderBinder in project jersey by jersey.
the class ProviderBinderTest method testProvidersMbwInstance.
@Test
public void testProvidersMbwInstance() {
InjectionManager injectionManager = Injections.createInjectionManager(initBinders());
ProviderBinder providerBinder = new ProviderBinder(injectionManager);
providerBinder.bindInstances(Collections.singleton(new MyProvider()));
Set<MessageBodyWriter> providers = Providers.getCustomProviders(injectionManager, MessageBodyWriter.class);
assertEquals(instancesOfType(MyProvider.class, providers).size(), 1);
}
use of org.glassfish.jersey.internal.inject.ProviderBinder in project jersey by jersey.
the class ProviderBinderTest method testProvidersMbw.
@Test
public void testProvidersMbw() {
InjectionManager injectionManager = Injections.createInjectionManager(initBinders());
ProviderBinder providerBinder = new ProviderBinder(injectionManager);
providerBinder.bindClasses(Collections.singleton(MyProvider.class));
Set<MessageBodyWriter> providers = Providers.getCustomProviders(injectionManager, MessageBodyWriter.class);
final Collection<MyProvider> myProviders = instancesOfType(MyProvider.class, providers);
assertEquals(1, myProviders.size());
}
use of org.glassfish.jersey.internal.inject.ProviderBinder in project jersey by jersey.
the class ProviderBinderTest method testProvidersMbr.
@Test
public void testProvidersMbr() {
InjectionManager injectionManager = Injections.createInjectionManager(initBinders());
ProviderBinder providerBinder = new ProviderBinder(injectionManager);
providerBinder.bindClasses(Collections.singleton(MyProvider.class));
Set<MessageBodyReader> providers = Providers.getCustomProviders(injectionManager, MessageBodyReader.class);
assertEquals(1, instancesOfType(MyProvider.class, providers).size());
}
use of org.glassfish.jersey.internal.inject.ProviderBinder in project jersey by jersey.
the class ProviderBinderTest method testProvidersMbrInstance.
@Test
public void testProvidersMbrInstance() {
InjectionManager injectionManager = Injections.createInjectionManager(initBinders());
ProviderBinder providerBinder = new ProviderBinder(injectionManager);
providerBinder.bindInstances(Collections.singleton(new MyProvider()));
Set<MessageBodyReader> providers = Providers.getCustomProviders(injectionManager, MessageBodyReader.class);
assertEquals(1, instancesOfType(MyProvider.class, providers).size());
}
use of org.glassfish.jersey.internal.inject.ProviderBinder in project jersey by jersey.
the class TestBinder method initProviders.
public static void initProviders(final InjectionManager injectionManager, final Iterable<Class<?>> providerClasses, final Iterable<Object> providerInstances) {
final ProviderBinder providerBinder = new ProviderBinder(injectionManager);
providerBinder.bindClasses(providerClasses);
providerBinder.bindInstances(providerInstances);
}
Aggregations