aboutsummaryrefslogtreecommitdiffstats
path: root/config-proxy/src/test/java/com/yahoo/vespa/config/proxy/MemoryCacheConfigClientTest.java
blob: ff30a5b2381d2a01383967bafaa193f505839ae6 (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.jupiter.api.Test;

import java.util.List;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

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

    @Test
    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());
    }

}