summaryrefslogtreecommitdiffstats
path: root/config-proxy/src/test/java/com/yahoo/vespa/config/proxy/MemoryCacheConfigClientTest.java
blob: d243d9c6dff135083a795be8964f5bc4541aa211 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.proxy;

import org.junit.Test;

import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

/**
 * @author hmusum
 */
public class MemoryCacheConfigClientTest {

    @Test
    public void basic() {
        MemoryCacheConfigClient client = new MemoryCacheConfigClient(new MemoryCache());
        client.memoryCache().update(ConfigTester.fooConfig);
        assertEquals(ConfigTester.fooConfig, client.getConfig(ConfigTester.fooConfig, null).orElseThrow());
        assertTrue(client.getConfig(ConfigTester.barConfig, null).isEmpty());

        assertEquals("N/A", client.getActiveSourceConnection());
        assertEquals(List.of("N/A"), client.getSourceConnections());
    }

}