/** * Asserts that the predicate returns the expected value on the exchange */ public static void assertPredicateDoesNotMatch(Predicate predicate, Exchange exchange) { try { PredicateAssertHelper.assertMatches(predicate, "Predicate should match: ", exchange); } catch (AssertionError e) { LOG.debug("Caught expected assertion error: " + e); } assertPredicate(predicate, exchange, false); }
/** * Asserts that the predicate returns the expected value on the exchange */ public static void assertPredicateDoesNotMatch(Predicate predicate, Exchange exchange) { try { PredicateAssertHelper.assertMatches(predicate, "Predicate should match: ", exchange); } catch (AssertionError e) { LOG.debug("Caught expected assertion error: " + e); } assertPredicate(predicate, exchange, false); }
/** * Asserts that the predicate returns the expected value on the exchange */ public static boolean assertPredicate(final Predicate predicate, Exchange exchange, boolean expected) { if (expected) { PredicateAssertHelper.assertMatches(predicate, "Predicate failed: ", exchange); } boolean value = predicate.matches(exchange); LOG.debug("Evaluated predicate: " + predicate + " on exchange: " + exchange + " result: " + value); assertEquals("Predicate: " + predicate + " on Exchange: " + exchange, expected, value); return value; }
/** * Asserts that the predicate returns the expected value on the exchange */ public static boolean assertPredicate(final Predicate predicate, Exchange exchange, boolean expected) { if (expected) { PredicateAssertHelper.assertMatches(predicate, "Predicate failed: ", exchange); } boolean value = predicate.matches(exchange); LOG.debug("Evaluated predicate: " + predicate + " on exchange: " + exchange + " result: " + value); assertEquals("Predicate: " + predicate + " on Exchange: " + exchange, expected, value); return value; }