[ 
https://issues.apache.org/jira/browse/CAMEL-2630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12985301#action_12985301
 ] 

Claus Ibsen commented on CAMEL-2630:
------------------------------------

I got something like this currently
{code}
mock.message(1).isReceived().noLaterThan(2).seconds().afterPrevious();
{code}

Which mean the message with index 1 (index is 0 based) arrives no later than 2 
seconds after the previous (which means message with index 0)


And you can use between
{code}
mock.message(0).isReceived().between(1, 4).seconds().beforeNext();
{code}

Which mean the message with index 0 (index is 0 based) should arrive between 1 
to 4 seconds before the next (which means message with index 1)

I wonder if we should use {{isReceived}} or {{arrives}} in the DSL?


You can also do this on all the messages
{code}
        mock.allMessages().isReceived().noLaterThan(1).seconds().beforeNext();
{code}

Which translates to that all messages received should at most be 1 second apart.


> Mock endpoint - Add header which records the time the Exchange arrived to the 
> mock
> ----------------------------------------------------------------------------------
>
>                 Key: CAMEL-2630
>                 URL: https://issues.apache.org/jira/browse/CAMEL-2630
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: Future
>
>
> Then you can use that time information in testing.
> Maybe add some builder methods to mock so you can set expectations to have 
> arrival time
> - before X
> - after X
> - X after previous
> - X before next
> - etc.
> Maybe something along the lines of:
> {code}
> mock.message(1).arrives(2, seconds).afterPrevious();
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to