
berlin.yuna.natsserver.embedded.annotation.EnableNatsServerContextCustomizerFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nats-server-embedded Show documentation
Show all versions of nats-server-embedded Show documentation
Nats server embedded for testing which contains the original Nats server
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