@Nullable private static Class<?> resolveExplicitTestContextBootstrapper(Class<?> testClass) { Set<BootstrapWith> annotations = AnnotatedElementUtils.findAllMergedAnnotations(testClass, BootstrapWith.class); if (annotations.isEmpty()) { return null; } if (annotations.size() == 1) { return annotations.iterator().next().value(); } // Allow directly-present annotation to override annotations that are meta-present. BootstrapWith bootstrapWith = testClass.getDeclaredAnnotation(BootstrapWith.class); if (bootstrapWith != null) { return bootstrapWith.value(); } throw new IllegalStateException(String.format( "Configuration error: found multiple declarations of @BootstrapWith for test class [%s]: %s", testClass.getName(), annotations)); }
private static Class<?> resolveExplicitTestContextBootstrapper(Class<?> testClass) { Set<BootstrapWith> annotations = AnnotatedElementUtils.findAllMergedAnnotations(testClass, BootstrapWith.class); if (annotations.size() < 1) { return null; } if (annotations.size() > 1) { throw new IllegalStateException(String.format( "Configuration error: found multiple declarations of @BootstrapWith for test class [%s]: %s", testClass.getName(), annotations)); } return annotations.iterator().next().value(); }
private static Class<?> resolveExplicitTestContextBootstrapper(Class<?> testClass) { Set<BootstrapWith> annotations = AnnotatedElementUtils.findAllMergedAnnotations(testClass, BootstrapWith.class); if (annotations.size() < 1) { return null; } if (annotations.size() > 1) { throw new IllegalStateException(String.format( "Configuration error: found multiple declarations of @BootstrapWith for test class [%s]: %s", testClass.getName(), annotations)); } return annotations.iterator().next().value(); }
@Nullable private static Class<?> resolveExplicitTestContextBootstrapper(Class<?> testClass) { Set<BootstrapWith> annotations = AnnotatedElementUtils.findAllMergedAnnotations(testClass, BootstrapWith.class); if (annotations.isEmpty()) { return null; } if (annotations.size() == 1) { return annotations.iterator().next().value(); } // Allow directly-present annotation to override annotations that are meta-present. BootstrapWith bootstrapWith = testClass.getDeclaredAnnotation(BootstrapWith.class); if (bootstrapWith != null) { return bootstrapWith.value(); } throw new IllegalStateException(String.format( "Configuration error: found multiple declarations of @BootstrapWith for test class [%s]: %s", testClass.getName(), annotations)); }