Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add missing reset for CommandExecutionHook in HystrixPlugins.UnitTest#re... #240

Merged
merged 1 commit into from

4 participants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
19 hystrix-core/src/test/java/com/netflix/hystrix/strategy/HystrixPluginsTest.java
@@ -5,6 +5,8 @@
import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicReference;
+import com.netflix.hystrix.strategy.executionhook.HystrixCommandExecutionHook;
+import com.netflix.hystrix.strategy.executionhook.HystrixCommandExecutionHookDefault;
import org.junit.After;
import org.junit.Test;
@@ -31,6 +33,23 @@ public void reset() {
HystrixPlugins.getInstance().metricsPublisher.set(null);
HystrixPlugins.getInstance().notifier.set(null);
HystrixPlugins.getInstance().propertiesFactory.set(null);
+ HystrixPlugins.getInstance().commandExecutionHook.set(null);
+ }
+
+ @Test
+ public void testCommandExecutionHookDefaultImpl() {
+ HystrixCommandExecutionHook impl = HystrixPlugins.getInstance().getCommandExecutionHook();
+ assertTrue(impl instanceof HystrixCommandExecutionHookDefault);
+ }
+
+ @Test
+ public void testCommandExecutionHookViaRegisterMethod() {
+ HystrixPlugins.getInstance().registerCommandExecutionHook(new HystrixCommandExecutionHookTestImpl());
+ HystrixCommandExecutionHook impl = HystrixPlugins.getInstance().getCommandExecutionHook();
+ assertTrue(impl instanceof HystrixCommandExecutionHookTestImpl);
+ }
+
+ public static class HystrixCommandExecutionHookTestImpl extends HystrixCommandExecutionHook {
}
@Test
Something went wrong with that request. Please try again.