public ConfigData<?> fetchConfig(final ConfigGroupEnum groupKey) {
        ConfigDataCache config = CACHE.get(groupKey.name());
        switch (groupKey) {
            case APP_AUTH:
                return buildConfigData(config, AppAuthData.class);
            case PLUGIN:
                return buildConfigData(config, PluginData.class);
            case RULE:
                return buildConfigData(config, RuleData.class);
            case SELECTOR:
                return buildConfigData(config, SelectorData.class);
            case META_DATA:
                return buildConfigData(config, MetaData.class);
            case PROXY_SELECTOR:
                return buildConfigData(config, ProxySelectorData.class);
            case DISCOVER_UPSTREAM:
                return buildConfigData(config, DiscoverySyncData.class);
            default:
                throw new IllegalStateException("Unexpected groupKey: " + groupKey);
        }
    }
@Test
    public void testFetchConfig() {
        List<AppAuthData> appAuthDatas = Lists.newArrayList(mock(AppAuthData.class));
        listener.updateCache(ConfigGroupEnum.APP_AUTH, appAuthDatas);
        ConfigData<?> result1 = listener.fetchConfig(ConfigGroupEnum.APP_AUTH);
        assertNotNull(result1);

        List<PluginData> pluginDatas = Lists.newArrayList(mock(PluginData.class));
        listener.updateCache(ConfigGroupEnum.PLUGIN, pluginDatas);
        ConfigData<?> result2 = listener.fetchConfig(ConfigGroupEnum.PLUGIN);
        assertNotNull(result2);

        List<RuleData> ruleDatas = Lists.newArrayList(mock(RuleData.class));
        listener.updateCache(ConfigGroupEnum.RULE, ruleDatas);
        ConfigData<?> result3 = listener.fetchConfig(ConfigGroupEnum.RULE);
        assertNotNull(result3);

        List<SelectorData> selectorDatas = Lists.newArrayList(mock(SelectorData.class));
        listener.updateCache(ConfigGroupEnum.SELECTOR, selectorDatas);
        ConfigData<?> result4 = listener.fetchConfig(ConfigGroupEnum.SELECTOR);
        assertNotNull(result4);

        List<MetaData> metaDatas = Lists.newArrayList(mock(MetaData.class));
        listener.updateCache(ConfigGroupEnum.META_DATA, metaDatas);
        ConfigData<?> result5 = listener.fetchConfig(ConfigGroupEnum.META_DATA);
        assertNotNull(result5);
    }