Skip to content

Commit

Permalink
Reset HystrixPlugins before and after test to avoid test failure when…
Browse files Browse the repository at this point in the history
… running after other tests
  • Loading branch information
Christoph Seibert committed Apr 4, 2018
1 parent 6825138 commit 1db14f9
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {

Expand Down

0 comments on commit 1db14f9

Please sign in to comment.