Package org.hibernate.validator.testutil

Examples of org.hibernate.validator.testutil.MessageLoggedAssertionLogger


  }

  @Test
  public void unsupported_use_of_type_constraints_logs_warning() {
    Logger log4jRootLogger = Logger.getRootLogger();
    MessageLoggedAssertionLogger assertingLogger = new MessageLoggedAssertionLogger( "HV000188" );
    log4jRootLogger.addAppender( assertingLogger );

    // No unwrapper exception shouldn't be thrown, type use constraints are ignored
    FooHolder fooHolder = new FooHolder();
    fooHolder.foo = null;
    validator.validate( fooHolder );

    assertingLogger.assertMessageLogged();
    log4jRootLogger.removeAppender( assertingLogger );
  }
View Full Code Here


  }

  @Test
  public void testParameterMessageInterpolatorIgnoresELExpressions() {
    Logger log4jRootLogger = Logger.getRootLogger();
    MessageLoggedAssertionLogger assertingLogger = new MessageLoggedAssertionLogger( "HV000185" );
    log4jRootLogger.addAppender( assertingLogger );

    Foo foo = new Foo();
    Set<ConstraintViolation<Foo>> constraintViolations = validator.validateProperty( foo, "bar" );
    assertNumberOfViolations( constraintViolations, 1 );
    assertCorrectConstraintViolationMessages( constraintViolations, "${validatedValue}" );

    assertingLogger.assertMessageLogged();
    log4jRootLogger.removeAppender( assertingLogger );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.validator.testutil.MessageLoggedAssertionLogger

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.