當前位置: 首頁>>代碼示例>>Java>>正文


Java ClientResponseFilter類代碼示例

本文整理匯總了Java中javax.ws.rs.client.ClientResponseFilter的典型用法代碼示例。如果您正苦於以下問題:Java ClientResponseFilter類的具體用法?Java ClientResponseFilter怎麽用?Java ClientResponseFilter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ClientResponseFilter類屬於javax.ws.rs.client包,在下文中一共展示了ClientResponseFilter類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: shouldRegisterAMultiTypedProviderInstanceWithPriorities

import javax.ws.rs.client.ClientResponseFilter; //導入依賴的package包/類
@Test
public void shouldRegisterAMultiTypedProviderInstanceWithPriorities() {
    MultiTypedProvider provider = new MultiTypedProvider();
    Map<Class<?>, Integer> priorities = new HashMap<>();
    priorities.put(ClientRequestFilter.class, 500);
    priorities.put(ClientResponseFilter.class, 501);
    priorities.put(MessageBodyReader.class, 502);
    priorities.put(MessageBodyWriter.class, 503);
    priorities.put(ReaderInterceptor.class, 504);
    priorities.put(WriterInterceptor.class, 505);
    priorities.put(ResponseExceptionMapper.class, 506);
    priorities.put(ParamConverterProvider.class, 507);
    RestClientBuilder builder = RestClientBuilder.newBuilder().register(provider, priorities);
    Configuration configuration = builder.getConfiguration();
    assertTrue(configuration.isRegistered(MultiTypedProvider.class), MultiTypedProvider.class + " should be registered");
    assertTrue(configuration.isRegistered(provider), MultiTypedProvider.class + " should be registered");
    Map<Class<?>, Integer> contracts = configuration.getContracts(MultiTypedProvider.class);
    assertEquals(contracts.size(), priorities.size(),
        "There should be "+priorities.size()+" provider types registered");
    for(Map.Entry<Class<?>, Integer> priority : priorities.entrySet()) {
        Integer contractPriority = contracts.get(priority.getKey());
        assertEquals(contractPriority, priority.getValue(), "The priority for "+priority.getKey()+" should be "+priority.getValue());
    }
}
 
開發者ID:eclipse,項目名稱:microprofile-rest-client,代碼行數:25,代碼來源:AdditionalRegistrationTest.java

示例2: shouldRegisterAMultiTypedProviderClassWithPriorities

import javax.ws.rs.client.ClientResponseFilter; //導入依賴的package包/類
@Test
public void shouldRegisterAMultiTypedProviderClassWithPriorities() {
    Map<Class<?>, Integer> priorities = new HashMap<>();
    priorities.put(ClientRequestFilter.class, 500);
    priorities.put(ClientResponseFilter.class, 501);
    priorities.put(MessageBodyReader.class, 502);
    priorities.put(MessageBodyWriter.class, 503);
    priorities.put(ReaderInterceptor.class, 504);
    priorities.put(WriterInterceptor.class, 505);
    priorities.put(ResponseExceptionMapper.class, 506);
    priorities.put(ParamConverterProvider.class, 507);
    RestClientBuilder builder = RestClientBuilder.newBuilder().register(MultiTypedProvider.class, priorities);
    Configuration configuration = builder.getConfiguration();
    assertTrue(configuration.isRegistered(MultiTypedProvider.class), MultiTypedProvider.class + " should be registered");
    Map<Class<?>, Integer> contracts = configuration.getContracts(MultiTypedProvider.class);
    assertEquals(contracts.size(), priorities.size(),
        "There should be "+priorities.size()+" provider types registered");
    for(Map.Entry<Class<?>, Integer> priority : priorities.entrySet()) {
        Integer contractPriority = contracts.get(priority.getKey());
        assertEquals(contractPriority, priority.getValue(), "The priority for "+priority.getKey()+" should be "+priority.getValue());
    }
}
 
開發者ID:eclipse,項目名稱:microprofile-rest-client,代碼行數:23,代碼來源:AdditionalRegistrationTest.java

示例3: shouldRegisterAMultiTypedProviderInstance

import javax.ws.rs.client.ClientResponseFilter; //導入依賴的package包/類
@Test
public void shouldRegisterAMultiTypedProviderInstance() {
    MultiTypedProvider provider = new MultiTypedProvider();
    Class[] providerTypes = {ClientRequestFilter.class, ClientResponseFilter.class,
        MessageBodyReader.class, MessageBodyWriter.class, ReaderInterceptor.class, WriterInterceptor.class,
        ResponseExceptionMapper.class, ParamConverterProvider.class};
    RestClientBuilder builder = RestClientBuilder.newBuilder().register(provider, providerTypes);
    Configuration configuration = builder.getConfiguration();
    assertTrue(configuration.isRegistered(MultiTypedProvider.class), MultiTypedProvider.class + " should be registered");
    assertTrue(configuration.isRegistered(provider), MultiTypedProvider.class + " should be registered");
    assertEquals(configuration.getContracts(MultiTypedProvider.class).size(), providerTypes.length,
        "There should be "+providerTypes.length+" provider types registered");
}
 
開發者ID:eclipse,項目名稱:microprofile-rest-client,代碼行數:14,代碼來源:AdditionalRegistrationTest.java

示例4: shouldRegisterAMultiTypedProviderClass

import javax.ws.rs.client.ClientResponseFilter; //導入依賴的package包/類
@Test
public void shouldRegisterAMultiTypedProviderClass() {
    Class[] providerTypes = {ClientRequestFilter.class, ClientResponseFilter.class,
        MessageBodyReader.class, MessageBodyWriter.class, ReaderInterceptor.class, WriterInterceptor.class,
        ResponseExceptionMapper.class, ParamConverterProvider.class};
    RestClientBuilder builder = RestClientBuilder.newBuilder().register(MultiTypedProvider.class, providerTypes);
    Configuration configuration = builder.getConfiguration();
    assertTrue(configuration.isRegistered(MultiTypedProvider.class), MultiTypedProvider.class + " should be registered");
    assertEquals(configuration.getContracts(MultiTypedProvider.class).size(), providerTypes.length,
        "There should be "+providerTypes.length+" provider types registered");
}
 
開發者ID:eclipse,項目名稱:microprofile-rest-client,代碼行數:12,代碼來源:AdditionalRegistrationTest.java

示例5: getClientResponseFilters

import javax.ws.rs.client.ClientResponseFilter; //導入依賴的package包/類
public ClientResponseFilter[] getClientResponseFilters() {
  return clientResponseFilters.toArray(new ClientResponseFilter[0]);
}
 
開發者ID:Qorr,項目名稱:Hvalspik,代碼行數:4,代碼來源:Config.java

示例6: withClientResponseFilter

import javax.ws.rs.client.ClientResponseFilter; //導入依賴的package包/類
public Config withClientResponseFilter(ClientResponseFilter clientResponseFilter) {
  this.clientResponseFilters.add(clientResponseFilter);
  return this;
}
 
開發者ID:Qorr,項目名稱:Hvalspik,代碼行數:5,代碼來源:Config.java

示例7: withClientResponseFilters

import javax.ws.rs.client.ClientResponseFilter; //導入依賴的package包/類
public JerseyDockerCmdExecFactory withClientResponseFilters(ClientResponseFilter... clientResponseFilter) {
    this.clientResponseFilters = clientResponseFilter;
    return this;
}
 
開發者ID:docker-java,項目名稱:docker-java,代碼行數:5,代碼來源:JerseyDockerCmdExecFactory.java


注:本文中的javax.ws.rs.client.ClientResponseFilter類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。