Package org.jboss.resteasy.client.jaxrs

Examples of org.jboss.resteasy.client.jaxrs.ResteasyClient.target()


         Assert.assertEquals("put hello", entity);

      }

      {
          Response res = client.target(generateURL("/test")).request().buildPost(Entity.text("hello")).invoke();
          Assert.assertEquals(200, res.getStatus());
          String entity = res.readEntity(String.class);
          Assert.assertEquals("post hello", entity);

       }
View Full Code Here


          String entity = res.readEntity(String.class);
          Assert.assertEquals("post hello", entity);

       }
      {
         String entity = client.target(generateURL("/test")).request().buildPost(Entity.text("hello")).invoke(String.class);
         Assert.assertEquals("post hello", entity);

      }

      {
View Full Code Here

         Assert.assertEquals("post hello", entity);

      }

      {
          Response res = client.target(generateURL("/test")).request().build("PATCH", Entity.text("hello")).invoke();
          Assert.assertEquals(200, res.getStatus());
          String entity = res.readEntity(String.class);
          Assert.assertEquals("patch hello", entity);

       }
View Full Code Here

          String entity = res.readEntity(String.class);
          Assert.assertEquals("patch hello", entity);

       }
      {
         String entity = client.target(generateURL("/test")).request().build("PATCH", Entity.text("hello")).invoke(String.class);
         Assert.assertEquals("patch hello", entity);

      }
      client.close();
   }
View Full Code Here

//                 .providerFactory(factory)
                 .trustStore(session.getMetadata().getTruststore())
                 .hostnameVerification(ResteasyClientBuilder.HostnameVerificationPolicy.ANY).build();
      try
      {
         Response response = client.target("https://localhost:8443/database/products").request()
                 .header(HttpHeaders.AUTHORIZATION, "Bearer " + session.getToken()).get();
         return response.readEntity(new GenericType<List<String>>(){});
      }
      finally
      {
View Full Code Here

    @Test
    public void test() throws Exception
    {
       ResteasyClient client = new ResteasyClientBuilder().build();
        WebTarget target = client.target("http://localhost:8081/test/one/");
        System.out.println("Sending request");
        Response response = target.request().get();
       String entity = response.readEntity(String.class);
       System.out.println("Received response: " + entity);
        Assert.assertEquals(200, response.getStatus());
View Full Code Here

       System.out.println("Received response: " + entity);
        Assert.assertEquals(200, response.getStatus());
        Assert.assertTrue("Type property is missing.", entity.contains("type"));
       response.close();

       target = client.target("http://localhost:8081/test/list/");
        System.out.println("Sending request");
        response = target.request().get();
        entity = response.readEntity(String.class);
       System.out.println("Received response: " + entity);
        Assert.assertEquals(200, response.getStatus());
View Full Code Here

//   @Test
   public void testDispatchStatic() throws Exception
   {
      log.info("starting testFilter()");
      ResteasyClient client = new ResteasyClientBuilder().build();
      Invocation.Builder request = client.target("http://localhost:8080/RESTEASY-903/test/dispatch/static").request();
      Response response = request.get();
      log.info("Status: " + response.getStatus());
      log.info("result: " + response.readEntity(String.class));
      assertEquals(200, response.getStatus());
   }
View Full Code Here

   @Test
   public void testDispatchDynamic() throws Exception
   {
      log.info("starting testFilter()");
      ResteasyClient client = new ResteasyClientBuilder().build();
      Invocation.Builder request = client.target("http://localhost:8080/RESTEASY-903/test/dispatch/dynamic").request();
      Response response = request.get();
      String result = response.readEntity(String.class);
      log.info("Status: " + response.getStatus());
      log.info("result: " + result);
      assertEquals(200, response.getStatus());
View Full Code Here

     @Test
     public void testEcho()
     {
       ResteasyClient client = new ResteasyClientBuilder().build();
       ResteasyWebTarget target = client.target("http://localhost:9095");
       HelloString proxy = target.proxy(HelloString.class);
       String hello = proxy.sayHi("hello");
       Assert.assertEquals("hello", hello);
     }
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.