Package org.hibernate.validator.test.internal.engine.valuehandling.model

Examples of org.hibernate.validator.test.internal.engine.valuehandling.model.Customer


        .getValidator();
  }

  @Test
  public void shouldUnwrapPropertyValuesDuringValidation() {
    Set<ConstraintViolation<Customer>> violations = validator.validate( new Customer() );
    assertEquals( violations.size(), 3 );
  }
View Full Code Here


    assertEquals( violations.size(), 3 );
  }

  @Test
  public void shouldUnwrapPropertyValuesDuringParameterValidation() throws Exception {
    Customer customer = new Customer();
    Method method = Customer.class.getMethod( "setName", Property.class );
    Object[] parameterValues = new Object[] { new Property<String>( "Bob" ) };

    Set<ConstraintViolation<Customer>> violations = validator.forExecutables()
        .validateParameters( customer, method, parameterValues );
View Full Code Here

    assertEquals( violations.size(), 1 );
  }

  @Test
  public void shouldUnwrapPropertyValuesDuringReturnValueValidation() throws Exception {
    Customer customer = new Customer();
    Method method = Customer.class.getMethod( "retrieveName" );
    Property<String> returnValue = new Property<String>( "Bob" );

    Set<ConstraintViolation<Customer>> violations = validator.forExecutables()
        .validateReturnValue( customer, method, returnValue );
View Full Code Here

    assertEquals( violations.size(), 1 );
  }

  @Test
  public void shouldUnwrapPropertyValuesDuringPropertyValidation() {
    Set<ConstraintViolation<Customer>> violations = validator.validateProperty( new Customer(), "name" );
    assertEquals( violations.size(), 1 );
  }
View Full Code Here

  }

  @Test
  public void shouldUnwrapPropertyValuesDuringPropertyValidationWithGroup() {
    Set<ConstraintViolation<Customer>> violations = validator.validateProperty(
        new Customer(),
        "middleName",
        Customer.CustomValidationGroup.class
    );
    assertEquals( violations.size(), 1 );
  }
View Full Code Here

            PropertyValueUnwrapper.class.getName() + "," + UiInputValueUnwrapper.class.getName()
        )
        .buildValidatorFactory()
        .getValidator();

    Set<ConstraintViolation<Customer>> violations = validator.validate( new Customer() );
    assertEquals( violations.size(), 3 );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.validator.test.internal.engine.valuehandling.model.Customer

Copyright © 2018 www.massapicom. 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.