Package org.jboss.resteasy.client

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


//   @Ignore
   public void testFieldValid() throws Exception
   {
      before(TestResourceWithValidField.class);
      ClientRequest request = new ClientRequest(generateURL("/"));
      ClientResponse<?> response = request.post();
      Assert.assertEquals(204, response.getStatus());
      response.releaseConnection();
      after();
   }
View Full Code Here


//   @Ignore
   public void testFieldInvalid() throws Exception
   {
      before(TestResourceWithInvalidField.class);
      ClientRequest request = new ClientRequest(generateURL("/"));
      ClientResponse<?> response = request.post();
      Assert.assertEquals(400, response.getStatus());
      Object entity = response.getEntity(String.class);
      ViolationReport r = new ViolationReport(String.class.cast(entity));
      countViolations(r, 1, 0, 0, 0, 0);
      ResteasyConstraintViolation cv = r.getFieldViolations().iterator().next();
View Full Code Here

//   @Ignore
   public void testPropertyValid() throws Exception
   {
      before(TestResourceWithProperty.class);
      ClientRequest request = new ClientRequest(generateURL("/abc/unused"));
      ClientResponse<?> response = request.post();
      Assert.assertEquals(204, response.getStatus());
      response.releaseConnection();
      after();
   }
View Full Code Here

//   @Ignore
   public void testPropertyInvalid() throws Exception
   {
      before(TestResourceWithProperty.class);
      ClientRequest request = new ClientRequest(generateURL("/abcdef/unused"));
      ClientResponse<?> response = request.post(String.class);
      Assert.assertEquals(400, response.getStatus());
      Object entity = response.getEntity();
      ViolationReport r = new ViolationReport(String.class.cast(entity));
      countViolations(r, 0, 1, 0, 0, 0);
      ResteasyConstraintViolation cv = r.getPropertyViolations().iterator().next();
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());
      response.releaseConnection();


   }
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());
      response.releaseConnection();

   }
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());
      response.releaseConnection();

   }
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());
      response.releaseConnection();
   }

   @Test
View Full Code Here

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

   @Test
View Full Code Here

      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

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.