Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.yammer.tenacity.testing;
 
 
public class TenacityTestRule implements TestRule {
    private void setup() {
        Hystrix.reset();
        ConfigurationManager
                .getConfigInstance()
                .setProperty("hystrix.command.default.metrics.healthSnapshot.intervalInMilliseconds""1");
    }
    public void teardown() {
        Hystrix.reset(1, .);
        ConfigurationManager.getConfigInstance().clear();
    }
    @Override
    public Statement apply(final Statement baseDescription description) {
        return new Statement() {
            @Override
            public void evaluate() throws Throwable {
                try {
                    setup();
                    base.evaluate();
                } finally {
                    teardown();
                }
            }
        };
    }
New to GrepCode? Check out our FAQ X