Package org.jboss.resteasy.client.jaxrs

Examples of org.jboss.resteasy.client.jaxrs.ResteasyWebTarget.request()


      Assert.assertEquals(200, response.getStatus());
      Assert.assertEquals("bee%20bop", entity);
      response.close();

      target = client.target("http://localhost:8081/decoded/segment/matrix/params;m=bee bop");
      response = target.request().get();
      entity = response.readEntity(String.class);
      System.out.println("Received decoded matrix param from segment: " + entity);
      Assert.assertEquals(200, response.getStatus());
      Assert.assertEquals("bee bop", entity);
      response.close();
View Full Code Here


   @Test
   public void testMatrixParamRequestDecoded() throws Exception
   {
      ResteasyWebTarget target = client.target("http://localhost:8081/decoded").matrixParam("param", "ac/dc");
      Response response = target.request().get();
      Assert.assertEquals(200, response.getStatus());
      Assert.assertEquals("ac/dc", response.readEntity(String.class));
      response.close();
   }
  
View Full Code Here

  
   @Test
   public void testMatrixParamRequestEncoded() throws Exception
   {
      ResteasyWebTarget target = client.target("http://localhost:8081/encoded").matrixParam("param", "ac/dc");
      Response response = target.request().get();
      Assert.assertEquals(200, response.getStatus());
      Assert.assertEquals("ac%2Fdc", response.readEntity(String.class));
      response.close();
   }
  
View Full Code Here

   {
      UriBuilder uriBuilder = ResteasyUriBuilder.fromUri("http://localhost:8081/decoded");
      uriBuilder.matrixParam("param", "ac/dc");
      ResteasyWebTarget target = client.target(uriBuilder.build().toString());
      System.out.println("Sending request to " + uriBuilder.build().toString());
      Response response = target.request().get();
      String entity = response.readEntity(String.class);
      System.out.println("Received response: " + entity);
      Assert.assertEquals(200, response.getStatus());
      Assert.assertEquals("ac/dc", entity);
      response.close();
View Full Code Here

   {
      UriBuilder uriBuilder = ResteasyUriBuilder.fromUri("http://localhost:8081/encoded");
      uriBuilder.matrixParam("param", "ac/dc");
      ResteasyWebTarget target = client.target(uriBuilder.build().toString());
      System.out.println("Sending request to " + uriBuilder.build().toString());
      Response response = target.request().get();
      String entity = response.readEntity(String.class);
      System.out.println("Received response: " + entity);
      Assert.assertEquals(200, response.getStatus());
      Assert.assertEquals("ac%2Fdc", entity);
      response.close();
View Full Code Here

      ResteasyClient client = new ResteasyClientBuilder().providerFactory(deployment.getProviderFactory()).build();
      Response response = client.target(generateURL("/roles")).request().post(Entity.json(newRole));
      Assert.assertEquals(response.getStatus(), 201);
      response.close();
      ResteasyWebTarget target = client.target(response.getLocation());
      String role = target.request().get(String.class);
      System.out.println(role);
      Role u = target.request().get(Role.class);
      System.out.println(u);
      Assert.assertEquals("admin", u.getName());
      Assert.assertEquals("5", u.getId());
View Full Code Here

      Assert.assertEquals(response.getStatus(), 201);
      response.close();
      ResteasyWebTarget target = client.target(response.getLocation());
      String role = target.request().get(String.class);
      System.out.println(role);
      Role u = target.request().get(Role.class);
      System.out.println(u);
      Assert.assertEquals("admin", u.getName());
      Assert.assertEquals("5", u.getId());
      u.setName("administrator");
      Assert.assertEquals(target.request().put(Entity.json(u)).getStatus(), 204);
View Full Code Here

      Role u = target.request().get(Role.class);
      System.out.println(u);
      Assert.assertEquals("admin", u.getName());
      Assert.assertEquals("5", u.getId());
      u.setName("administrator");
      Assert.assertEquals(target.request().put(Entity.json(u)).getStatus(), 204);
      u = target.request().get(Role.class);
      System.out.println(u);
      Assert.assertEquals("administrator", u.getName());
      Assert.assertEquals("5", u.getId());
      Assert.assertEquals(target.request().delete().getStatus(), 204);
View Full Code Here

      System.out.println(u);
      Assert.assertEquals("admin", u.getName());
      Assert.assertEquals("5", u.getId());
      u.setName("administrator");
      Assert.assertEquals(target.request().put(Entity.json(u)).getStatus(), 204);
      u = target.request().get(Role.class);
      System.out.println(u);
      Assert.assertEquals("administrator", u.getName());
      Assert.assertEquals("5", u.getId());
      Assert.assertEquals(target.request().delete().getStatus(), 204);
      response = target.request().get();
View Full Code Here

      Assert.assertEquals(target.request().put(Entity.json(u)).getStatus(), 204);
      u = target.request().get(Role.class);
      System.out.println(u);
      Assert.assertEquals("administrator", u.getName());
      Assert.assertEquals("5", u.getId());
      Assert.assertEquals(target.request().delete().getStatus(), 204);
      response = target.request().get();
      Assert.assertEquals(404, response.getStatus());
      client.close();
   }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.