@Test
    public void testNiwsConfigViaProperties() throws Exception {
    	DefaultClientConfigImpl clientConfig = new DefaultClientConfigImpl();
    	DefaultClientConfigImpl override = new DefaultClientConfigImpl();
    	clientConfig.loadDefaultValues();
        Properties props = new Properties();
        
        final String restClientName = "testRestClient";
        
        props.setProperty("netflix.appinfo.stack","xbox");
        props.setProperty("netflix.environment","test");
        props.setProperty("appname", "movieservice");
        props.setProperty(restClientName + ".ribbon." + CommonClientConfigKey.AppName.key(), "movieservice");
        props.setProperty(restClientName + ".ribbon." + CommonClientConfigKey.DeploymentContextBasedVipAddresses.key(), "${appname}-${netflix.appinfo.stack}-${netflix.environment},movieservice--${netflix.environment}");
        props.setProperty(restClientName + ".ribbon." + CommonClientConfigKey.EnableZoneAffinity.key(), "false");

        ConfigurationManager.loadProperties(props);
        ConfigurationManager.getConfigInstance().setProperty("testRestClient.ribbon.customProperty", "abc");
        
        clientConfig.loadProperties(restClientName);
        clientConfig.set(CommonClientConfigKey.ConnectTimeout, 1000);
        override.set(CommonClientConfigKey.Port, 8000);
        override.set(CommonClientConfigKey.ConnectTimeout, 5000);
        clientConfig.applyOverride(override);
        
        Assert.assertEquals("movieservice", clientConfig.get(CommonClientConfigKey.AppName));
        Assert.assertEquals(false, clientConfig.get(CommonClientConfigKey.EnableZoneAffinity));
        Assert.assertEquals("movieservice-xbox-test,movieservice--test", clientConfig.resolveDeploymentContextbasedVipAddresses());
        Assert.assertEquals(5000, clientConfig.get(CommonClientConfigKey.ConnectTimeout).longValue());

        Assert.assertEquals(8000, clientConfig.get(CommonClientConfigKey.Port).longValue());
        System.out.println("AutoVipAddress:" + clientConfig.resolveDeploymentContextbasedVipAddresses());
        
        ConfigurationManager.getConfigInstance().setProperty("testRestClient.ribbon.EnableZoneAffinity", "true");
        assertEquals(true, clientConfig.get(CommonClientConfigKey.EnableZoneAffinity));
    }
Test cases to verify the correctness of the Client Configuration settings

@author stonse
ribbon-core/src/test/java/com/netflix/client/config/ClientConfigTest.java