You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2010/04/16 14:48:26 UTC
[jira] Commented: (CAMEL-2651) Mock endpoint - Should throw more
detailed assertion errors when using predicates
[ https://issues.apache.org/activemq/browse/CAMEL-2651?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58903#action_58903 ]
Claus Ibsen commented on CAMEL-2651:
------------------------------------
Mind that this fix only works for binary kind of predicate types. It was the most convenient place to implement a fix.
> Mock endpoint - Should throw more detailed assertion errors when using predicates
> ---------------------------------------------------------------------------------
>
> Key: CAMEL-2651
> URL: https://issues.apache.org/activemq/browse/CAMEL-2651
> Project: Apache Camel
> Issue Type: Improvement
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 2.3.0
>
>
> For example if you set a mock predicate such as
> {code}
> mock.message(1).header("bar").isEqualTo(444);
> {code}
> And if the evaluation fails then Camel throws an exception, that the predicate failed. You then only know that the bar header is *not* 444. But you do not know what value it actually was.
> With this fix you can now see the evaluated result in the exception message. For example if the bar value was 234.
> {code}
> assertEquals("Assertion error at index 1 on mock mock://result with predicate: header(bar) == 444"
> + " evaluated as: 234 == 444 on Exchange[Message: Hello World]", e.getMessage());
> {code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira