@Test
    public void testHystrixFallbackFactory() throws InterruptedException {
        providerConfig = defaultServer(2000);
        providerConfig.export();
        consumerConfig = defaultClient()
            .setTimeout(10000);

        SofaHystrixConfig.registerFallbackFactory(consumerConfig, new HystrixServiceFallbackFactory());

        HystrixService HystrixService = consumerConfig.refer();
        //wait server ok
        Thread.sleep(2000);
        long start = System.currentTimeMillis();
        HystrixService.sayHello("abc", 24);
        Future future = SofaResponseFuture.getFuture();
        Assert.assertFalse(future.isDone());
        Assert.assertFalse(future.isCancelled());
        Assert.assertTrue((System.currentTimeMillis() - start) < HYSTRIX_DEFAULT_TIMEOUT);
        String result = (String) SofaResponseFuture.getResponse(10000, true);
        Assert.assertTrue((System.currentTimeMillis() - start) > HYSTRIX_DEFAULT_TIMEOUT);
        Assert.assertEquals(
            "fallback abc from server! age: 24, error: com.netflix.hystrix.exception.HystrixTimeoutException",
            result);
    }
@author <a href=mailto:scienjus@gmail.com>ScienJus</a>
test/test-integration/src/test/java/com/alipay/sofa/rpc/hystrix/HystrixFilterAsyncTest.java