From 1db14f96af7227edb7839892fa85ff8c8608d644 Mon Sep 17 00:00:00 2001 From: Christoph Seibert Date: Wed, 4 Apr 2018 08:32:54 +0200 Subject: [PATCH] Reset HystrixPlugins before and after test to avoid test failure when running after other tests --- .../hystrix/UnsubscribedTasksRequestCacheTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hystrix-core/src/test/java/com/netflix/hystrix/UnsubscribedTasksRequestCacheTest.java b/hystrix-core/src/test/java/com/netflix/hystrix/UnsubscribedTasksRequestCacheTest.java index 76b8382ae..23d332e6e 100644 --- a/hystrix-core/src/test/java/com/netflix/hystrix/UnsubscribedTasksRequestCacheTest.java +++ b/hystrix-core/src/test/java/com/netflix/hystrix/UnsubscribedTasksRequestCacheTest.java @@ -20,6 +20,8 @@ import com.netflix.hystrix.strategy.HystrixPlugins; import com.netflix.hystrix.strategy.concurrency.HystrixRequestContext; import com.netflix.hystrix.strategy.executionhook.HystrixCommandExecutionHook; +import org.junit.After; +import org.junit.Before; import org.junit.Test; import java.util.concurrent.ExecutionException; @@ -74,6 +76,16 @@ protected String getCacheKey() { } } + @Before + public void init() { + HystrixPlugins.reset(); + } + + @After + public void reset() { + HystrixPlugins.reset(); + } + @Test public void testOneCommandIsUnsubscribed() throws ExecutionException, InterruptedException {