From 65efd1725f4184cb9720ed3eadb3a351a9f7f190 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 5 Aug 2015 15:35:47 +0200 Subject: [PATCH] Add before modes support for @IntegrationTest Spring Framework 4.2 introduced support for before modes in `@DirtiesContext` Make sure that `@IntegrationTest` also support these new modes. Closes gh-3642 --- .../java/org/springframework/boot/test/IntegrationTest.java | 2 ++ 1 file changed, 2 insertions(+) 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 b1726e059b..d1cf9fe002 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 @@ -27,6 +27,7 @@ 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.DirtiesContextBeforeModesTestExecutionListener; import org.springframework.test.context.support.DirtiesContextTestExecutionListener; import org.springframework.test.context.transaction.TransactionalTestExecutionListener; @@ -48,6 +49,7 @@ import org.springframework.test.context.transaction.TransactionalTestExecutionLi // Leave out the ServletTestExecutionListener because it only deals with Mock* servlet // stuff. A real embedded application will not need the mocks. @TestExecutionListeners(listeners = { IntegrationTestPropertiesListener.class, + DirtiesContextBeforeModesTestExecutionListener.class, DependencyInjectionTestExecutionListener.class, DirtiesContextTestExecutionListener.class, TransactionalTestExecutionListener.class, SqlScriptsTestExecutionListener.class })