本文整理汇总了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());
}
示例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());
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}
示例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());
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
示例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");
}
示例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