package com.yammer.tenacity.testing;

import com.netflix.config.ConfigurationManager;
import com.netflix.hystrix.Hystrix;
import com.netflix.hystrix.contrib.yammermetricspublisher.HystrixYammerMetricsPublisher;
import com.netflix.hystrix.strategy.HystrixPlugins;
import org.junit.After;

import java.util.concurrent.TimeUnit;

public abstract class TenacityTest {
    static {
        initialization();
    }

    private static void initialization() {
        HystrixPlugins.getInstance().registerMetricsPublisher(new HystrixYammerMetricsPublisher());
        ConfigurationManager
                .getConfigInstance()
                .setProperty("hystrix.command.default.metrics.healthSnapshot.intervalInMilliseconds", "1");
    }

    @After
    public void testTeardown() {
        Hystrix.reset(1, TimeUnit.SECONDS);
    }
}
@@ -279,16 +279,41 @@
 t.After;
+%0Aimport org.junit.Before;
 %0A%0Aimport
@@ -399,84 +399,8 @@
 c %7B%0A
-        initialization();%0A    %7D%0A%0A    private static void initialization() %7B%0A
     
@@ -495,16 +495,74 @@
 her());%0A
+    %7D%0A%0A    @Before%0A    public void testInitialization() %7B%0A
         
@@ -822,15 +822,73 @@
 CONDS);%0A
+        ConfigurationManager.getConfigInstance().clear();%0A
     %7D%0A%7D

Reset the ConfigurationManager when testing Tenacity