@Test
    public void from1() throws Exception {
        ConsumerConfig consumerConfig = new ConsumerConfig().setProtocol("test")
            .setBootstrap("test");
        ConsumerBootstrap bootstrap = Bootstraps.from(consumerConfig);
        Assert.assertEquals(TestConsumerBootstrap.class, bootstrap.getClass());
        Assert.assertEquals(consumerConfig, bootstrap.getConsumerConfig());
        // if not set bootstrap
        consumerConfig = new ConsumerConfig().setProtocol("test");
        bootstrap = Bootstraps.from(consumerConfig);
        Assert.assertEquals(TestConsumerBootstrap.class, bootstrap.getClass());
        Assert.assertEquals(consumerConfig, bootstrap.getConsumerConfig());
        // if not set bootstrap and not exist 
        consumerConfig = new ConsumerConfig().setProtocol("xx");
        bootstrap = Bootstraps.from(consumerConfig);
        Assert.assertEquals(TestConsumerBootstrap.class, bootstrap.getClass());
        Assert.assertEquals(consumerConfig, bootstrap.getConsumerConfig());
    }
@author <a href="mailto:zhanggeng.zg@antfin.com">GengZhang</a>
core/api/src/test/java/com/alipay/sofa/rpc/bootstrap/BootstrapsTest.java