You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by zr...@apache.org on 2018/10/30 15:12:29 UTC

[camel] 02/02: Upgrade Spring Boot to 2.1.0.RELEASE

This is an automated email from the ASF dual-hosted git repository.

zregvart pushed a commit to branch spring-upgrades
in repository https://gitbox.apache.org/repos/asf/camel.git

commit d999cea923a79561004881c98fc9314cf5c1033b
Author: Zoran Regvart <zr...@apache.org>
AuthorDate: Mon Sep 24 21:39:17 2018 +0200

    Upgrade Spring Boot to 2.1.0.RELEASE
---
 .../org/apache/camel/http/common/CamelServlet.java |  1 -
 .../src/main/docs/spring-boot.adoc                 |  4 +-
 .../cloud/CamelCloudConfigurationProperties.java   |  2 -
 .../boot/CamelAutoConfigurationPropertiesTest.java |  2 +-
 ...amelAutoConfigurationWithContextRunnerTest.java | 54 ----------------------
 .../boot/CamelConfigurationLocationsTest.java      |  2 +-
 .../camel/spring/boot/CamelEventNotifierTest.java  |  2 +-
 .../boot/CustomCamelCamelConfigurationTest.java    |  2 +-
 .../spring/boot/CustomShutdownStrategyTest.java    |  2 +-
 .../spring/boot/SpringConverterDelegationTest.java |  2 +-
 .../camel/spring/boot/issues/RestDslPostTest.java  |  2 +-
 .../camel/spring/boot/issues/SimpleOgnlTest.java   |  2 +-
 .../boot/parent/SpringBootRefreshContextTest.java  |  5 +-
 parent/pom.xml                                     |  4 +-
 14 files changed, 15 insertions(+), 71 deletions(-)

diff --git a/components/camel-http-common/src/main/java/org/apache/camel/http/common/CamelServlet.java b/components/camel-http-common/src/main/java/org/apache/camel/http/common/CamelServlet.java
index 105373d..0fc2616 100644
--- a/components/camel-http-common/src/main/java/org/apache/camel/http/common/CamelServlet.java
+++ b/components/camel-http-common/src/main/java/org/apache/camel/http/common/CamelServlet.java
@@ -23,7 +23,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
-import java.util.stream.Collector;
 import java.util.stream.Collectors;
 import javax.servlet.AsyncContext;
 import javax.servlet.ServletConfig;
diff --git a/components/camel-spring-boot/src/main/docs/spring-boot.adoc b/components/camel-spring-boot/src/main/docs/spring-boot.adoc
index 063d0b2..1714859 100644
--- a/components/camel-spring-boot/src/main/docs/spring-boot.adoc
+++ b/components/camel-spring-boot/src/main/docs/spring-boot.adoc
@@ -162,7 +162,6 @@ The component supports 139 options, which are listed below.
 | *camel.springboot.shutdown-routes-in-reverse-order* | Sets whether routes should be shutdown in reverse or the same order as they where started. | true | Boolean
 | *camel.springboot.shutdown-suppress-logging-on-timeout* | Whether Camel should try to suppress logging during shutdown and timeout was triggered, meaning forced shutdown is happening. And during forced shutdown we want to avoid logging errors/warnings et all in the logs as a side-effect of the forced timeout. Notice the suppress is a best effort as there may still be some logs coming from 3rd party libraries and whatnot, which Camel cannot control. This option is default false. | false [...]
 | *camel.springboot.shutdown-timeout* | Timeout in seconds to graceful shutdown Camel. | 300 | Integer
-| *camel.springboot.stream-caching* | Sets whether stream caching is enabled or not (deprecated use stream-caching-enabled instead). Default is false. | false | Boolean
 | *camel.springboot.stream-caching-any-spool-rules* | Sets whether if just any of the org.apache.camel.spi.StreamCachingStrategy.SpoolRule rules returns true then shouldSpoolCache(long) returns true, to allow spooling to disk. If this option is false, then all the org.apache.camel.spi.StreamCachingStrategy.SpoolRule must return true. The default value is false which means that all the rules must return true. | false | Boolean
 | *camel.springboot.stream-caching-buffer-size* | Sets the stream caching buffer size to use when allocating in-memory buffers used for in-memory stream caches. The default size is 4096. | 0 | Integer
 | *camel.springboot.stream-caching-enabled* | Sets whether stream caching is enabled or not. Default is false. | false | Boolean
@@ -192,7 +191,6 @@ The component supports 139 options, which are listed below.
 | *camel.springboot.type-conversion* | Enables enhanced Camel/Spring type conversion. | true | Boolean
 | *camel.springboot.use-breadcrumb* | Set whether breadcrumb is enabled. The default value is true. | true | Boolean
 | *camel.springboot.use-data-type* | Whether to enable using data type on Camel messages. Data type are automatic turned on if one ore more routes has been explicit configured with input and output types. Otherwise data type is default off. | false | Boolean
-| *camel.springboot.use-m-d-c-logging* | To turn on MDC logging (deprecated use use-mdc-logging instead) | false | Boolean
 | *camel.springboot.use-mdc-logging* | To turn on MDC logging | false | Boolean
 | *camel.springboot.xml-rests* | Directory to scan for adding additional XML rests. You can turn this off by setting the value to false. | classpath:camel-rest/*.xml | String
 | *camel.springboot.xml-routes* | Directory to scan for adding additional XML routes. You can turn this off by setting the value to false. | classpath:camel/*.xml | String
@@ -225,6 +223,8 @@ The component supports 139 options, which are listed below.
 | *management.endpoint.camelroutes.enabled* | To turn on or off information about Camel Routes via actuator endpoint. | true | Boolean
 | *management.endpoint.camelroutes.read-only* | Whether Camel Routes actuator is in read-only mode. If not in read-only mode then operations to start/stop routes would be enabled. | true | Boolean
 | *management.info.camel.enabled* | Whether to enable Camel info. | true | Boolean
+| *camel.springboot.stream-caching* | Sets whether stream caching is enabled or not (deprecated use stream-caching-enabled instead). Default is false. | false | Boolean
+| *camel.springboot.use-m-d-c-logging* | To turn on MDC logging (deprecated use use-mdc-logging instead) | false | Boolean
 |===
 // spring-boot-auto-configure options: END
 
diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/cloud/CamelCloudConfigurationProperties.java b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/cloud/CamelCloudConfigurationProperties.java
index 20c83a7..51a8baa 100644
--- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/cloud/CamelCloudConfigurationProperties.java
+++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/cloud/CamelCloudConfigurationProperties.java
@@ -20,8 +20,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.camel.Expression;
-import org.apache.camel.cloud.ServiceLoadBalancer;
 import org.apache.camel.model.cloud.ServiceCallDefinitionConstants;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelAutoConfigurationPropertiesTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelAutoConfigurationPropertiesTest.java
index 4f15180..15de030 100644
--- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelAutoConfigurationPropertiesTest.java
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelAutoConfigurationPropertiesTest.java
@@ -35,7 +35,7 @@ import org.springframework.test.context.junit4.SpringRunner;
 @DirtiesContext
 @RunWith(SpringRunner.class)
 @EnableAutoConfiguration
-@SpringBootTest(classes = CamelAutoConfigurationPropertiesTest.class, properties = "camel.springboot.jmxEnabled=false")
+@SpringBootTest(properties = "camel.springboot.jmxEnabled=false")
 public class CamelAutoConfigurationPropertiesTest extends Assert {
 
     // Route fixtures
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelAutoConfigurationWithContextRunnerTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelAutoConfigurationWithContextRunnerTest.java
deleted file mode 100644
index d08fe4c..0000000
--- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelAutoConfigurationWithContextRunnerTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.apache.camel.spring.boot;
-
-import org.junit.Test;
-import org.springframework.boot.autoconfigure.AutoConfigurations;
-import org.springframework.boot.test.context.runner.ApplicationContextRunner;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class CamelAutoConfigurationWithContextRunnerTest {
-    @Test
-    public void testCamelAnnotationsAutoConfigurationBean() {
-        new ApplicationContextRunner()
-            .withConfiguration(
-                AutoConfigurations.of(
-                        CamelAutoConfigurationTest.class,
-                        RouteConfigWithCamelContextInjected.class,
-                        CamelAutoConfigurationWithContextRunnerTest.class
-                )
-            )
-            .withPropertyValues(
-                    "camel.springboot.consumerTemplateCacheSize=100",
-                    "camel.springboot.jmxEnabled=true",
-                    "camel.springboot.name=customName",
-                    "camel.springboot.typeConversion=true",
-                    "camel.springboot.threadNamePattern=customThreadName #counter#"
-            )
-            .run((context) -> {
-                    assertThat(context).doesNotHaveBean(CamelAnnotationsTest.TestConfig.class);
-                    assertThat(context).doesNotHaveBean(CamelAnnotationsTest.class);
-                    assertThat(context).getBeanNames(CamelAutoConfigurationTest.class).hasSize(1);
-                    assertThat(context).hasSingleBean(RouteConfigWithCamelContextInjected.class);
-                    assertThat(context).getBean(CamelAutoConfigurationTest.class).hasNoNullFieldsOrProperties();
-                                       
-                }
-            );
-    }
-
-}
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelConfigurationLocationsTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelConfigurationLocationsTest.java
index 82f61bc..c8b68dd 100644
--- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelConfigurationLocationsTest.java
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelConfigurationLocationsTest.java
@@ -33,7 +33,7 @@ import org.springframework.test.context.junit4.SpringRunner;
 @DirtiesContext
 @RunWith(SpringRunner.class)
 @EnableAutoConfiguration
-@SpringBootTest(classes = CamelConfigurationLocationsTest.class, properties = "camel.springboot.file-configurations=file:src/test/secret/*.properties")
+@SpringBootTest(properties = "camel.springboot.file-configurations=file:src/test/secret/*.properties")
 public class CamelConfigurationLocationsTest extends Assert {
 
     @Configuration
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelEventNotifierTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelEventNotifierTest.java
index 397c989..3012356 100644
--- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelEventNotifierTest.java
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelEventNotifierTest.java
@@ -39,7 +39,7 @@ import org.springframework.test.context.junit4.SpringRunner;
 @DirtiesContext
 @RunWith(SpringRunner.class)
 @EnableAutoConfiguration
-@SpringBootTest(classes = CamelEventNotifierTest.class)
+@SpringBootTest
 public class CamelEventNotifierTest extends Assert {
 
     @Configuration
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CustomCamelCamelConfigurationTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CustomCamelCamelConfigurationTest.java
index 42fcdf9..24ba9c9 100644
--- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CustomCamelCamelConfigurationTest.java
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CustomCamelCamelConfigurationTest.java
@@ -32,7 +32,7 @@ import org.springframework.test.context.junit4.SpringRunner;
 @DirtiesContext
 @RunWith(SpringRunner.class)
 @EnableAutoConfiguration
-@SpringBootTest(classes = CustomCamelCamelConfigurationTest.class)
+@SpringBootTest
 public class CustomCamelCamelConfigurationTest extends Assert {
 
     @Configuration
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CustomShutdownStrategyTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CustomShutdownStrategyTest.java
index bdf8d80..fb2aea4 100644
--- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CustomShutdownStrategyTest.java
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CustomShutdownStrategyTest.java
@@ -38,7 +38,7 @@ import org.springframework.test.context.junit4.SpringRunner;
 @DirtiesContext
 @RunWith(SpringRunner.class)
 @EnableAutoConfiguration
-@SpringBootTest(classes = CustomShutdownStrategyTest.class)
+@SpringBootTest
 public class CustomShutdownStrategyTest extends Assert {
 
     @Autowired
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SpringConverterDelegationTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SpringConverterDelegationTest.java
index 83c3332..3dae2cc 100644
--- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SpringConverterDelegationTest.java
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SpringConverterDelegationTest.java
@@ -32,7 +32,7 @@ import org.springframework.test.context.junit4.SpringRunner;
 @DirtiesContext
 @RunWith(SpringRunner.class)
 @EnableAutoConfiguration
-@SpringBootTest(classes = SpringConverterDelegationTest.class, properties = "camel.springboot.typeConversion=true")
+@SpringBootTest(properties = "camel.springboot.typeConversion=true")
 public class SpringConverterDelegationTest extends Assert {
 
     @Autowired
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/RestDslPostTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/RestDslPostTest.java
index 6d835b8..145cee9 100644
--- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/RestDslPostTest.java
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/RestDslPostTest.java
@@ -39,7 +39,7 @@ import org.springframework.util.SocketUtils;
 
 @RunWith(SpringRunner.class)
 @EnableAutoConfiguration
-@SpringBootTest(classes = { RestDslPostTest.class })
+@SpringBootTest
 public class RestDslPostTest extends Assert {
 
     static final int PORT = SocketUtils.findAvailableTcpPort(20000);
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
index 87148cd..45afd46 100644
--- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
@@ -34,7 +34,7 @@ import org.springframework.test.context.junit4.SpringRunner;
 
 @RunWith(SpringRunner.class)
 @EnableAutoConfiguration
-@SpringBootTest(classes = { SimpleOgnlTest.class })
+@SpringBootTest
 public class SimpleOgnlTest {
     @EndpointInject(uri = "mock:result")
     protected MockEndpoint resultEndpoint;
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/parent/SpringBootRefreshContextTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/parent/SpringBootRefreshContextTest.java
index d1adfcf..b658122 100644
--- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/parent/SpringBootRefreshContextTest.java
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/parent/SpringBootRefreshContextTest.java
@@ -20,6 +20,7 @@ import org.apache.camel.RoutesBuilder;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.spring.boot.RoutesCollector;
 import org.junit.Test;
+import org.springframework.boot.WebApplicationType;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.builder.SpringApplicationBuilder;
 import org.springframework.context.ConfigurableApplicationContext;
@@ -33,7 +34,7 @@ public class SpringBootRefreshContextTest {
     public void shouldOnlyCollectRoutesOnce() {
         GenericApplicationContext parent = new GenericApplicationContext();
         parent.refresh();
-        ConfigurableApplicationContext context = new SpringApplicationBuilder(Configuration.class).web(false).parent(parent).run();
+        ConfigurableApplicationContext context = new SpringApplicationBuilder(Configuration.class).web(WebApplicationType.NONE).parent(parent).run();
         ContextRefreshedEvent refreshEvent = new ContextRefreshedEvent(context);
         RoutesCollector collector = context.getBean(RoutesCollector.class);
         collector.onApplicationEvent(refreshEvent); //no changes should happen here
@@ -54,4 +55,4 @@ class Configuration {
         };
     }
 
-}
\ No newline at end of file
+}
diff --git a/parent/pom.xml b/parent/pom.xml
index 5942f42..22706b4 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -634,8 +634,8 @@
     <splunk-version>1.6.4.0_1</splunk-version>
     <spring-batch-version>4.0.1.RELEASE</spring-batch-version>
     <spring-batch-bundle-version>4.0.1.RELEASE_1</spring-batch-bundle-version>
-    <spring-boot-version>2.0.6.RELEASE</spring-boot-version>
-    <spring-cloud-commons-version>2.0.2.RELEASE</spring-cloud-commons-version>
+    <spring-boot-version>2.1.0.RELEASE</spring-boot-version>
+    <spring-cloud-commons-version>2.0.1.RELEASE</spring-cloud-commons-version>
     <spring-cloud-consul-version>2.0.1.RELEASE</spring-cloud-consul-version>
     <spring-cloud-netflix-version>2.0.2.RELEASE</spring-cloud-netflix-version>
     <spring-cloud-zookeeper-version>2.0.0.RELEASE</spring-cloud-zookeeper-version>