List of usage examples for org.springframework.core.annotation AnnotatedElementUtils findAllMergedAnnotations
public static Set<Annotation> findAllMergedAnnotations(AnnotatedElement element, Set<Class<? extends Annotation>> annotationTypes)
From source file:org.springframework.test.context.BootstrapUtils.java
@Nullable private static Class<?> resolveExplicitTestContextBootstrapper(Class<?> testClass) { Set<BootstrapWith> annotations = AnnotatedElementUtils.findAllMergedAnnotations(testClass, BootstrapWith.class); if (annotations.isEmpty()) { return null; }/* w w w .j a va2s . c om*/ Assert.state(annotations.size() <= 1, () -> String.format( "Configuration error: found multiple declarations of @BootstrapWith for test class [%s]: %s", testClass.getName(), annotations)); return annotations.iterator().next().value(); }