Rename Import*AutoConfiguration classes

Rename Import*AutoConfiguration classes to AutoConfigure*.

Fixes gh-5692
pull/5645/merge
Phillip Webb 9 years ago
parent a65bed47fc
commit 21bc166c95

@ -39,6 +39,6 @@ import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Documented @Documented
@ImportAutoConfiguration({ GsonAutoConfiguration.class, JacksonAutoConfiguration.class }) @ImportAutoConfiguration({ GsonAutoConfiguration.class, JacksonAutoConfiguration.class })
public @interface ImportJsonAutoConfiguration { public @interface AutoConfigurationJson {
} }

@ -27,9 +27,29 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration; import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration;
import org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters; import org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters;
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper; import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
import org.springframework.boot.test.json.GsonTester;
import org.springframework.boot.test.json.JacksonTester;
import org.springframework.context.annotation.ComponentScan.Filter; import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.test.context.BootstrapWith; import org.springframework.test.context.BootstrapWith;
/**
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)}
* for a typical JSON test. Can be used when a test focuses <strong>only</strong> on JSON
* serialization.
* <p>
* Using this annotation will disable full auto-configuration and instead apply only
* configuration relevant to Json tests (i.e. {@code @JsonComponent}, Jackson
* {@code Module})
* <p>
* By default, tests annotated with {@code JsonTest} will also initialize
* {@link JacksonTester} and {@link GsonTester} fields. More fine-grained control can be
* provided via the {@link AutoConfigureJsonTesters @AutoConfigureJsonTesters} annotation.
*
* @author Phillip Webb
* @see AutoConfigurationJson
* @see AutoConfigureJsonTesters
* @since 1.4.0
*/
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Documented @Documented
@ -37,7 +57,7 @@ import org.springframework.test.context.BootstrapWith;
@BootstrapWith(SpringBootTestContextBootstrapper.class) @BootstrapWith(SpringBootTestContextBootstrapper.class)
@OverrideAutoConfiguration(enabled = false) @OverrideAutoConfiguration(enabled = false)
@TypeExcludeFilters(JsonExcludeFilter.class) @TypeExcludeFilters(JsonExcludeFilter.class)
@ImportJsonAutoConfiguration @AutoConfigurationJson
@AutoConfigureJsonTesters @AutoConfigureJsonTesters
public @interface JsonTest { public @interface JsonTest {

@ -45,6 +45,6 @@ import org.springframework.boot.autoconfigure.transaction.TransactionAutoConfigu
JpaRepositoriesAutoConfiguration.class, TransactionAutoConfiguration.class, JpaRepositoriesAutoConfiguration.class, TransactionAutoConfiguration.class,
DataSourceTransactionManagerAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class,
DataSourceAutoConfiguration.class }) DataSourceAutoConfiguration.class })
public @interface ImportDataJpaAutoConfiguration { public @interface AutoConfigureDataJpa {
} }

@ -62,7 +62,7 @@ import org.springframework.transaction.annotation.Transactional;
@OverrideAutoConfiguration(enabled = false) @OverrideAutoConfiguration(enabled = false)
@TypeExcludeFilters(DataJpaTypeExcludeFilter.class) @TypeExcludeFilters(DataJpaTypeExcludeFilter.class)
@Transactional @Transactional
@ImportDataJpaAutoConfiguration @AutoConfigureDataJpa
@AutoConfigureTestDatabase @AutoConfigureTestDatabase
@AutoConfigureTestEntityManager @AutoConfigureTestEntityManager
public @interface DataJpaTest { public @interface DataJpaTest {

@ -42,6 +42,6 @@ import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration;
@Documented @Documented
@ImportAutoConfiguration({ WebMvcAutoConfiguration.class, GsonAutoConfiguration.class, @ImportAutoConfiguration({ WebMvcAutoConfiguration.class, GsonAutoConfiguration.class,
JacksonAutoConfiguration.class, HttpMessageConvertersAutoConfiguration.class }) JacksonAutoConfiguration.class, HttpMessageConvertersAutoConfiguration.class })
public @interface ImportWebMvcAutoConfiguration { public @interface AutoConfigureWebMvc {
} }

@ -37,7 +37,7 @@ import org.springframework.web.context.WebApplicationContext;
* *
* @author Phillip Webb * @author Phillip Webb
* @author Andy Wilkinson * @author Andy Wilkinson
* @see ImportWebMvcAutoConfiguration * @see AutoConfigureWebMvc
*/ */
@Configuration @Configuration
@ConditionalOnWebApplication @ConditionalOnWebApplication

@ -69,7 +69,7 @@ import org.springframework.test.web.servlet.MockMvc;
@BootstrapWith(WebMvcTestContextBootstrapper.class) @BootstrapWith(WebMvcTestContextBootstrapper.class)
@OverrideAutoConfiguration(enabled = false) @OverrideAutoConfiguration(enabled = false)
@TypeExcludeFilters(WebMvcTypeExcludeFilter.class) @TypeExcludeFilters(WebMvcTypeExcludeFilter.class)
@ImportWebMvcAutoConfiguration @AutoConfigureWebMvc
@AutoConfigureMockMvc @AutoConfigureMockMvc
public @interface WebMvcTest { public @interface WebMvcTest {

Loading…
Cancel
Save