Examples of MinDef


Examples of org.hibernate.validator.cfg.defs.MinDef

  public void testConstraintMappingWithConstraintDefs() {
    mapping.type( Marathon.class )
        .property( "name", METHOD )
        .constraint( new NotNullDef() )
        .property( "numberOfHelpers", FIELD )
        .constraint( new MinDef().value( 1 ) );

    BeanConfiguration<Marathon> beanConfiguration = getBeanConfiguration( Marathon.class );
    assertNotNull( beanConfiguration );
    assertEquals( getConstrainedField( beanConfiguration, "numberOfHelpers" ).getConstraints().size(), 1 );
    assertEquals( getConstrainedExecutable( beanConfiguration, "getName" ).getConstraints().size(), 1 );
View Full Code Here

Examples of org.hibernate.validator.cfg.defs.MinDef

  @Test
  public void testDefConstraintFollowedByGenericConstraint() {
    mapping.type( Marathon.class )
        .property( "numberOfHelpers", FIELD )
        .constraint( new MinDef().value( 1 ) )
        .constraint( new GenericConstraintDef<Min>( Min.class ).param( "value", 2L ) );

    BeanConfiguration<Marathon> beanConfiguration = getBeanConfiguration( Marathon.class );
    assertNotNull( beanConfiguration );
    assertEquals( getConstrainedField( beanConfiguration, "numberOfHelpers" ).getConstraints().size(), 2 );
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.