From db50fb8704bdafa19e3cd959b75a7603609d35c1 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 13 Jul 2015 10:32:14 +0100 Subject: [PATCH] =?UTF-8?q?Remove=20redundant=20metadata=20for=20JOOQ?= =?UTF-8?q?=E2=80=99s=20SQL=20dialect?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also add a test that I’d written before Phil fixed the problem in 5dbe623. See gh-3468 --- .../additional-spring-configuration-metadata.json | 11 ----------- .../jooq/JooqAutoConfigurationTests.java | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json index e1f01ca942..521d4d158f 100644 --- a/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -236,17 +236,6 @@ } ] }, - { - "name": "spring.jooq.sql-dialect", - "providers": [ - { - "name": "handle-as", - "parameters": { - "target": "org.jooq.SQLDialect" - } - } - ] - }, { "name": "spring.jmx.server", "providers": [ diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jooq/JooqAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jooq/JooqAutoConfigurationTests.java index b2003bbf9b..4a0628c41d 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jooq/JooqAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jooq/JooqAutoConfigurationTests.java @@ -48,6 +48,7 @@ import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.transaction.PlatformTransactionManager; import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; @@ -57,6 +58,7 @@ import static org.junit.Assert.fail; * * @author Andreas Ahlenstorf * @author Phillip Webb + * @author Andy Wilkinson */ public class JooqAutoConfigurationTests { @@ -155,6 +157,15 @@ public class JooqAutoConfigurationTests { assertThat(dsl.configuration().visitListenerProviders().length, equalTo(1)); } + @Test + public void relaxedBindingOfSqlDialect() { + EnvironmentTestUtils.addEnvironment(this.context, + "spring.jooq.sql-dialect:PoSTGrES"); + registerAndRefresh(JooqDataSourceConfiguration.class, JooqAutoConfiguration.class); + assertThat(this.context.getBean(org.jooq.Configuration.class).dialect(), + is(equalTo(SQLDialect.POSTGRES))); + } + private void registerAndRefresh(Class... annotatedClasses) { this.context.register(annotatedClasses); this.context.refresh();