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

de.hilling.junit.cdi.microprofile.DummyConfigSource Maven / Gradle / Ivy

There is a newer version: 5.0.2
Show newest version
package de.hilling.junit.cdi.microprofile;

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

import org.eclipse.microprofile.config.spi.ConfigSource;

import de.hilling.junit.cdi.scope.TestSuiteScoped;

/**
 * Prevent any problems with non-resolved global properties.
 */
@TestSuiteScoped
public class DummyConfigSource implements ConfigSource {

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

    public DummyConfigSource() {
        properties.put("dummy", "1");
    }

    @Override
    public Map getProperties() {
        return properties;
    }

    @Override
    public Set getPropertyNames() {
        return properties.keySet();
    }

    @Override
    public String getValue(String propertyName) {
        return properties.get(propertyName);
    }

    @Override
    public String getName() {
        return "test-config";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy