// Path: rxjava2-server/src/main/java/net/winterly/rxjersey/server/rxjava2/RxJerseyServerFeature.java
// public final class RxJerseyServerFeature implements Feature {
// 
//     private final List<Class<? extends CompletableRequestInterceptor>> interceptors = new LinkedList<>();
// 
//     public RxJerseyServerFeature register(Class<? extends CompletableRequestInterceptor> interceptor) {
//         interceptors.add(interceptor);
//         return this;
//     }
// 
//     @Override
//     public boolean configure(FeatureContext context) {
//         context.register(RxBodyWriter.class);
//         context.register(new Binder());
//         return true;
//     }
// 
//     private class Binder extends AbstractBinder {
// 
//         @Override
//         protected void configure() {
//             bind(MaybeInvocationHandlerProvider.class)
//                     .to(ResourceMethodInvocationHandlerProvider.class)
//                     .in(Singleton.class);
// 
//             interceptors.forEach(interceptor -> bind(interceptor)
//                     .to(CompletableRequestInterceptor.class)
//                     .in(Singleton.class)
//             );
//         }
//     }
// }


import net.winterly.rxjersey.server.rxjava2.RxJerseyServerFeature;
import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.jackson.JacksonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.JerseyTest;

public class RxJerseyTest extends JerseyTest {

    protected ResourceConfig config() {
        return new ResourceConfig()
                .register(JacksonFeature.class)
// Path: rxjava2-server/src/main/java/net/winterly/rxjersey/server/rxjava2/RxJerseyServerFeature.java
// public final class RxJerseyServerFeature implements Feature {
// 
//     private final List<Class<? extends CompletableRequestInterceptor>> interceptors = new LinkedList<>();
// 
//     public RxJerseyServerFeature register(Class<? extends CompletableRequestInterceptor> interceptor) {
//         interceptors.add(interceptor);
//         return this;
//     }
// 
//     @Override
//     public boolean configure(FeatureContext context) {
//         context.register(RxBodyWriter.class);
//         context.register(new Binder());
//         return true;
//     }
// 
//     private class Binder extends AbstractBinder {
// 
//         @Override
//         protected void configure() {
//             bind(MaybeInvocationHandlerProvider.class)
//                     .to(ResourceMethodInvocationHandlerProvider.class)
//                     .in(Singleton.class);
// 
//             interceptors.forEach(interceptor -> bind(interceptor)
//                     .to(CompletableRequestInterceptor.class)
//                     .in(Singleton.class)
//             );
//         }
//     }
// }


// Path: rxjava2-server/src/test/java/RxJerseyTest.java
import net.winterly.rxjersey.server.rxjava2.RxJerseyServerFeature;
import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.jackson.JacksonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.JerseyTest;


public class RxJerseyTest extends JerseyTest {

    protected ResourceConfig config() {
        return new ResourceConfig()
                .register(JacksonFeature.class)
                .register(RxJerseyServerFeature.class);