当前位置: 首页>>代码示例>>Java>>正文


Java JerseyClientBuilder.createClient方法代码示例

本文整理汇总了Java中org.glassfish.jersey.client.JerseyClientBuilder.createClient方法的典型用法代码示例。如果您正苦于以下问题:Java JerseyClientBuilder.createClient方法的具体用法?Java JerseyClientBuilder.createClient怎么用?Java JerseyClientBuilder.createClient使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.glassfish.jersey.client.JerseyClientBuilder的用法示例。


在下文中一共展示了JerseyClientBuilder.createClient方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSwaggerYaml

import org.glassfish.jersey.client.JerseyClientBuilder; //导入方法依赖的package包/类
@Test
public void testSwaggerYaml() {
	Client client = JerseyClientBuilder.createClient();
	
	WebTarget target = client.target("http://localhost:" + port + "/docs1").queryParam("type", "yaml");
	Response response = target.request().get();
	Assert.assertEquals(200, response.getStatus());
	Assert.assertNotNull(response.getEntity());
	Assert.assertEquals("application/yaml", response.getMediaType().toString());
	
	target = client.target("http://localhost:" + port + "/docs2").queryParam("type", "yaml");
	response = target.request().get();
	Assert.assertEquals(200, response.getStatus());
	Assert.assertNotNull(response.getEntity());
	Assert.assertEquals("application/yaml", response.getMediaType().toString());
}
 
开发者ID:holon-platform,项目名称:holon-jaxrs,代码行数:17,代码来源:TestSwaggerJerseyAutoConfigurationGroups.java

示例2: testSwaggerJson

import org.glassfish.jersey.client.JerseyClientBuilder; //导入方法依赖的package包/类
@Test
public void testSwaggerJson() {
	Client client = JerseyClientBuilder.createClient();
	
	WebTarget target = client.target("http://localhost:" + port + "/docs1");
	Response response = target.request().get();
	Assert.assertEquals(200, response.getStatus());
	Assert.assertNotNull(response.getEntity());
	Assert.assertEquals("application/json", response.getMediaType().toString());
	
	target = client.target("http://localhost:" + port + "/docs2");
	response = target.request().get();
	Assert.assertEquals(200, response.getStatus());
	Assert.assertNotNull(response.getEntity());
	Assert.assertEquals("application/json", response.getMediaType().toString());
}
 
开发者ID:holon-platform,项目名称:holon-jaxrs,代码行数:17,代码来源:TestSwaggerJerseyAutoConfigurationGroups.java

示例3: testSwaggerYaml

import org.glassfish.jersey.client.JerseyClientBuilder; //导入方法依赖的package包/类
@Test
public void testSwaggerYaml() {
	Client client = JerseyClientBuilder.createClient();

	WebTarget target = client.target("http://localhost:" + port + "/v1/docs").queryParam("type", "yaml");
	Response response = target.request().get();
	Assert.assertEquals(200, response.getStatus());
	Assert.assertNotNull(response.getEntity());
	Assert.assertEquals("application/yaml", response.getMediaType().toString());

	target = client.target("http://localhost:" + port + "/v2/docs").queryParam("type", "yaml");
	response = target.request().get();
	Assert.assertEquals(200, response.getStatus());
	Assert.assertNotNull(response.getEntity());
	Assert.assertEquals("application/yaml", response.getMediaType().toString());
}
 
开发者ID:holon-platform,项目名称:holon-jaxrs,代码行数:17,代码来源:TestSwaggerJerseyAutoDetectMulti.java

示例4: Pandora

import org.glassfish.jersey.client.JerseyClientBuilder; //导入方法依赖的package包/类
public Pandora(AnnaConfig config) {
    this.appId = config.getPandora().getAppId();
    this.userKey = config.getPandora().getUserKey();
    this.pandoraBot = config.getPandora().getBot();

    ClientConfig cfg = new ClientConfig(JacksonJsonProvider.class);
    cfg.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
    client = JerseyClientBuilder.createClient(cfg);
}
 
开发者ID:wireapp,项目名称:anna-bot,代码行数:10,代码来源:Pandora.java

示例5: testEndpoint

import org.glassfish.jersey.client.JerseyClientBuilder; //导入方法依赖的package包/类
@Test
public void testEndpoint() {
	Client client = JerseyClientBuilder.createClient();
	WebTarget target = client.target("http://localhost:" + port + "/test2").path("ping");
	String response = target.request().get(String.class);
	Assert.assertEquals("pong", response);
}
 
开发者ID:holon-platform,项目名称:holon-jaxrs,代码行数:8,代码来源:TestSwaggerJerseyAutoConfigurationResource.java

示例6: testEndpoint

import org.glassfish.jersey.client.JerseyClientBuilder; //导入方法依赖的package包/类
@Test
public void testEndpoint() {
	Client client = JerseyClientBuilder.createClient();
	WebTarget target = client.target("http://localhost:" + port + "/api/test").path("ping");
	String response = target.request().get(String.class);
	Assert.assertEquals("pong", response);
}
 
开发者ID:holon-platform,项目名称:holon-jaxrs,代码行数:8,代码来源:TestSwaggerJerseyAutoConfigurationPath.java

示例7: testSwaggerYaml

