@Test
    public void refer() throws Exception {

        ConsumerConfig<HelloService> consumerConfig0 = new ConsumerConfig<HelloService>()
            .setInterfaceId(HelloService.class.getName())
            .setDirectUrl("bolt://127.0.0.1:22221")
            .setTimeout(3000);
        consumerConfig0.refer();

        ConsumerConfig<HelloService> consumerConfig1 = new ConsumerConfig<HelloService>()
            .setInterfaceId(HelloService.class.getName())
            .setDirectUrl("bolt://127.0.0.1:22221")
            .setTimeout(3000);
        consumerConfig1.refer();

        ConsumerConfig<HelloService> consumerConfig2 = new ConsumerConfig<HelloService>()
            .setInterfaceId(HelloService.class.getName())
            .setDirectUrl("bolt://127.0.0.1:22221")
            .setTimeout(3000);
        consumerConfig2.refer();

        ConsumerConfig<HelloService> consumerConfig3 = new ConsumerConfig<HelloService>()
            .setInterfaceId(HelloService.class.getName())
            .setDirectUrl("bolt://127.0.0.1:22221")
            .setTimeout(3000);
        try {
            consumerConfig3.refer();
            Assert.fail();
        } catch (Exception e) {
            Assert.assertTrue(e instanceof SofaRpcRuntimeException);
        }

        ConsumerConfig<HelloService> consumerConfig4 = new ConsumerConfig<HelloService>()
            .setInterfaceId(HelloService.class.getName())
            .setDirectUrl("bolt://127.0.0.1:22221")
            .setRepeatedReferLimit(4)
            .setTimeout(3000);
        consumerConfig4.refer();

        ConsumerConfig<HelloService> consumerConfig5 = new ConsumerConfig<HelloService>()
            .setInterfaceId(HelloService.class.getName())
            .setDirectUrl("bolt://127.0.0.1:22221")
            .setRepeatedReferLimit(4)
            .setTimeout(3000);
        try {
            consumerConfig5.refer();
            Assert.fail();
        } catch (Exception e) {
            Assert.assertTrue(e instanceof SofaRpcRuntimeException);
        }
    }
@author <a href="mailto:zhanggeng.zg@antfin.com">GengZhang</a>
test/test-integration/src/test/java/com/alipay/sofa/rpc/test/bootstrap/bolt/BoltConsumerBootstrapTest.java