Commit ba85394e authored by Andy Wilkinson's avatar Andy Wilkinson

Merge pull request #17066 from nosan

* gh-17066:
  Polish "Auto-configure caching in jOOQ sliced tests"
  Auto-configure caching in jOOQ sliced tests

Closes gh-17066
parents 13a7a52c c2a4a3f6
/* /*
* Copyright 2012-2018 the original author or authors. * Copyright 2012-2019 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -28,6 +28,7 @@ import org.junit.jupiter.api.extension.ExtendWith; ...@@ -28,6 +28,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication; 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.core.AutoConfigureCache;
import org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters; import org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.context.annotation.ComponentScan.Filter; import org.springframework.context.annotation.ComponentScan.Filter;
...@@ -64,6 +65,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -64,6 +65,7 @@ import org.springframework.transaction.annotation.Transactional;
@OverrideAutoConfiguration(enabled = false) @OverrideAutoConfiguration(enabled = false)
@TypeExcludeFilters(JooqTypeExcludeFilter.class) @TypeExcludeFilters(JooqTypeExcludeFilter.class)
@Transactional @Transactional
@AutoConfigureCache
@AutoConfigureJooq @AutoConfigureJooq
@ImportAutoConfiguration @ImportAutoConfiguration
public @interface JooqTest { public @interface JooqTest {
......
...@@ -25,6 +25,7 @@ import org.junit.runner.RunWith; ...@@ -25,6 +25,7 @@ import org.junit.runner.RunWith;
import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration;
import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration; import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration;
import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration; import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration;
import org.springframework.boot.test.autoconfigure.orm.jpa.ExampleComponent; import org.springframework.boot.test.autoconfigure.orm.jpa.ExampleComponent;
...@@ -82,4 +83,9 @@ public class JooqTestIntegrationTests { ...@@ -82,4 +83,9 @@ public class JooqTestIntegrationTests {
assertThat(this.applicationContext).has(importedAutoConfiguration(LiquibaseAutoConfiguration.class)); assertThat(this.applicationContext).has(importedAutoConfiguration(LiquibaseAutoConfiguration.class));
} }
@Test
public void cacheAutoConfigurationWasImported() {
assertThat(this.applicationContext).has(importedAutoConfiguration(CacheAutoConfiguration.class));
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment