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

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

There is a newer version: 5.0.2
Show newest version
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