de.hilling.junit.cdi.microprofile.DummyConfigSource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cdi-test-microprofile Show documentation
Show all versions of cdi-test-microprofile Show documentation
Support Microprofile Config in cdi-test
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