CAMEL-11279: Fixed test
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/94ff981f Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/94ff981f Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/94ff981f Branch: refs/heads/camel-2.18.x Commit: 94ff981fd2cad6a68e00c2754ac7c210d0842b16 Parents: 18abb33 Author: Claus Ibsen <davscl...@apache.org> Authored: Tue May 16 12:45:42 2017 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Tue May 16 12:47:11 2017 +0200 ---------------------------------------------------------------------- .../hystrix/processor/HystrixCircuitOpenTest.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/94ff981f/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixCircuitOpenTest.java ---------------------------------------------------------------------- diff --git a/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixCircuitOpenTest.java b/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixCircuitOpenTest.java index 801ed8d..981c633 100644 --- a/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixCircuitOpenTest.java +++ b/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixCircuitOpenTest.java @@ -51,6 +51,11 @@ public class HystrixCircuitOpenTest extends CamelTestSupport { } Thread.sleep(1500); + resetMocks(); + + // notice this can be flaky due timing when using thread sleeps in unit tests + getMockEndpoint("mock:result").expectedPropertyReceived(HYSTRIX_RESPONSE_SHORT_CIRCUITED, true); + route.throwException = false; try { template.requestBody("direct:start", "Request Body"); @@ -59,10 +64,7 @@ public class HystrixCircuitOpenTest extends CamelTestSupport { LOG.info("Circuit open expected ", e); } - // notice this can be flaky due timing when using thread sleeps in unit tests - // getMockEndpoint("mock:result").expectedPropertyReceived(HYSTRIX_RESPONSE_SHORT_CIRCUITED, true); - - // assertMockEndpointsSatisfied(); + assertMockEndpointsSatisfied(); // wait for the circuit to try an other request Thread.sleep(500);