Skip to content

Commit ba85394

Browse files
committed
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
2 parents 13a7a52 + c2a4a3f commit ba85394

File tree

2 files changed

+9
-1
lines changed
  • spring-boot-project/spring-boot-test-autoconfigure/src

2 files changed

+9
-1
lines changed

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jooq/JooqTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2018 the original author or authors.
2+
* Copyright 2012-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,6 +28,7 @@
2828
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
2929
import org.springframework.boot.autoconfigure.SpringBootApplication;
3030
import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration;
31+
import org.springframework.boot.test.autoconfigure.core.AutoConfigureCache;
3132
import org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters;
3233
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
3334
import org.springframework.context.annotation.ComponentScan.Filter;
@@ -64,6 +65,7 @@
6465
@OverrideAutoConfiguration(enabled = false)
6566
@TypeExcludeFilters(JooqTypeExcludeFilter.class)
6667
@Transactional
68+
@AutoConfigureCache
6769
@AutoConfigureJooq
6870
@ImportAutoConfiguration
6971
public @interface JooqTest {

spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jooq/JooqTestIntegrationTests.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
2727
import org.springframework.beans.factory.annotation.Autowired;
28+
import org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration;
2829
import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration;
2930
import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration;
3031
import org.springframework.boot.test.autoconfigure.orm.jpa.ExampleComponent;
@@ -82,4 +83,9 @@ public void liquibaseAutoConfigurationWasImported() {
8283
assertThat(this.applicationContext).has(importedAutoConfiguration(LiquibaseAutoConfiguration.class));
8384
}
8485

86+
@Test
87+
public void cacheAutoConfigurationWasImported() {
88+
assertThat(this.applicationContext).has(importedAutoConfiguration(CacheAutoConfiguration.class));
89+
}
90+
8591
}

0 commit comments

Comments
 (0)