ProviderBinder implements Providers { @Override public <T> MessageBodyReader<T> getMessageBodyReader(Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return doGetMessageBodyReader(type, genericType, annotations, mediaType); } protected  ProviderBinder(); static ProviderBinder getInstance(); static void setInstance(ProviderBinder providerBinder); void addContextResolver(Class<? extends ContextResolver> contextResolverClass); void addContextResolver(ContextResolver contextResolver); @SuppressWarnings({"unchecked"}) void addExceptionMapper(Class<? extends ExceptionMapper> exceptionMapperClass); @SuppressWarnings({"unchecked"}) void addExceptionMapper(ExceptionMapper exceptionMapper); void addMessageBodyReader(Class<? extends MessageBodyReader> messageBodyReaderClass); @SuppressWarnings({"unchecked"}) void addMessageBodyReader(MessageBodyReader messageBodyReader); void addMessageBodyWriter(Class<? extends MessageBodyWriter> messageBodyWriter); void addMessageBodyWriter(MessageBodyWriter messageBodyWriter); void addMethodInvokerFilter(Class<? extends MethodInvokerFilter> methodInvokerFilterClass); void addMethodInvokerFilter(MethodInvokerFilter methodInvokerFilter); void addRequestFilter(Class<? extends RequestFilter> requestFilterClass); void addRequestFilter(RequestFilter requestFilter); void addResponseFilter(Class<? extends ResponseFilter> responseFilterClass); void addResponseFilter(ResponseFilter responseFilter); List<MediaType> getAcceptableWriterMediaTypes(Class<?> type, Type genericType, Annotation[] annotations); @Override ContextResolver<T> getContextResolver(Class<T> contextType, MediaType mediaType); @Override ExceptionMapper<T> getExceptionMapper(Class<T> errorType); @Override MessageBodyReader<T> getMessageBodyReader(Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override MessageBodyWriter<T> getMessageBodyWriter(Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType); List<MethodInvokerFilter> getMethodInvokerFilters(String path); List<RequestFilter> getRequestFilters(String path); List<ResponseFilter> getResponseFilters(String path); void addContextResolver(ObjectFactory<ProviderDescriptor> contextResolverFactory); @SuppressWarnings("unchecked") void addExceptionMapper(ObjectFactory<ProviderDescriptor> exceptionMapperFactory); void addMessageBodyReader(ObjectFactory<ProviderDescriptor> readerFactory); void addMessageBodyWriter(ObjectFactory<ProviderDescriptor> writerFactory); void addMethodInvokerFilter(ObjectFactory<FilterDescriptor> filterFactory); void addRequestFilter(ObjectFactory<FilterDescriptor> filterFactory); void addResponseFilter(ObjectFactory<FilterDescriptor> filterFactory);  }
@Test @UseDataProvider("messageBodyReaderByTypeAndMediaType") public void retrievesMessageBodyReaderByTypeAndMediaType(boolean singletonOrPerRequest, Class<?> readObjectType, Type readObjectGenericType, MediaType mediaType, Object expectedMessageBodyReaderClassOrInstance) throws Exception { if (singletonOrPerRequest == SINGLETON) { registerSingletonMessageBodyReaders(); } else { registerPerRequestMessageBodyReaders(); } MessageBodyReader messageBodyReader = providers.getMessageBodyReader(readObjectType, readObjectGenericType, null, mediaType); if (singletonOrPerRequest == SINGLETON) { assertSame(expectedMessageBodyReaderClassOrInstance, messageBodyReader); } else { if (expectedMessageBodyReaderClassOrInstance == null) { assertNull(messageBodyReader); } else { assertNotNull(messageBodyReader); assertEquals(expectedMessageBodyReaderClassOrInstance, messageBodyReader.getClass()); } } }