Search in sources :

Example 1 with GenericXdsConfig

use of io.envoyproxy.envoy.service.status.v3.ClientConfig.GenericXdsConfig in project grpc-java by grpc.

the class CsdsServiceTest method mapConfigDumps.

private static EnumMap<ResourceType, GenericXdsConfig> mapConfigDumps(ClientConfig config) {
    EnumMap<ResourceType, GenericXdsConfig> xdsConfigMap = new EnumMap<>(ResourceType.class);
    List<GenericXdsConfig> xdsConfigList = config.getGenericXdsConfigsList();
    for (GenericXdsConfig genericXdsConfig : xdsConfigList) {
        ResourceType type = ResourceType.fromTypeUrl(genericXdsConfig.getTypeUrl());
        assertThat(type).isNotEqualTo(ResourceType.UNKNOWN);
        assertThat(xdsConfigMap).doesNotContainKey(type);
        xdsConfigMap.put(type, genericXdsConfig);
    }
    return xdsConfigMap;
}
Also used : GenericXdsConfig(io.envoyproxy.envoy.service.status.v3.ClientConfig.GenericXdsConfig) ResourceType(io.grpc.xds.AbstractXdsClient.ResourceType) EnumMap(java.util.EnumMap)

Aggregations

GenericXdsConfig (io.envoyproxy.envoy.service.status.v3.ClientConfig.GenericXdsConfig)1 ResourceType (io.grpc.xds.AbstractXdsClient.ResourceType)1 EnumMap (java.util.EnumMap)1