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

berlin.yuna.natsserver.embedded.annotation.EnableNatsServerContextCustomizerFactory Maven / Gradle / Ivy

There is a newer version: 2.10.25-rc.1
Show newest version
package berlin.yuna.natsserver.embedded.annotation;

import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.test.context.ContextConfigurationAttributes;
import org.springframework.test.context.ContextCustomizer;
import org.springframework.test.context.ContextCustomizerFactory;

import java.util.List;

class EnableNatsServerContextCustomizerFactory implements ContextCustomizerFactory {

    /**
     * @param testClass        current test class with {@link EnableNatsServer} annotation
     * @param configAttributes {@link ContextConfigurationAttributes} not in use
     * @return {@link EnableNatsServerContextCustomizer}
     */
    @Override
    public ContextCustomizer createContextCustomizer(final Class testClass, final List configAttributes) {
        final EnableNatsServer enableNatsServer = AnnotatedElementUtils.findMergedAnnotation(testClass, EnableNatsServer.class);
        return new EnableNatsServerContextCustomizer(enableNatsServer);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy