aboutsummaryrefslogtreecommitdiffstats
path: root/configserver/src/test/java/com/yahoo/vespa/config/server/TestConfigDefinitionRepo.java
blob: b30ec8f8f30b2c21926a79ed81bc93c98cb2003b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.server;

import com.yahoo.cloud.config.LbServicesConfig;
import com.yahoo.cloud.config.SentinelConfig;
import com.yahoo.config.SimpletypesConfig;
import com.yahoo.config.model.api.ConfigDefinitionRepo;
import com.yahoo.vespa.config.ConfigDefinitionKey;
import com.yahoo.vespa.config.buildergen.ConfigDefinition;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @author Ulf Lilleengen
 */
public class TestConfigDefinitionRepo implements ConfigDefinitionRepo {

    private final Map<ConfigDefinitionKey, ConfigDefinition> repo = new LinkedHashMap<>();

    public TestConfigDefinitionRepo() {
        repo.put(new ConfigDefinitionKey(SimpletypesConfig.CONFIG_DEF_NAME, SimpletypesConfig.CONFIG_DEF_NAMESPACE),
                 new ConfigDefinition(SimpletypesConfig.CONFIG_DEF_NAME, SimpletypesConfig.CONFIG_DEF_SCHEMA));
        repo.put(new ConfigDefinitionKey(LbServicesConfig.CONFIG_DEF_NAME, LbServicesConfig.CONFIG_DEF_NAMESPACE),
                 new ConfigDefinition(LbServicesConfig.CONFIG_DEF_NAME, LbServicesConfig.CONFIG_DEF_SCHEMA));
        repo.put(new ConfigDefinitionKey(SentinelConfig.CONFIG_DEF_NAME, SentinelConfig.CONFIG_DEF_NAMESPACE),
                 new ConfigDefinition(SentinelConfig.CONFIG_DEF_NAME, SentinelConfig.CONFIG_DEF_SCHEMA));
    }

    @Override
    public Map<ConfigDefinitionKey, ConfigDefinition> getConfigDefinitions() {
        return repo;
    }

    @Override
    public ConfigDefinition get(ConfigDefinitionKey key) { return null; }

}