All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netflix.archaius.test.ConfigInterfaceTest Maven / Gradle / Ivy

There is a newer version: 2.8.0
Show newest version
package com.netflix.archaius.test;

import com.netflix.archaius.api.Config;
import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

import static org.junit.Assert.assertEquals;

public abstract class ConfigInterfaceTest {

    protected abstract Config getInstance(Map properties);

    private final Map props = new HashMap<>();

    public ConfigInterfaceTest() {
        props.put("goo", "baz");
    }

    @Test
    public final void getValue() throws Exception {
        Config instance = getInstance(props);
        String result = instance.getString("goo");
        assertEquals("baz", result);
    }

    @Test
    public final void getValueWithDefault() throws Exception {
        Config instance = getInstance(props);
        String result = instance.getString("foo", "bar");
        assertEquals("bar", result);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy