[ 
https://issues.apache.org/jira/browse/CAMEL-12947?focusedWorklogId=260255&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-260255
 ]

ASF GitHub Bot logged work on CAMEL-12947:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/Jun/19 09:27
            Start Date: 14/Jun/19 09:27
    Worklog Time Spent: 10m 
      Work Description: jonathanvila commented on pull request #2977: 
CAMEL-12947:MockEndpoint.expectedHeaderReceived should fail when no e…
URL: https://github.com/apache/camel/pull/2977
 
 
   …xchange received (#2669)
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 260255)
    Time Spent: 50m  (was: 40m)

> MockEndpoint.expectedHeaderReceived should fail when no exchange received
> -------------------------------------------------------------------------
>
>                 Key: CAMEL-12947
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12947
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-test
>    Affects Versions: 2.22.1
>            Reporter: Antoine Wils
>            Assignee: Ramu
>            Priority: Minor
>             Fix For: 3.0.0, 2.24.0
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> When expecting headers to be passed to a MockEndpoint that is never called 
> the test should fail if the MockEndpoint was never called.
> However it is succeeding.
> Here an example of Junit 4 test succeeding when it should fail
> {code:java}
> import org.apache.camel.EndpointInject;
> import org.apache.camel.builder.RouteBuilder;
> import org.apache.camel.component.mock.MockEndpoint;
> import org.apache.camel.test.junit4.CamelTestSupport;
> import org.junit.Test;
> public class Test extends CamelTestSupport {
>   @EndpointInject(uri = "mock:direct:foo")
>   private MockEndpoint fooProducerMock;
>   @Override
>   public RouteBuilder createRouteBuilder() throws Exception {
>     return new RouteBuilder() {
>       @Override
>       public void configure() throws Exception {}
>     };
>   }
>   @Test
>   public void failWhenHeaderAbsent() throws InterruptedException {
>     fooProducerMock.expectedHeaderReceived("ghost", "you should be visible");
>     MockEndpoint.assertIsSatisfied(context);
>   }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to