StateConfig getStateConfig(Map<String, Object> topoConf) throws Exception {
        StateConfig stateConfig;
        String providerConfig;
        ObjectMapper mapper = new ObjectMapper();
        mapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
        if (topoConf.containsKey(Config.TOPOLOGY_STATE_PROVIDER_CONFIG)) {
            providerConfig = (String) topoConf.get(Config.TOPOLOGY_STATE_PROVIDER_CONFIG);
            stateConfig = mapper.readValue(providerConfig, StateConfig.class);
        } else {
            stateConfig = new StateConfig();
        }
        return stateConfig;
    }
@Test
    public void testgetConfigWithProviderConfig() throws Exception {
        RedisKeyValueStateProvider provider = new RedisKeyValueStateProvider();
        Map<String, Object> topoConf = new HashMap<>();
        topoConf.put(Config.TOPOLOGY_STATE_PROVIDER_CONFIG, "{\"keyClass\":\"String\", \"valueClass\":\"String\"," +
                                                            " \"jedisPoolConfig\":" +
                                                            "{\"host\":\"localhost\", \"port\":1000}}");

        RedisKeyValueStateProvider.StateConfig config = provider.getStateConfig(topoConf);
        //System.out.println(config);
        assertEquals("String", config.keyClass);
        assertEquals("String", config.valueClass);
        assertEquals("localhost", config.jedisPoolConfig.getHost());
        assertEquals(1000, config.jedisPoolConfig.getPort());
    }