Search in sources :

Example 56 with WebTarget

use of javax.ws.rs.client.WebTarget in project jersey by jersey.

the class SingletonDependentBeanTest method testGet.

@Test
public void testGet() {
    final WebTarget singleton = target().path("jcdibean/dependent/singleton").path(p).queryParam("x", x);
    String s = singleton.request().get(String.class);
    assertThat(s, containsString(singleton.getUri().toString()));
    assertThat(s, containsString(String.format("p=%s", p)));
    assertThat(s, containsString(String.format("queryParam=%s", x)));
}
Also used : WebTarget(javax.ws.rs.client.WebTarget) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) Test(org.junit.Test)

Example 57 with WebTarget

use of javax.ws.rs.client.WebTarget in project jersey by jersey.

the class FollowRedirectsTest method testDontFollow.

@Test
public void testDontFollow() {
    WebTarget t = target("test/redirect");
    assertEquals(303, t.request().get().getStatus());
}
Also used : WebTarget(javax.ws.rs.client.WebTarget) Test(org.junit.Test) JerseyTest(org.glassfish.jersey.test.JerseyTest)

Example 58 with WebTarget

use of javax.ws.rs.client.WebTarget in project jersey by jersey.

the class NoEntityTest method testGetWithClose.

@Test
public void testGetWithClose() {
    WebTarget r = target("test");
    for (int i = 0; i < 5; i++) {
        Response cr = r.request().get();
        cr.close();
    }
}
Also used : Response(javax.ws.rs.core.Response) WebTarget(javax.ws.rs.client.WebTarget) Test(org.junit.Test) JerseyTest(org.glassfish.jersey.test.JerseyTest)

Example 59 with WebTarget

use of javax.ws.rs.client.WebTarget in project jersey by jersey.

the class NoEntityTest method testPostWithClose.

@Test
public void testPostWithClose() {
    WebTarget r = target("test");
    for (int i = 0; i < 5; i++) {
        Response cr = r.request().post(null);
        cr.close();
    }
}
Also used : Response(javax.ws.rs.core.Response) WebTarget(javax.ws.rs.client.WebTarget) Test(org.junit.Test) JerseyTest(org.glassfish.jersey.test.JerseyTest)

Example 60 with WebTarget

use of javax.ws.rs.client.WebTarget in project jersey by jersey.

the class NoEntityTest method testGet.

@Test
public void testGet() {
    WebTarget r = target("test");
    for (int i = 0; i < 5; i++) {
        Response cr = r.request().get();
        cr.close();
    }
}
Also used : Response(javax.ws.rs.core.Response) WebTarget(javax.ws.rs.client.WebTarget) Test(org.junit.Test) JerseyTest(org.glassfish.jersey.test.JerseyTest)

Aggregations

WebTarget (javax.ws.rs.client.WebTarget)1393 Response (javax.ws.rs.core.Response)712 Test (org.junit.Test)702 Client (javax.ws.rs.client.Client)318 JerseyTest (org.glassfish.jersey.test.JerseyTest)297 Invocation (javax.ws.rs.client.Invocation)106 List (java.util.List)76 ProcessingException (javax.ws.rs.ProcessingException)71 Builder (javax.ws.rs.client.Invocation.Builder)71 ClientBuilder (javax.ws.rs.client.ClientBuilder)69 GenericType (javax.ws.rs.core.GenericType)64 ArrayList (java.util.ArrayList)61 IOException (java.io.IOException)59 Message (com.remswork.project.alice.model.support.Message)58 PulsarAdminException (org.apache.pulsar.client.admin.PulsarAdminException)58 InputStream (java.io.InputStream)52 NamespaceName (org.apache.pulsar.common.naming.NamespaceName)52 ClientConfig (org.glassfish.jersey.client.ClientConfig)52 Form (javax.ws.rs.core.Form)42 MultiPart (org.glassfish.jersey.media.multipart.MultiPart)42