import org.glassfish.jersey.client.JerseyClientBuilder; //导入方法依赖的package包/类
@Test
public void testSwaggerYaml() {
	Client client = JerseyClientBuilder.createClient();
	WebTarget target = client.target("http://localhost:" + port + "/docs").queryParam("type", "yaml");
	Response response = target.request().get();
	Assert.assertEquals(200, response.getStatus());
	Assert.assertNotNull(response.getEntity());
	Assert.assertEquals("application/yaml", response.getMediaType().toString());
}
 
开发者ID:holon-platform,项目名称:holon-jaxrs,代码行数:10,代码来源:TestSwaggerJerseyAutoConfigurationResource.java

示例8: testSwaggerYaml

import org.glassfish.jersey.client.JerseyClientBuilder; //导入方法依赖的package包/类
@Test
public void testSwaggerYaml() {
	Client client = JerseyClientBuilder.createClient();
	WebTarget target = client.target("http://localhost:" + port + "/api/docs").queryParam("type", "yaml");
	Response response = target.request().get();
	Assert.assertEquals(200, response.getStatus());
	Assert.assertNotNull(response.getEntity());
	Assert.assertEquals("application/yaml", response.getMediaType().toString());
}
 
开发者ID:holon-platform,项目名称:holon-jaxrs,代码行数:10,代码来源:TestSwaggerJerseyAutoConfigurationPath.java

示例9: testSwaggerJson

import org.glassfish.jersey.client.JerseyClientBuilder; //导入方法依赖的package包/类
@Test
public void testSwaggerJson() {
	Client client = JerseyClientBuilder.createClient();
	WebTarget target = client.target("http://localhost:" + port + "/docs");
	Response response = target.request().get();
	Assert.assertEquals(200, response.getStatus());
	Assert.assertNotNull(response.getEntity());
	Assert.assertEquals("application/json", response.getMediaType().toString());
}
 
开发者ID:holon-platform,项目名称:holon-jaxrs,代码行数:10,代码来源:TestSwaggerJerseyAutoDetectCfg.java

示例10: testEndpoint

import org.glassfish.jersey.client.JerseyClientBuilder; //导入方法依赖的package包/类
@Test
public void testEndpoint() {
	Client client = JerseyClientBuilder.createClient();
	WebTarget target = client.target("http://localhost:" + port + "/test3").path("ping");
	String response = target.request().get(String.class);
	Assert.assertEquals("pong", response);
}
 
开发者ID:holon-platform,项目名称:holon-jaxrs,代码行数:8,代码来源:TestSwaggerJerseyAutoDetect.java

示例11: testEndpoint

import org.glassfish.jersey.client.JerseyClientBuilder; //导入方法依赖的package包/类
@Test
public void testEndpoint() {
	Client client = JerseyClientBuilder.createClient();
	WebTarget target = client.target("http://localhost:" + port + "/test").path("ping");
	String response = target.request().get(String.class);
	Assert.assertEquals("pong", response);
}
 
开发者ID:holon-platform,项目名称:holon-jaxrs,代码行数:8,代码来源:TestSwaggerDisabled.java

示例12: testEndpoints

import org.glassfish.jersey.client.JerseyClientBuilder; //导入方法依赖的package包/类
@Test
public void testEndpoints() {
	Client client = JerseyClientBuilder.createClient();

	WebTarget target = client.target("http://localhost:" + port + "/v1").path("ping");
	String response = target.request().get(String.class);
	Assert.assertEquals("pong", response);

	target = client.target("http://localhost:" + port + "/v2").path("ping");
	response = target.request().get(String.class);
	Assert.assertEquals("pong", response);
}
 
开发者ID:holon-platform,项目名称:holon-jaxrs,代码行数:13,代码来源:TestSwaggerJerseyAutoDetectMulti.java

示例13: setUp

import org.glassfish.jersey.client.JerseyClientBuilder; //导入方法依赖的package包/类
@Before
public void setUp() {
    baseUrl = format("http://localhost:%d", port);
    final JerseyClient client = JerseyClientBuilder.createClient();
    client.property(ClientProperties.FOLLOW_REDIRECTS, false);
    target = client.target(baseUrl + "/stormpath");
}
 
开发者ID:shiver-me-timbers,项目名称:smt-spring-security-parent,代码行数:8,代码来源:ITSpringSecurityStormpathApplicationHref.java

示例14: setUp

import org.glassfish.jersey.client.JerseyClientBuilder; //导入方法依赖的package包/类
@Before
public void setUp() {
    baseUrl = format("http://localhost:%d", port);
    final JerseyClient client = JerseyClientBuilder.createClient();
    client.property(ClientProperties.FOLLOW_REDIRECTS, false);
    target = client.target(baseUrl + "/all");
}
 
开发者ID:shiver-me-timbers,项目名称:smt-spring-security-parent,代码行数:8,代码来源:AbstractSpringSecurityAll.java

示例15: setUp

import org.glassfish.jersey.client.JerseyClientBuilder; //导入方法依赖的package包/类
@Before
public void setUp() {
    final JerseyClient client = JerseyClientBuilder.createClient();
    client.property(ClientProperties.FOLLOW_REDIRECTS, false);
    annotationTarget = client.target(format("http://localhost:%d/jwt", port));
    normalTarget = client.target(format("http://localhost:%d/normal", port));
}
 
开发者ID:shiver-me-timbers,项目名称:smt-spring-security-parent,代码行数:8,代码来源:AbstractSpringSecurityJwtAnnotation.java


注:本文中的org.glassfish.jersey.client.JerseyClientBuilder.createClient方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。