Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1165

TestBeanValidationIntegrationSmoke test should always catch error of validation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 3.0.15.Final
    • 3.0.10.Final
    • None
    • None
    • Pull Request merged.

    Description

      TestBeanValidationIntegrationSmoke test should always catch error of validation

      Maven project: jaxrs/providers/resteasy-hibernatevalidator-provider
      Class: org.jboss.resteasy.test.plugins.validation.smoke.TestBeanValidationIntegrationSmoke

      This class contains many parts of code like this:

      try {
          input.setAge(1000);
          resource.insert(input);
      } catch (ClientResponseFailure e) {
          Assert.assertEquals(400, e.getResponse().getStatus());
      }
      

      Assert.fail() should be added at the end of try block (exception in resource.insert(input); should be thrown everytime):

      try {
          input.setAge(1000);
          resource.insert(input);
          Assert.fail("Validation error.");
      } catch (ClientResponseFailure e) {
          Assert.assertEquals(400, e.getResponse().getStatus());
      }
      

      But shouldRespectInsertGroup test from TestBeanValidationIntegrationSmoke.java fails with this modification, so validation in this test is incorrect.

      Attachments

        Issue Links

          Activity

            People

              rsigal@redhat.com Ronald Sigal
              mkopecky@redhat.com Marek Kopecky
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: