From eb035398b25323607227d11978bb0f5026566658 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Thu, 20 Nov 2014 12:12:27 -0800 Subject: [PATCH] Add SqlScriptsTestExecutionListener Update @IntegrationTest to include SqlScriptsTestExecutionListener. Fixes gh-1965 --- .../java/org/springframework/boot/test/IntegrationTest.java | 3 ++- .../boot/test/IntegrationTestPropertiesListener.java | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/spring-boot/src/main/java/org/springframework/boot/test/IntegrationTest.java b/spring-boot/src/main/java/org/springframework/boot/test/IntegrationTest.java index 12c0988cf9..4b55cb7cd5 100644 --- a/spring-boot/src/main/java/org/springframework/boot/test/IntegrationTest.java +++ b/spring-boot/src/main/java/org/springframework/boot/test/IntegrationTest.java @@ -25,6 +25,7 @@ import java.lang.annotation.Target; import org.springframework.core.env.Environment; import org.springframework.test.context.TestExecutionListeners; +import org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener; import org.springframework.test.context.support.DependencyInjectionTestExecutionListener; import org.springframework.test.context.support.DirtiesContextTestExecutionListener; import org.springframework.test.context.transaction.TransactionalTestExecutionListener; @@ -44,7 +45,7 @@ import org.springframework.test.context.transaction.TransactionalTestExecutionLi @TestExecutionListeners(listeners = { IntegrationTestPropertiesListener.class, DependencyInjectionTestExecutionListener.class, DirtiesContextTestExecutionListener.class, - TransactionalTestExecutionListener.class }) + TransactionalTestExecutionListener.class, SqlScriptsTestExecutionListener.class }) public @interface IntegrationTest { /** diff --git a/spring-boot/src/main/java/org/springframework/boot/test/IntegrationTestPropertiesListener.java b/spring-boot/src/main/java/org/springframework/boot/test/IntegrationTestPropertiesListener.java index 24139510ce..b3cc56a283 100644 --- a/spring-boot/src/main/java/org/springframework/boot/test/IntegrationTestPropertiesListener.java +++ b/spring-boot/src/main/java/org/springframework/boot/test/IntegrationTestPropertiesListener.java @@ -82,4 +82,5 @@ class IntegrationTestPropertiesListener extends AbstractTestExecutionListener { private void addIntegrationTestProperty(Set propertySourceProperties) { propertySourceProperties.add(IntegrationTest.class.getName() + "=true"); } + }