Skip to content

Commit

Permalink
Make test auto-configuration classes public
Browse files Browse the repository at this point in the history
Make test auto-configuration classes public so that they can be used
by others with @AutoConfigureBefore/@AutoConfigureAfter.

Fixes spring-projectsgh-6073
  • Loading branch information
philwebb committed May 31, 2016
1 parent b843306 commit e1d7462
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@
* Auto-configuration for a test database.
*
* @author Phillip Webb
* @since 1.4.0
* @see AutoConfigureTestDatabase
*/
@Configuration
@AutoConfigureBefore(DataSourceAutoConfiguration.class)
class TestDatabaseAutoConfiguration {
public class TestDatabaseAutoConfiguration {

private final Environment environment;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@
* Auto-configuration for {@link TestEntityManager}.
*
* @author Phillip Webb
* @since 1.4.0
* @see AutoConfigureTestEntityManager
*/
@Configuration
@ConditionalOnClass({ EntityManagerFactory.class })
@AutoConfigureAfter(HibernateJpaAutoConfiguration.class)
class TestEntityManagerAutoConfiguration {
public class TestEntityManagerAutoConfiguration {

@Bean
@ConditionalOnMissingBean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@
* {@link EnableAutoConfiguration Auto-configuration} for Spring REST Docs.
*
* @author Andy Wilkinson
* @since 1.4.0
*/
@Configuration
@ConditionalOnWebApplication
@EnableConfigurationProperties
class RestDocsAutoConfiguration {
public class RestDocsAutoConfiguration {

@Bean
@ConditionalOnMissingBean(MockMvcRestDocumentationConfigurer.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@
* Auto-configuration for {@link MockRestServiceServer} support.
*
* @author Phillip Webb
* @since 1.4.0
* @see AutoConfigureMockRestServiceServer
*/
@Configuration
@ConditionalOnProperty(prefix = "spring.test.webclient.mockrestserviceserver", name = "enabled")
class MockRestServiceServerAutoConfiguration {
public class MockRestServiceServerAutoConfiguration {

@Bean
public MockServerRestTemplateCustomizer mockServerRestTemplateCustomizer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@
* {@link AutoConfigureWebClient#registerRestTemplate()} is {@code true}.
*
* @author Phillip Webb
* @since 1.4.0
* @see AutoConfigureMockRestServiceServer
*/
@Configuration
@ConditionalOnProperty(prefix = "spring.test.webclient", name = "register-rest-template")
@AutoConfigureAfter(WebClientAutoConfiguration.class)
class WebClientRestTemplateAutoConfiguration {
public class WebClientRestTemplateAutoConfiguration {

@Bean
public RestTemplate restTemplate(RestTemplateBuilder builder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@
* @author Phillip Webb
* @author Andy Wilkinson
* @see AutoConfigureWebMvc
* @since 1.4.0
*/
@Configuration
@ConditionalOnWebApplication
@AutoConfigureAfter(WebMvcAutoConfiguration.class)
@EnableConfigurationProperties
class MockMvcAutoConfiguration {
public class MockMvcAutoConfiguration {

private final WebApplicationContext context;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* Auto-configuration for Spring Security's testing support.
*
* @author Andy Wilkinson
* @since 1.4.0
*/
@Configuration
@ConditionalOnProperty(prefix = "spring.test.mockmvc", name = "secure", havingValue = "true", matchIfMissing = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@
* Auto-configuration for HtmlUnit {@link WebClient} MockMVC integration.
*
* @author Phillip Webb
* @since 1.4.0
*/
@Configuration
@ConditionalOnClass(WebClient.class)
@AutoConfigureAfter(MockMvcAutoConfiguration.class)
@ConditionalOnProperty(prefix = "spring.test.webmvc.webclient", name = "enabled", matchIfMissing = true)
class MockMvcWebClientAutoConfiguration {
public class MockMvcWebClientAutoConfiguration {

private final Environment environment;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@
* Auto-configuration for Selenium {@link WebDriver} MockMVC integration.
*
* @author Phillip Webb
* @since 1.4.0
*/
@Configuration
@ConditionalOnClass(HtmlUnitDriver.class)
@AutoConfigureAfter(MockMvcAutoConfiguration.class)
@ConditionalOnProperty(prefix = "spring.test.webmvc.webdriver", name = "enabled", matchIfMissing = true)
class MockMvcWebDriverAutoConfiguration {
public class MockMvcWebDriverAutoConfiguration {

private final Environment environment;

Expand Down

0 comments on commit e1d7462

Please sign in to comment.