Package org.jboss.resteasy.client

Examples of org.jboss.resteasy.client.ClientRequest.post()


      customer.setZip("01711");
      customer.setCountry("USA");

      request = new ClientRequest(customers.getHref());
      request.body("application/xml", customer);
      response = request.post();
      Assert.assertEquals(201, response.getStatus());

      Link orders = shoppingLinks.get("orders");

      Order order = new Order();
View Full Code Here


      System.out.println();
      System.out.println("** Create an order through this URL: " + orders.getHref());
      request = new ClientRequest(orders.getHref());
      request.body("application/xml", order);
      response = request.post();
      Assert.assertEquals(201, response.getStatus());
      String createdOrderUrl = (String) response.getHeaders().getFirst("Location");

      System.out.println();
      System.out.println("** New list of orders");
View Full Code Here

      Link cancel = orderLinks.get("cancel");
      if (cancel != null)
      {
         System.out.println("** Canceling the order at URL: " + cancel.getHref());
         request = new ClientRequest(cancel.getHref());
         response = request.post();
         Assert.assertEquals(204, response.getStatus());
      }

      System.out.println();
      System.out.println("** New list of orders after cancel: ");
View Full Code Here

      System.out.println();
      Link purge = ordersLinks.get("purge");
      System.out.println("** Purge cancelled orders at URL: " + purge.getHref());
      request = new ClientRequest(purge.getHref());
      response = request.post();
      Assert.assertEquals(204, response.getStatus());

      System.out.println();
      System.out.println("** New list of orders after purge: ");
      request = new ClientRequest(orders.getHref());
View Full Code Here

   @Test
   public void testEmptyMap() throws Exception
   {
      ClientRequest request = new ClientRequest(generateURL("/map/empty"));
      request.body("application/json", "{}");
      ClientResponse<String> response = request.post(String.class);
      Assert.assertEquals(200, response.getStatus());
      Assert.assertEquals("{}", response.getEntity());

   }
}
View Full Code Here

      contentSignature.setDomain("samplezone.org");
      contentSignature.setSelector("test");
      contentSignature.setPrivateKey(keys.getPrivate());
      request.header(DKIMSignature.DKIM_SIGNATURE, contentSignature);
      request.body("text/plain", "hello world");
      ClientResponse response = request.post();
      Assert.assertEquals(204, response.getStatus());


   }
View Full Code Here

      contentSignature.setSelector("test");
      contentSignature.setAttribute("code", "hello");
      contentSignature.setPrivateKey(keys.getPrivate());
      request.header(DKIMSignature.DKIM_SIGNATURE, contentSignature);
      request.body("text/plain", "hello world");
      ClientResponse response = request.post();
      Assert.assertEquals(204, response.getStatus());


   }
View Full Code Here

      contentSignature.setDomain("samplezone.org");
      request.getAttributes().put(KeyRepository.class.getName(), repository);

      request.header(DKIMSignature.DKIM_SIGNATURE, contentSignature);
      request.body("text/plain", "hello world");
      ClientResponse response = request.post();
      Assert.assertEquals(204, response.getStatus());


   }
View Full Code Here

      contentSignature.setSelector("test");
      contentSignature.setDomain("samplezone.org");
      contentSignature.setPrivateKey(badKey);
      request.header(DKIMSignature.DKIM_SIGNATURE, contentSignature);
      request.body("text/plain", "hello world");
      ClientResponse response = request.post();
      Assert.assertEquals(401, response.getStatus());
   }

   @Test
   public void testBasicVerificationNoSignature() throws Exception
View Full Code Here

   @Test
   public void testBasicVerificationNoSignature() throws Exception
   {
      ClientRequest request = new ClientRequest(TestPortProvider.generateURL("/signed"));
      request.body("text/plain", "hello world");
      ClientResponse response = request.post();
      Assert.assertEquals(401, response.getStatus());
   }

   @Test
   public void testTimestampSignature() throws Exception
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.