Class MessageValidation.PredicateExpectation<Value>

    • Constructor Summary

      Constructors 
      Constructor Description
      PredicateExpectation​(java.util.function.Predicate<Value> predicate, java.lang.String failureMessage)
      Create a predicate based expectation.
    • Constructor Detail

      • PredicateExpectation

        public PredicateExpectation​(java.util.function.Predicate<Value> predicate,
                                    java.lang.String failureMessage)
        Create a predicate based expectation. The expectation is met if the predicate evaluates to 'true'. And will throw IllegalStateException if not.
        Parameters:
        predicate - The value predicate.
        failureMessage - The message of the thrown exception.
    • Method Detail

      • test

        public void test​(Value value)
        Test the value.
        Specified by:
        test in interface MessageValidation.SimpleExpectation<Value>
        Parameters:
        value - The value to test.
        Throws:
        java.lang.IllegalStateException - if the value does not meet the predicate expectation.