Examples of ViolationReport


Examples of org.jboss.resteasy.api.validation.ViolationReport

         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);
         ResteasyConstraintViolation cv = report.getReturnValueViolations().iterator().next();
         System.out.println("message: " + cv.getMessage());
         System.out.println("value: " + cv.getValue());
         Assert.assertEquals("s must have length: 4 <= length <= 5", cv.getMessage());
         Assert.assertEquals(foo.toString(), cv.getValue());
      }
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.