}
@Test
public void testMethods() throws Exception
{
ResteasyClient client = new ResteasyClientBuilder().build();
{
Response res = client.target(generateURL("/test")).request().get();
Assert.assertEquals(200, res.getStatus());
String entity = res.readEntity(String.class);
Assert.assertEquals("get", entity);
}
{
String entity = client.target(generateURL("/test")).request().get(String.class);
Assert.assertEquals("get", entity);
}
{
Response res = client.target(generateURL("/test")).request().delete();
Assert.assertEquals(200, res.getStatus());
String entity = res.readEntity(String.class);
Assert.assertEquals("delete", entity);
}
{
String entity = client.target(generateURL("/test")).request().delete(String.class);
Assert.assertEquals("delete", entity);
}
{
Response res = client.target(generateURL("/test")).request().put(Entity.text("hello"));
Assert.assertEquals(200, res.getStatus());
String entity = res.readEntity(String.class);
Assert.assertEquals("put hello", entity);
}
{
String entity = client.target(generateURL("/test")).request().put(Entity.text("hello"), String.class);
Assert.assertEquals("put hello", entity);
}
{
Response res = client.target(generateURL("/test")).request().post(Entity.text("hello"));
Assert.assertEquals(200, res.getStatus());
String entity = res.readEntity(String.class);
Assert.assertEquals("post hello", entity);
}
{
String entity = client.target(generateURL("/test")).request().post(Entity.text("hello"), String.class);
Assert.assertEquals("post hello", entity);
}
{
Response res = client.target(generateURL("/test")).request().method("PATCH", Entity.text("hello"));
Assert.assertEquals(200, res.getStatus());
String entity = res.readEntity(String.class);
Assert.assertEquals("patch hello", entity);
}
{
String entity = client.target(generateURL("/test")).request().method("PATCH", Entity.text("hello"), String.class);
Assert.assertEquals("patch hello", entity);
}
client.close();
}