use of javax.ws.rs.client.WebTarget in project jersey by jersey.
the class JacksonTest method testEmptyArrayBean.
@Test
public void testEmptyArrayBean() {
WebTarget target = target();
EmptyArrayBean responseMsg = target.path("emptyArrayResource").request(MediaType.APPLICATION_JSON).get(EmptyArrayBean.class);
assertNotNull(responseMsg);
}
use of javax.ws.rs.client.WebTarget in project jersey by jersey.
the class JacksonTest method testApplicationWadl.
/**
* Test if a WADL document is available at the relative path
* "application.wadl".
* <p/>
*/
@Test
public void testApplicationWadl() {
WebTarget target = target();
String serviceWadl = target.path("application.wadl").request(MediaTypes.WADL_TYPE).get(String.class);
assertTrue(serviceWadl.length() > 0);
}
use of javax.ws.rs.client.WebTarget in project jersey by jersey.
the class Jackson1Test method testApplicationWadl.
/**
* Test if a WADL document is available at the relative path
* "application.wadl".
* <p/>
*/
@Test
public void testApplicationWadl() {
final WebTarget target = target();
final String serviceWadl = target.path("application.wadl").request(MediaTypes.WADL_TYPE).get(String.class);
assertTrue(serviceWadl.length() > 0);
}
use of javax.ws.rs.client.WebTarget in project jersey by jersey.
the class JsonResourceTest method roundTripTest.
@Test
public void roundTripTest() {
final WebTarget target = target("test");
final TestBean testBean = target.request(MediaType.APPLICATION_JSON_TYPE).post(Entity.entity(new TestBean("a", 1, 1L), MediaType.APPLICATION_JSON_TYPE), TestBean.class);
assertEquals(testBean, new TestBean("a", 1, 1L));
}
use of javax.ws.rs.client.WebTarget in project jersey by jersey.
the class RequestScopeAlignmentTest method testUriInfoPropagatesToApp.
@Test
public void testUriInfoPropagatesToApp() {
for (String d : new String[] { "one", "two", "three" }) {
final WebTarget fieldTarget = target().path("req/ui/jax-rs-field").path(d);
final WebTarget appFieldTarget = target().path("req/ui/jax-rs-app-field").path(d);
String f = fieldTarget.request().get(String.class);
assertThat(f, containsString(fieldTarget.getUri().toString()));
String af = appFieldTarget.request().get(String.class);
assertThat(af, containsString(appFieldTarget.getUri().toString()));
}
}
Aggregations