Java 类com.sun.jersey.api.client.ClientHandler 实例源码

项目:IoT-Gateway    文件:BasicAuthFilterTest.java   
@Before
public void setup() {
    dummy = context.mock(ClientHandler.class);
    authFilter = new BasicAuthFilter("admin", "lamepass");
    ReflectionTestUtils.setField(authFilter, "next", dummy);
    clientRequest = context.mock(ClientRequest.class);

    headers = new MultivaluedMapImpl();

    context.checking(new Expectations() {
        {
            allowing(clientRequest).getHeaders();
            will(returnValue(headers));
            allowing(dummy).handle(with(aNonNull(ClientRequest.class)));
            will(returnValue(null));
        }
    });
}
项目:conductor    文件:ClientBase.java   
protected ClientBase(ClientConfig cc, ClientHandler handler) {
    JacksonJsonProvider provider = new JacksonJsonProvider(objectMapper());
    cc.getSingletons().add(provider);
    if (handler == null) {
        this.client = Client.create(cc);
    } else {
        this.client = new Client(handler, cc);
    }       
}
项目:conductor    文件:TaskClient.java   
/**
 * 
 * @param config config REST Client configuration
 * @param handler handler Jersey client handler.  Useful when plugging in various http client interaction modules (e.g. ribbon)
 * @param filters Chain of client side filters to be applied per request
 */
public TaskClient(ClientConfig config, ClientHandler handler, ClientFilter...filters) {
    super(config, handler);
    for(ClientFilter filter : filters) {
        super.client.addFilter(filter);
    }
}
项目:conductor    文件:WorkflowClient.java   
/**
 * 
 * @param config config REST Client configuration
 * @param handler handler Jersey client handler.  Useful when plugging in various http client interaction modules (e.g. ribbon)
 * @param filters Chain of client side filters to be applied per request
 */
public WorkflowClient(ClientConfig config, ClientHandler handler, ClientFilter...filters) {
    super(config, handler);
    for(ClientFilter filter : filters) {
        super.client.addFilter(filter);
    }
}
项目:Fiazard    文件:ClientRule.java   
@Override
protected void before() throws Throwable {
    ClientHandler handler = new URLConnectionClientHandler();
    ClientConfig config =
            new DefaultClientConfig(ObjectMapperProvider.class);
    client = new Client(handler, config);
}
项目:dbg4j    文件:DebugJerseyFilterTest.java   
@Before
public void setUp() throws Exception {
    next = mock(ClientHandler.class);
    restResponse = mock(ClientResponse.class);
    restRequest = mock(ClientRequest.class);

    filter = new DebugJerseyFilter();
    filter.setAsync(isAsync);
    filter.setDisabled(false);

    DebugContext.init(null);

    ReflectionTestUtils.setField(filter, "next", next);
}
项目:conductor    文件:TaskClient.java   
/**
 * 
 * @param config REST Client configuration
 * @param handler Jersey client handler.  Useful when plugging in various http client interaction modules (e.g. ribbon)
 */
public TaskClient(ClientConfig config, ClientHandler handler) {
    super(config, handler);
}
项目:conductor    文件:WorkflowClient.java   
/**
 * 
 * @param config REST Client configuration
 * @param handler Jersey client handler.  Useful when plugging in various http client interaction modules (e.g. ribbon)
 */
public WorkflowClient(ClientConfig config, ClientHandler handler) {
    super(config, handler);
}