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

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


  }

  @Test
  public void validFromOverriddenMethodIsEvaluated() {
    try {
      customerRepository.bar( new Customer( null, null ) );
      fail( "Expected ConstraintViolationException wasn't thrown." );
    }
    catch ( ConstraintViolationException e ) {
      assertEquals( e.getConstraintViolations().size(), 1 );
View Full Code Here


          "cascadingReturnValue.<return value>.name"
      );
      assertEquals( constraintViolation.getLeafBean().getClass(), Customer.class );
      assertEquals( constraintViolation.getInvalidValue(), null );
      assertEquals( constraintViolation.getExecutableParameters(), null );
      assertEquals( constraintViolation.getExecutableReturnValue(), new Customer( null ) );
    }
  }
View Full Code Here

          "overriddenMethodWithCascadingReturnValue.<return value>.name"
      );
      assertEquals( constraintViolation.getLeafBean().getClass(), Customer.class );
      assertEquals( constraintViolation.getInvalidValue(), null );
      assertEquals( constraintViolation.getExecutableParameters(), null );
      assertEquals( constraintViolation.getExecutableReturnValue(), new Customer( null ) );
    }
  }
View Full Code Here

          constraintViolation.getPropertyPath().toString(),
          "cascadingIterableReturnValue.<return value>[1].name"
      );
      assertEquals( constraintViolation.getRootBeanClass(), CustomerRepositoryImpl.class );
      assertEquals( constraintViolation.getRootBean(), customerRepository );
      assertEquals( constraintViolation.getLeafBean(), new Customer( null ) );
      assertEquals( constraintViolation.getInvalidValue(), null );
      assertEquals( constraintViolation.getExecutableParameters(), null );
      assertEquals( constraintViolation.getExecutableReturnValue(), Arrays.asList( null, new Customer( null ) ) );
    }
  }
View Full Code Here

    try {
      customerRepository.cascadingMapReturnValue();
      fail( "Expected ConstraintViolationException wasn't thrown." );
    }
    catch ( ConstraintViolationException e ) {
      Customer customer = new Customer( null );
      Map<String, Customer> expectedReturnValue = newHashMap();
      expectedReturnValue.put( "Bob", customer );

      assertEquals( e.getConstraintViolations().size(), 1 );
View Full Code Here

          constraintViolation.getPropertyPath().toString(),
          "cascadingArrayReturnValue.<return value>[1].name"
      );
      assertEquals( constraintViolation.getRootBeanClass(), CustomerRepositoryImpl.class );
      assertEquals( constraintViolation.getRootBean(), customerRepository );
      assertEquals( constraintViolation.getLeafBean(), new Customer( null ) );
      assertEquals( constraintViolation.getInvalidValue(), null );
      assertEquals( constraintViolation.getExecutableParameters(), null );
      assertEquals( constraintViolation.getExecutableReturnValue(), new Object[] { null, new Customer( null ) } );
    }
  }
View Full Code Here

  @Test
  public void cascadedConstructorParameterValidationYieldsConstraintViolation() throws Exception {
    Set<ConstraintViolation<CustomerRepositoryImpl>> violations = executableValidator.validateConstructorParameters(
        CustomerRepositoryImpl.class.getConstructor( Customer.class ),
        new Customer[] { new Customer( null ) }
    );

    assertThat( violations ).hasSize( 1 );

    ConstraintViolation<CustomerRepositoryImpl> constraintViolation = violations.iterator().next();
View Full Code Here

TOP

Related Classes of org.hibernate.validator.test.internal.engine.methodvalidation.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.