Package org.jboss.resteasy.client.jaxrs

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


      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


   public void testProjects()
   {
      String newProject = "{ \"project\" : { \"name\" : \"Resteasy\", \"description\" : \"The Best of REST\", \"enabled\" : true } }";
      ResteasyClient client = new ResteasyClientBuilder().providerFactory(deployment.getProviderFactory()).build();
      ResteasyWebTarget projectsTarget = client.target(generateURL("/projects"));
      Response response = projectsTarget.request().post(Entity.json(newProject));
      Assert.assertEquals(response.getStatus(), 201);
      response.close();
      ResteasyWebTarget target = client.target(response.getLocation());
      String project = target.request().get(String.class);
      System.out.println(project);
View Full Code Here

      ResteasyWebTarget projectsTarget = client.target(generateURL("/projects"));
      Response response = projectsTarget.request().post(Entity.json(newProject));
      Assert.assertEquals(response.getStatus(), 201);
      response.close();
      ResteasyWebTarget target = client.target(response.getLocation());
      String project = target.request().get(String.class);
      System.out.println(project);
      Project u = target.request().get(Project.class);
      System.out.println(u);
      Assert.assertEquals("Resteasy", u.getName());
      Assert.assertEquals("The Best of REST", u.getDescription());
View Full Code Here

      Assert.assertEquals(response.getStatus(), 201);
      response.close();
      ResteasyWebTarget target = client.target(response.getLocation());
      String project = target.request().get(String.class);
      System.out.println(project);
      Project u = target.request().get(Project.class);
      System.out.println(u);
      Assert.assertEquals("Resteasy", u.getName());
      Assert.assertEquals("The Best of REST", u.getDescription());
      Assert.assertTrue(u.getEnabled());
      u.setName("Resteasy JAX-RS");
View Full Code Here

      System.out.println(u);
      Assert.assertEquals("Resteasy", u.getName());
      Assert.assertEquals("The Best of REST", u.getDescription());
      Assert.assertTrue(u.getEnabled());
      u.setName("Resteasy JAX-RS");
      Assert.assertEquals(target.request().put(Entity.json(u)).getStatus(), 204);
      u = target.request().get(Project.class);
      Assert.assertEquals("Resteasy JAX-RS", u.getName());
      Assert.assertEquals(target.request().delete().getStatus(), 204);
      response = target.request().get();
      Assert.assertEquals(404, response.getStatus());
View Full Code Here

      Assert.assertEquals("Resteasy", u.getName());
      Assert.assertEquals("The Best of REST", u.getDescription());
      Assert.assertTrue(u.getEnabled());
      u.setName("Resteasy JAX-RS");
      Assert.assertEquals(target.request().put(Entity.json(u)).getStatus(), 204);
      u = target.request().get(Project.class);
      Assert.assertEquals("Resteasy JAX-RS", u.getName());
      Assert.assertEquals(target.request().delete().getStatus(), 204);
      response = target.request().get();
      Assert.assertEquals(404, response.getStatus());
      response.close();
View Full Code Here

      Assert.assertTrue(u.getEnabled());
      u.setName("Resteasy JAX-RS");
      Assert.assertEquals(target.request().put(Entity.json(u)).getStatus(), 204);
      u = target.request().get(Project.class);
      Assert.assertEquals("Resteasy JAX-RS", u.getName());
      Assert.assertEquals(target.request().delete().getStatus(), 204);
      response = target.request().get();
      Assert.assertEquals(404, response.getStatus());
      response.close();

      projectsTarget = client.target(generateURL("/projects"));
View Full Code Here

      u.setName("Resteasy JAX-RS");
      Assert.assertEquals(target.request().put(Entity.json(u)).getStatus(), 204);
      u = target.request().get(Project.class);
      Assert.assertEquals("Resteasy JAX-RS", u.getName());
      Assert.assertEquals(target.request().delete().getStatus(), 204);
      response = target.request().get();
      Assert.assertEquals(404, response.getStatus());
      response.close();

      projectsTarget = client.target(generateURL("/projects"));
      Mappers.registerContextResolver(projectsTarget);
View Full Code Here

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

      Assert.assertEquals(response.getStatus(), 201);
      response.close();
      ResteasyWebTarget target = client.target(response.getLocation());
      String project = target.request().get(String.class);
      System.out.println(project);
      Project u = target.request().get(Project.class);
      System.out.println(u);
      Assert.assertEquals("5", u.getId());
      Assert.assertEquals("Resteasy", u.getName());
      Assert.assertEquals("The Best of REST", u.getDescription());
      Assert.assertTrue(u.getEnabled());
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.