001/* 002 * Copyright 2002-2018 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.test.context; 018 019import java.lang.annotation.Documented; 020import java.lang.annotation.ElementType; 021import java.lang.annotation.Inherited; 022import java.lang.annotation.Retention; 023import java.lang.annotation.RetentionPolicy; 024import java.lang.annotation.Target; 025 026/** 027 * {@code @BootstrapWith} defines class-level metadata that is used to determine 028 * how to bootstrap the <em>Spring TestContext Framework</em>. 029 * 030 * <p>This annotation may also be used as a <em>meta-annotation</em> to create 031 * custom <em>composed annotations</em>. As of Spring Framework 5.1, a locally 032 * declared {@code @BootstrapWith} annotation (i.e., one that is <em>directly 033 * present</em> on the current test class) will override any meta-present 034 * declarations of {@code @BootstrapWith}. 035 * 036 * @author Sam Brannen 037 * @since 4.1 038 * @see BootstrapContext 039 * @see TestContextBootstrapper 040 */ 041@Target(ElementType.TYPE) 042@Retention(RetentionPolicy.RUNTIME) 043@Documented 044@Inherited 045public @interface BootstrapWith { 046 047 /** 048 * The {@link TestContextBootstrapper} to use to bootstrap the <em>Spring 049 * TestContext Framework</em>. 050 */ 051 Class<? extends TestContextBootstrapper> value() default TestContextBootstrapper.class; 052 053}