Package org.jboss.resteasy.client

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


      {
         // Unmarshal report,
         ClientRequest request = new ClientRequest(generateURL("/abc/pqr/xyz"));
         Foo foo = new Foo("123");
         request.body("application/foo", foo);
         request.accept(MediaType.APPLICATION_XML);
         ClientResponse<?> response = request.post(Foo.class);
         Assert.assertEquals(500, response.getStatus());
         ViolationReport report = response.getEntity(ViolationReport.class);
         System.out.println("report: " + report);
         countViolations(report, 1, 0, 0, 0, 0, 1);
View Full Code Here


      {
         // Text form
         ClientRequest request = new ClientRequest(generateURL("/a/b/c"));
         Foo foo = new Foo("p");
         request.body("application/foo", foo);
         request.accept(mediaType);
         ClientResponse<?> response = request.post(Foo.class);
         Assert.assertEquals(400, response.getStatus());
         String entity = response.getEntity(String.class);
         System.out.println("report: " + entity);
         String start = "{\"exception\":null,\"fieldViolations\":[";
View Full Code Here

      {
         // Unmarshal report,
         ClientRequest request = new ClientRequest(generateURL("/a/b/c"));
         Foo foo = new Foo("p");
         request.body("application/foo", foo);
         request.accept(MediaType.APPLICATION_XML);
         ClientResponse<?> response = request.post(Foo.class);
         Assert.assertEquals(400, response.getStatus());
         ViolationReport report = response.getEntity(ViolationReport.class);
         System.out.println("report: " + report);
         countViolations(report, 4, 2, 1, 1, 1, 0);
View Full Code Here

      {
         // Text form
         ClientRequest request = new ClientRequest(generateURL("/abc/pqr/xyz"));
         Foo foo = new Foo("123");
         request.body("application/foo", foo);
         request.accept(mediaType);
         ClientResponse<?> response = request.post(Foo.class);
         Assert.assertEquals(500, response.getStatus());
         String entity = response.getEntity(String.class);
         System.out.println("report: " + entity);
         String start = "\"exception\":null";
View Full Code Here

      {
         // Unmarshal report,
         ClientRequest request = new ClientRequest(generateURL("/abc/pqr/xyz"));
         Foo foo = new Foo("123");
         request.body("application/foo", foo);
         request.accept(MediaType.APPLICATION_XML);
         ClientResponse<?> response = request.post(Foo.class);
         Assert.assertEquals(500, response.getStatus());
         ViolationReport report = response.getEntity(ViolationReport.class);
         System.out.println("report: " + report);
         countViolations(report, 1, 0, 0, 0, 0, 1);
View Full Code Here

   {
      beforeFoo(TestResourceWithAllFivePotentialViolations.class);
      ClientRequest request = new ClientRequest(generateURL("/a/b/c"));
      Foo foo = new Foo("p");
      request.body("application/foo", foo);
      request.accept(mediaType);
      ClientResponse<?> response = request.post(Foo.class);
      Assert.assertEquals(400, response.getStatus());
      String entity = response.getEntity(String.class);
      System.out.println("report:");
      System.out.println(entity);
View Full Code Here

   {
      beforeFoo(TestResourceWithAllFivePotentialViolations.class);
      ClientRequest request = new ClientRequest(generateURL("/abc/pqr/xyz"));
      Foo foo = new Foo("123");
      request.body("application/foo", foo);
      request.accept(mediaType);
      ClientResponse<?> response = request.post(Foo.class);
      Assert.assertEquals(500, response.getStatus());
      String entity = response.getEntity(String.class);
      System.out.println("report: " + entity);
      String returnValueViolation =
View Full Code Here

      {
         // Text form
         ClientRequest request = new ClientRequest(generateURL("/a/b/c"));
         Foo foo = new Foo("p");
         request.body("application/foo", foo);
         request.accept(mediaType);
         ClientResponse<?> response = request.post(Foo.class);
         Assert.assertEquals(400, response.getStatus());
         String entity = response.getEntity(String.class);
         System.out.println("report: " + entity);
         String start = "<violationReport>";
View Full Code Here

      {
         // Unmarshal report,
         ClientRequest request = new ClientRequest(generateURL("/a/b/c"));
         Foo foo = new Foo("p");
         request.body("application/foo", foo);
         request.accept(MediaType.APPLICATION_XML);
         ClientResponse<?> response = request.post(Foo.class);
         Assert.assertEquals(400, response.getStatus());
         ViolationReport report = response.getEntity(ViolationReport.class);
         System.out.println("report: " + report);
         countViolations(report, 4, 2, 1, 1, 1, 0);
View Full Code Here

      {
         // Text form
         ClientRequest request = new ClientRequest(generateURL("/abc/pqr/xyz"));
         Foo foo = new Foo("123");
         request.body("application/foo", foo);
         request.accept(mediaType);
         ClientResponse<?> response = request.post(Foo.class);
         Assert.assertEquals(500, response.getStatus());
         String entity = response.getEntity(String.class);
         System.out.println("report: " + entity);
         String expected = "<violationReport><returnValueViolations><constraintType>RETURN_VALUE</constraintType><path>TestResourceWithAllFivePotentialViolations#post()</path><message>s must have length: 4 &lt;= length &lt;= 5</message><value>Foo[123]</value></returnValueViolations></violationReport>";
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.