Examples of buildConstraintViolationWithTemplate()


Examples of org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorContextImpl.buildConstraintViolationWithTemplate()

  private static String message = "message";

  @Test
  public void testIterableIndexed() {
    ConstraintValidatorContextImpl context = createEmptyConstraintValidatorContextImpl();
    context.buildConstraintViolationWithTemplate( message )
        .addPropertyNode( "foo" )
        .addPropertyNode( "bar" ).inIterable().atIndex( 3 )
        .addConstraintViolation();

    List<ConstraintViolationCreationContext> constraintViolationCreationContextList = context.getConstraintViolationCreationContexts();
View Full Code Here

Examples of org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorContextImpl.buildConstraintViolationWithTemplate()

  }

  @Test
  public void testIterableKeyed() {
    ConstraintValidatorContextImpl context = createEmptyConstraintValidatorContextImpl();
    context.buildConstraintViolationWithTemplate( message )
        .addPropertyNode( "foo" )
        .addPropertyNode( null ).inIterable().atKey( "test" )
        .addConstraintViolation();

    List<ConstraintViolationCreationContext> constraintViolationCreationContextList = context.getConstraintViolationCreationContexts();
View Full Code Here

Examples of org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorContextImpl.buildConstraintViolationWithTemplate()

  @Test
  public void testIterableWithKeyFollowedBySimpleNodes() {
    ConstraintValidatorContextImpl context = createEmptyConstraintValidatorContextImpl();

    context.buildConstraintViolationWithTemplate( message )
        .addPropertyNode( "foo" )
        .addPropertyNode( "bar" ).inIterable().atKey( "test" )
        .addPropertyNode( "fubar" )
        .addConstraintViolation();
View Full Code Here

Examples of org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorContextImpl.buildConstraintViolationWithTemplate()

  }

  @Test
  public void testIterableKeyedAndIndexed() {
    ConstraintValidatorContextImpl context = createEmptyConstraintValidatorContextImpl();
    context.buildConstraintViolationWithTemplate( message )
        .addPropertyNode( "foo" )
        .addPropertyNode( "bar" ).inIterable().atKey( "test" )
        .addPropertyNode( "fubar" ).inIterable().atIndex( 10 )
        .addConstraintViolation();
View Full Code Here

Examples of org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorContextImpl.buildConstraintViolationWithTemplate()

  }

  @Test
  public void testMultipleInIterable() {
    ConstraintValidatorContextImpl context = createEmptyConstraintValidatorContextImpl();
    context.buildConstraintViolationWithTemplate( message )
        .addPropertyNode( "foo" )
        .addPropertyNode( "bar" ).inIterable().atKey( "test" )
        .addPropertyNode( "fubar" ).inIterable()
        .addConstraintViolation();
View Full Code Here

Examples of org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorContextImpl.buildConstraintViolationWithTemplate()

  }

  @Test
  public void testMultipleSimpleNodes() {
    ConstraintValidatorContextImpl context = createEmptyConstraintValidatorContextImpl();
    context.buildConstraintViolationWithTemplate( message )
        .addPropertyNode( "foo" )
        .addPropertyNode( "bar" )
        .addPropertyNode( "test" )
        .addConstraintViolation();
View Full Code Here

Examples of org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorContextImpl.buildConstraintViolationWithTemplate()

  }

  @Test
  public void testLongPath() {
    ConstraintValidatorContextImpl context = createEmptyConstraintValidatorContextImpl();
    context.buildConstraintViolationWithTemplate( message )
        .addPropertyNode( "a" )
        .addPropertyNode( "b" ).inIterable().atKey( "key1" )
        .addPropertyNode( "c" ).inIterable()
        .addPropertyNode( "d" )
        .addPropertyNode( "e" )
View Full Code Here

Examples of org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorContextImpl.buildConstraintViolationWithTemplate()

  @Test
  public void testMultipleMessages() {
    String message1 = "message1";
    String message2 = "message2";
    ConstraintValidatorContextImpl context = createEmptyConstraintValidatorContextImpl();
    context.buildConstraintViolationWithTemplate( message1 )
        .addPropertyNode( "foo" )
        .addPropertyNode( "bar" ).inIterable().atKey( "key" )
        .addConstraintViolation();
    context.buildConstraintViolationWithTemplate( message2 )
        .addConstraintViolation();
View Full Code Here

Examples of org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorContextImpl.buildConstraintViolationWithTemplate()

    ConstraintValidatorContextImpl context = createEmptyConstraintValidatorContextImpl();
    context.buildConstraintViolationWithTemplate( message1 )
        .addPropertyNode( "foo" )
        .addPropertyNode( "bar" ).inIterable().atKey( "key" )
        .addConstraintViolation();
    context.buildConstraintViolationWithTemplate( message2 )
        .addConstraintViolation();

    List<ConstraintViolationCreationContext> constraintViolationCreationContextList = context.getConstraintViolationCreationContexts();
    assertTrue( constraintViolationCreationContextList.size() == 2 );
    assertMessageAndPath( constraintViolationCreationContextList.get( 0 ), message1, "foo[key].bar" );
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.