CdiComponentProvider implements ComponentProvider, Extension { boolean isJaxRsComponentType(final Class<?> clazz) { return jaxRsComponentCache.apply(clazz); } CdiComponentProvider(); @Override void initialize(final InjectionManager injectionManager); @Override boolean bind(final Class<?> clazz, final Set<Class<?>> providerContracts); @Override void done(); static final String CDI_CLASS_ANALYZER; }
@Test public void testProviders() { final CdiComponentProvider provider = new CdiComponentProvider(); assertFalse(provider.isJaxRsComponentType(MyPojo.class)); assertTrue(provider.isJaxRsComponentType(MyMessageBodyReader.class)); assertTrue(provider.isJaxRsComponentType(MyOtherMessageBodyReader.class)); }
@Test public void testResources() { final CdiComponentProvider provider = new CdiComponentProvider(); assertTrue(provider.isJaxRsComponentType(LocatorSubResource.class)); assertTrue(provider.isJaxRsComponentType(ResourceMethodResource.class)); assertTrue(provider.isJaxRsComponentType(ResourceMethodSubResource.class)); assertTrue(provider.isJaxRsComponentType(CustomResourceMethodSubResource.class)); }