de.hilling.junit.cdi.microprofile.TestPropertiesHolder 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 de.hilling.junit.cdi.lifecycle.TestEvent;
import de.hilling.junit.cdi.scope.TestState;
import de.hilling.junit.cdi.scope.TestSuiteScoped;
import org.junit.jupiter.api.extension.ExtensionContext;
import jakarta.enterprise.event.Observes;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@TestSuiteScoped
public class TestPropertiesHolder {
private final HashMap properties = new HashMap<>();
Map getProperties() {
return Collections.unmodifiableMap(properties);
}
void clear(@Observes @TestEvent(TestState.FINISHING) ExtensionContext testEvent) {
properties.clear();
}
void put(String name, String value) {
properties.put(name, value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy