From 04c5fc88565fffdf141709fce77c7fef6f2e19d0 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 24 Mar 2015 13:47:06 +0000 Subject: [PATCH 1/3] Start building against Spring Framework 4.2.0 snapshots See gh-2575 --- spring-boot-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-dependencies/pom.xml b/spring-boot-dependencies/pom.xml index ce36eb9227..115362007f 100644 --- a/spring-boot-dependencies/pom.xml +++ b/spring-boot-dependencies/pom.xml @@ -111,7 +111,7 @@ 1.14 4.7.2 0.7-groovy-2.0 - 4.1.6.BUILD-SNAPSHOT + 4.2.0.BUILD-SNAPSHOT 1.4.3.RELEASE 1.1.1.RELEASE 3.0.3.RELEASE From 7a73c5883f857f7dfb56d73410af96eae04a0e63 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 24 Mar 2015 13:51:49 +0000 Subject: [PATCH 2/3] Avoid using @Order on @Configuration classes as Spring now honours it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In Spring Framework 4.1, @Order on a @Configuration class had no effect. This allowed us to use it on auto-configuration classes to control the ordering of auto-configuration classes without it having any broader implications for configuration class ordering. Spring Framework 4.2 now honours @Order on @Configuration classes. This breaks a number of tests where we were relying on the order that the classes were passed to register when evaluating various bean conditions. This commit replaces the use of @Order on auto-configuration classes with a new annotation, @AutoConfigureOrder. The new annotation is handled by AutoConfigurationSorter where it’s used to order auto-configuration classes. This allows us to order auto-configuration classes without the unwanted side-effect of this also affecting the general ordering of configuration classes. See gh-2575 --- .../AutoConfigurationSorter.java | 3 +- .../autoconfigure/AutoConfigureOrder.java | 47 +++++++++++++++++++ .../MessageSourceAutoConfiguration.java | 3 +- .../PropertyPlaceholderAutoConfiguration.java | 3 +- .../cloud/CloudAutoConfiguration.java | 4 +- .../jersey/JerseyAutoConfiguration.java | 4 +- .../DispatcherServletAutoConfiguration.java | 3 +- ...ddedServletContainerAutoConfiguration.java | 4 +- .../web/WebMvcAutoConfiguration.java | 4 +- .../AutoConfigurationSorterTests.java | 5 +- 10 files changed, 62 insertions(+), 18 deletions(-) create mode 100644 spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigureOrder.java diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationSorter.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationSorter.java index 60962a61d1..f2487faa71 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationSorter.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationSorter.java @@ -28,7 +28,6 @@ import java.util.Map; import java.util.Set; import org.springframework.core.Ordered; -import org.springframework.core.annotation.Order; import org.springframework.core.io.ResourceLoader; import org.springframework.core.type.AnnotationMetadata; import org.springframework.core.type.classreading.CachingMetadataReaderFactory; @@ -142,7 +141,7 @@ class AutoConfigurationSorter { public int getOrder() { Map orderedAnnotation = this.metadata - .getAnnotationAttributes(Order.class.getName()); + .getAnnotationAttributes(AutoConfigureOrder.class.getName()); return (orderedAnnotation == null ? Ordered.LOWEST_PRECEDENCE : (Integer) orderedAnnotation.get("value")); } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigureOrder.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigureOrder.java new file mode 100644 index 0000000000..471c51c9b0 --- /dev/null +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigureOrder.java @@ -0,0 +1,47 @@ +/* + * Copyright 2012-2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.autoconfigure; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; + +/** + * Auto-configuration specific variant of Spring Framework's {@link Order} annotation. + * Allows auto-configuration classes to be ordered among themselves without affecting the + * order of configuration classes passed to + * {@link AnnotationConfigApplicationContext#register(Class...)}. + * + * @author Andy Wilkinson + * @since 1.3.0 + */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ ElementType.TYPE, ElementType.METHOD, ElementType.FIELD }) +public @interface AutoConfigureOrder { + + /** + * The order value. Default is {@link Ordered#LOWEST_PRECEDENCE}. + * @see Ordered#getOrder() + */ + int value() default Ordered.LOWEST_PRECEDENCE; + +} diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/MessageSourceAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/MessageSourceAutoConfiguration.java index 4d833b548c..68205bea14 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/MessageSourceAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/MessageSourceAutoConfiguration.java @@ -33,7 +33,6 @@ import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Configuration; import org.springframework.context.support.ResourceBundleMessageSource; import org.springframework.core.Ordered; -import org.springframework.core.annotation.Order; import org.springframework.core.io.Resource; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.core.type.AnnotatedTypeMetadata; @@ -51,7 +50,7 @@ import static org.springframework.util.StringUtils.trimAllWhitespace; */ @Configuration @ConditionalOnMissingBean(MessageSource.class) -@Order(Ordered.HIGHEST_PRECEDENCE) +@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE) @Conditional(ResourceBundleCondition.class) @EnableConfigurationProperties @ConfigurationProperties(prefix = "spring.messages") diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/PropertyPlaceholderAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/PropertyPlaceholderAutoConfiguration.java index f8a8936432..ccd0acd86e 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/PropertyPlaceholderAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/PropertyPlaceholderAutoConfiguration.java @@ -22,7 +22,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.core.Ordered; -import org.springframework.core.annotation.Order; /** * {@link EnableAutoConfiguration Auto-configuration} for @@ -32,7 +31,7 @@ import org.springframework.core.annotation.Order; * @author Dave Syer */ @Configuration -@Order(Ordered.HIGHEST_PRECEDENCE) +@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE) public class PropertyPlaceholderAutoConfiguration { @Bean diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cloud/CloudAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cloud/CloudAutoConfiguration.java index 4081c4f6f4..ba33d51b76 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cloud/CloudAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cloud/CloudAutoConfiguration.java @@ -16,6 +16,7 @@ package org.springframework.boot.autoconfigure.cloud; +import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -28,7 +29,6 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Profile; import org.springframework.core.Ordered; -import org.springframework.core.annotation.Order; /** * {@link EnableAutoConfiguration Auto-configuration} for Spring Cloud. @@ -47,7 +47,7 @@ import org.springframework.core.annotation.Order; */ @Configuration @Profile("cloud") -@Order(CloudAutoConfiguration.ORDER) +@AutoConfigureOrder(CloudAutoConfiguration.ORDER) @ConditionalOnClass(CloudScanConfiguration.class) @ConditionalOnMissingBean(Cloud.class) @ConditionalOnProperty(prefix = "spring.cloud", name = "enabled", havingValue = "true", matchIfMissing = true) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jersey/JerseyAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jersey/JerseyAutoConfiguration.java index 75982d3895..ee998aacb4 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jersey/JerseyAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jersey/JerseyAutoConfiguration.java @@ -33,6 +33,7 @@ import org.glassfish.jersey.servlet.ServletProperties; import org.springframework.beans.factory.ListableBeanFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureBefore; +import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; @@ -48,7 +49,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.Ordered; import org.springframework.core.annotation.AnnotationUtils; -import org.springframework.core.annotation.Order; import org.springframework.web.WebApplicationInitializer; import org.springframework.web.filter.RequestContextFilter; @@ -64,7 +64,7 @@ import org.springframework.web.filter.RequestContextFilter; "javax.servlet.ServletRegistration" }) @ConditionalOnBean(type = "org.glassfish.jersey.server.ResourceConfig") @ConditionalOnWebApplication -@Order(Ordered.HIGHEST_PRECEDENCE) +@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE) @AutoConfigureBefore(DispatcherServletAutoConfiguration.class) @EnableConfigurationProperties(JerseyProperties.class) public class JerseyAutoConfiguration implements WebApplicationInitializer { diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/DispatcherServletAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/DispatcherServletAutoConfiguration.java index 376c729c94..cc8675e42b 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/DispatcherServletAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/DispatcherServletAutoConfiguration.java @@ -25,6 +25,7 @@ import javax.servlet.ServletRegistration; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; @@ -53,7 +54,7 @@ import org.springframework.web.servlet.DispatcherServlet; * @author Phillip Webb * @author Dave Syer */ -@Order(Ordered.HIGHEST_PRECEDENCE) +@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE) @Configuration @ConditionalOnWebApplication @ConditionalOnClass(DispatcherServlet.class) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration.java index 4cdb945f02..eae761b360 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration.java @@ -29,6 +29,7 @@ import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.RootBeanDefinition; +import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -45,7 +46,6 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.context.annotation.ImportBeanDefinitionRegistrar; import org.springframework.core.Ordered; -import org.springframework.core.annotation.Order; import org.springframework.core.type.AnnotationMetadata; import org.springframework.util.ObjectUtils; import org.xnio.SslClientAuthMode; @@ -57,7 +57,7 @@ import org.xnio.SslClientAuthMode; * @author Dave Syer * @author Ivan Sopov */ -@Order(Ordered.HIGHEST_PRECEDENCE) +@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE) @Configuration @ConditionalOnWebApplication @Import(EmbeddedServletContainerCustomizerBeanPostProcessorRegistrar.class) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.java index 5d599bfc81..7e5c68e4b9 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.java @@ -32,6 +32,7 @@ import org.springframework.beans.factory.ListableBeanFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; @@ -45,7 +46,6 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Primary; import org.springframework.core.Ordered; -import org.springframework.core.annotation.Order; import org.springframework.core.convert.converter.Converter; import org.springframework.core.convert.converter.GenericConverter; import org.springframework.core.io.ClassPathResource; @@ -92,7 +92,7 @@ import org.springframework.web.servlet.view.InternalResourceViewResolver; @ConditionalOnClass({ Servlet.class, DispatcherServlet.class, WebMvcConfigurerAdapter.class }) @ConditionalOnMissingBean(WebMvcConfigurationSupport.class) -@Order(Ordered.HIGHEST_PRECEDENCE + 10) +@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE + 10) @AutoConfigureAfter(DispatcherServletAutoConfiguration.class) public class WebMvcAutoConfiguration { diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationSorterTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationSorterTests.java index 10595f4733..f7a1e84f6a 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationSorterTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationSorterTests.java @@ -28,7 +28,6 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.springframework.core.Ordered; -import org.springframework.core.annotation.Order; import org.springframework.core.io.DefaultResourceLoader; import static org.junit.Assert.assertThat; @@ -157,11 +156,11 @@ public class AutoConfigurationSorterTests { } - @Order(Ordered.LOWEST_PRECEDENCE) + @AutoConfigureOrder(Ordered.LOWEST_PRECEDENCE) public static class OrderLowest { } - @Order(Ordered.HIGHEST_PRECEDENCE) + @AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE) public static class OrderHighest { } From bc99ad2120f8a5a6f0be9bf6e5c24f5a03145e94 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 25 Mar 2015 10:45:57 +0000 Subject: [PATCH 3/3] =?UTF-8?q?Ignore=20Batch=20tests=20that=20use=20JDBC?= =?UTF-8?q?=20as=20they=20don=E2=80=99t=20work=20with=20Spring=204.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Spring Framework’s ParamterizedRowMapper has been deprecated since 3.1 and has been removed in 4.2. Spring Batch currently relies on ParameterizedRowMapper, making it incompatible with 4.2. To allow us to build successfully against 4.2, this commit ignores Spring Boot’s tests that use Spring Batch’s JDBC support. See gh-2575 --- .../autoconfigure/batch/BatchAutoConfigurationTests.java | 8 ++++++++ .../springframework/boot/cli/SampleIntegrationTests.java | 2 ++ .../java/sample/batch/SampleBatchApplicationTests.java | 2 ++ 3 files changed, 12 insertions(+) diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java index 02c8e92eb2..6cf4186c03 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java @@ -23,6 +23,7 @@ import javax.persistence.EntityManagerFactory; import javax.sql.DataSource; import org.junit.After; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -84,6 +85,7 @@ public class BatchAutoConfigurationTests { } @Test + @Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2") public void testDefaultContext() throws Exception { this.context = new AnnotationConfigApplicationContext(); this.context.register(TestConfiguration.class, @@ -120,6 +122,7 @@ public class BatchAutoConfigurationTests { } @Test + @Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2") public void testDefinesAndLaunchesJob() throws Exception { this.context = new AnnotationConfigApplicationContext(); this.context.register(JobConfiguration.class, @@ -133,6 +136,7 @@ public class BatchAutoConfigurationTests { } @Test + @Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2") public void testDefinesAndLaunchesNamedJob() throws Exception { this.context = new AnnotationConfigApplicationContext(); EnvironmentTestUtils.addEnvironment(this.context, @@ -149,6 +153,7 @@ public class BatchAutoConfigurationTests { } @Test + @Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2") public void testDefinesAndLaunchesLocalJob() throws Exception { this.context = new AnnotationConfigApplicationContext(); EnvironmentTestUtils.addEnvironment(this.context, @@ -164,6 +169,7 @@ public class BatchAutoConfigurationTests { } @Test + @Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2") public void testDisableLaunchesJob() throws Exception { this.context = new AnnotationConfigApplicationContext(); EnvironmentTestUtils.addEnvironment(this.context, @@ -177,6 +183,7 @@ public class BatchAutoConfigurationTests { } @Test + @Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2") public void testDisableSchemaLoader() throws Exception { this.context = new AnnotationConfigApplicationContext(); EnvironmentTestUtils.addEnvironment(this.context, @@ -193,6 +200,7 @@ public class BatchAutoConfigurationTests { } @Test + @Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2") public void testUsingJpa() throws Exception { this.context = new AnnotationConfigApplicationContext(); // The order is very important here: DataSource -> Hibernate -> Batch diff --git a/spring-boot-cli/src/test/java/org/springframework/boot/cli/SampleIntegrationTests.java b/spring-boot-cli/src/test/java/org/springframework/boot/cli/SampleIntegrationTests.java index d0453f119b..5e80ea77ca 100644 --- a/spring-boot-cli/src/test/java/org/springframework/boot/cli/SampleIntegrationTests.java +++ b/spring-boot-cli/src/test/java/org/springframework/boot/cli/SampleIntegrationTests.java @@ -63,6 +63,7 @@ public class SampleIntegrationTests { } @Test + @Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2") public void jobSample() throws Exception { String output = this.cli.run("job.groovy", "foo=bar"); assertTrue("Wrong output: " + output, @@ -81,6 +82,7 @@ public class SampleIntegrationTests { } @Test + @Ignore("Spring Batch is incompatible with Spring Framework 4.2") public void jobWebSample() throws Exception { String output = this.cli.run("job.groovy", "web.groovy", "foo=bar"); assertTrue("Wrong output: " + output, diff --git a/spring-boot-samples/spring-boot-sample-batch/src/test/java/sample/batch/SampleBatchApplicationTests.java b/spring-boot-samples/spring-boot-sample-batch/src/test/java/sample/batch/SampleBatchApplicationTests.java index 6b469edd87..b7365cd4e5 100644 --- a/spring-boot-samples/spring-boot-sample-batch/src/test/java/sample/batch/SampleBatchApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-batch/src/test/java/sample/batch/SampleBatchApplicationTests.java @@ -16,6 +16,7 @@ package sample.batch; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.springframework.boot.SpringApplication; @@ -24,6 +25,7 @@ import org.springframework.boot.test.OutputCapture; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +@Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2") public class SampleBatchApplicationTests { @Rule