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/d4d2a75a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d4d2a75a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d4d2a75a

Branch: refs/heads/master
Commit: d4d2a75abfad5114f6f97500245403ecbc6b41ee
Parents: d72352b
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:49:03 2017 +0200

----------------------------------------------------------------------
 .../component/hystrix/processor/HystrixCircuitOpenTest.java  | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/d4d2a75a/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 6312056..616f828 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
@@ -52,6 +52,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");
@@ -60,9 +65,6 @@ 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();
 
         // wait for the circuit to try an other request

Reply via email to