From 69cb823bf2788d49dfcfc461a621bd425b47cd1b Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Tue, 14 Mar 2017 08:11:22 -0600 Subject: [PATCH] polish --- pom.xml | 4 ++-- .../cloud/gateway/actuate/GatewayEndpoint.java | 4 ++-- .../cloud/gateway/{model => api}/RouteLocator.java | 3 ++- .../cloud/gateway/{model => api}/RouteWriter.java | 3 ++- .../cloud/gateway/config/GatewayAutoConfiguration.java | 4 ++-- .../cloud/gateway/config/PropertiesRouteLocator.java | 2 +- .../cloud/gateway/discovery/DiscoveryClientRouteLocator.java | 2 +- .../cloud/gateway/handler/RoutePredicateHandlerMapping.java | 2 +- .../cloud/gateway/support/CachingRouteLocator.java | 2 +- .../cloud/gateway/support/CompositeRouteLocator.java | 2 +- .../cloud/gateway/support/InMemoryRouteRepository.java | 4 ++-- .../cloud/gateway/test/BaseWebClientTests.java | 5 +---- .../cloud/gateway/test/GatewayTestApplication.java | 2 +- .../cloud/gateway/sample/GatewaySampleApplication.java | 2 +- .../cloud/gateway/sample/GatewaySampleApplicationTests.java | 2 +- 15 files changed, 21 insertions(+), 22 deletions(-) rename spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/{model => api}/RouteLocator.java (88%) rename spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/{model => api}/RouteWriter.java (88%) diff --git a/pom.xml b/pom.xml index 4944c0033..dd0e3135f 100644 --- a/pom.xml +++ b/pom.xml @@ -48,7 +48,7 @@ UTF-8 UTF-8 1.8 - Aluminium-SR1 + Aluminium-SR1 2.0.0.BUILD-SNAPSHOT 1.2.0.BUILD-SNAPSHOT 1.3.0.BUILD-SNAPSHOT @@ -73,7 +73,7 @@ io.projectreactor reactor-bom - ${reactor.version} + ${reactor-bom.version} pom import diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/actuate/GatewayEndpoint.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/actuate/GatewayEndpoint.java index 20cf9d7da..b672924fc 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/actuate/GatewayEndpoint.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/actuate/GatewayEndpoint.java @@ -26,8 +26,8 @@ import java.util.Optional; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.cloud.gateway.model.Route; -import org.springframework.cloud.gateway.model.RouteLocator; -import org.springframework.cloud.gateway.model.RouteWriter; +import org.springframework.cloud.gateway.api.RouteLocator; +import org.springframework.cloud.gateway.api.RouteWriter; import org.springframework.cloud.gateway.filter.GlobalFilter; import org.springframework.cloud.gateway.filter.route.RouteFilter; import org.springframework.cloud.gateway.handler.FilteringWebHandler; diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/model/RouteLocator.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/api/RouteLocator.java similarity index 88% rename from spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/model/RouteLocator.java rename to spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/api/RouteLocator.java index 1a411ca43..ae5642e1d 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/model/RouteLocator.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/api/RouteLocator.java @@ -15,8 +15,9 @@ * */ -package org.springframework.cloud.gateway.model; +package org.springframework.cloud.gateway.api; +import org.springframework.cloud.gateway.model.Route; import reactor.core.publisher.Flux; /** diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/model/RouteWriter.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/api/RouteWriter.java similarity index 88% rename from spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/model/RouteWriter.java rename to spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/api/RouteWriter.java index 04f562237..8d7247c10 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/model/RouteWriter.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/api/RouteWriter.java @@ -15,8 +15,9 @@ * */ -package org.springframework.cloud.gateway.model; +package org.springframework.cloud.gateway.api; +import org.springframework.cloud.gateway.model.Route; import reactor.core.publisher.Mono; /** diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/config/GatewayAutoConfiguration.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/config/GatewayAutoConfiguration.java index 4584225dc..194d37367 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/config/GatewayAutoConfiguration.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/config/GatewayAutoConfiguration.java @@ -28,8 +28,8 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.cloud.client.loadbalancer.LoadBalancerClient; import org.springframework.cloud.gateway.actuate.GatewayEndpoint; import org.springframework.cloud.gateway.filter.route.PrefixPathRouteFilter; -import org.springframework.cloud.gateway.model.RouteLocator; -import org.springframework.cloud.gateway.model.RouteWriter; +import org.springframework.cloud.gateway.api.RouteLocator; +import org.springframework.cloud.gateway.api.RouteWriter; import org.springframework.cloud.gateway.filter.GlobalFilter; import org.springframework.cloud.gateway.filter.LoadBalancerClientFilter; import org.springframework.cloud.gateway.filter.RouteToRequestUrlFilter; diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/config/PropertiesRouteLocator.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/config/PropertiesRouteLocator.java index 8e64ddd08..187578f00 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/config/PropertiesRouteLocator.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/config/PropertiesRouteLocator.java @@ -18,7 +18,7 @@ package org.springframework.cloud.gateway.config; import org.springframework.cloud.gateway.model.Route; -import org.springframework.cloud.gateway.model.RouteLocator; +import org.springframework.cloud.gateway.api.RouteLocator; import reactor.core.publisher.Flux; diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/discovery/DiscoveryClientRouteLocator.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/discovery/DiscoveryClientRouteLocator.java index dc6d0f818..c22c3a007 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/discovery/DiscoveryClientRouteLocator.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/discovery/DiscoveryClientRouteLocator.java @@ -23,7 +23,7 @@ import org.springframework.cloud.client.discovery.DiscoveryClient; import org.springframework.cloud.gateway.model.FilterDefinition; import org.springframework.cloud.gateway.model.PredicateDefinition; import org.springframework.cloud.gateway.model.Route; -import org.springframework.cloud.gateway.model.RouteLocator; +import org.springframework.cloud.gateway.api.RouteLocator; import org.springframework.cloud.gateway.filter.route.RewritePathRouteFilter; import org.springframework.cloud.gateway.handler.predicate.PathRoutePredicate; diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMapping.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMapping.java index 755353352..64c7331ca 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMapping.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMapping.java @@ -26,7 +26,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.function.Function; import java.util.function.Predicate; -import org.springframework.cloud.gateway.model.RouteLocator; +import org.springframework.cloud.gateway.api.RouteLocator; import org.springframework.cloud.gateway.model.Route; import org.springframework.cloud.gateway.model.PredicateDefinition; import org.springframework.cloud.gateway.handler.predicate.RoutePredicate; diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/support/CachingRouteLocator.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/support/CachingRouteLocator.java index 29aea2ddd..62700827a 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/support/CachingRouteLocator.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/support/CachingRouteLocator.java @@ -21,7 +21,7 @@ import java.util.List; import java.util.concurrent.atomic.AtomicReference; import org.springframework.cloud.gateway.model.Route; -import org.springframework.cloud.gateway.model.RouteLocator; +import org.springframework.cloud.gateway.api.RouteLocator; import org.springframework.context.event.EventListener; import reactor.core.publisher.Flux; diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/support/CompositeRouteLocator.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/support/CompositeRouteLocator.java index d7698d3df..04726cdce 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/support/CompositeRouteLocator.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/support/CompositeRouteLocator.java @@ -18,7 +18,7 @@ package org.springframework.cloud.gateway.support; import org.springframework.cloud.gateway.model.Route; -import org.springframework.cloud.gateway.model.RouteLocator; +import org.springframework.cloud.gateway.api.RouteLocator; import reactor.core.publisher.Flux; /** diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/support/InMemoryRouteRepository.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/support/InMemoryRouteRepository.java index 2f7334bd6..0ef28c5c3 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/support/InMemoryRouteRepository.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/support/InMemoryRouteRepository.java @@ -21,8 +21,8 @@ import java.util.LinkedHashMap; import java.util.Map; import org.springframework.cloud.gateway.model.Route; -import org.springframework.cloud.gateway.model.RouteLocator; -import org.springframework.cloud.gateway.model.RouteWriter; +import org.springframework.cloud.gateway.api.RouteLocator; +import org.springframework.cloud.gateway.api.RouteWriter; import static java.util.Collections.synchronizedMap; diff --git a/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/test/BaseWebClientTests.java b/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/test/BaseWebClientTests.java index 49003aab3..31792db79 100644 --- a/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/test/BaseWebClientTests.java +++ b/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/test/BaseWebClientTests.java @@ -26,10 +26,9 @@ import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.junit.Before; -import org.springframework.boot.context.embedded.LocalServerPort; +import org.springframework.boot.web.server.LocalServerPort; import org.springframework.cloud.gateway.EnableGateway; import org.springframework.cloud.gateway.filter.GlobalFilter; -import org.springframework.cloud.gateway.filter.route.RouteFilter; import org.springframework.cloud.gateway.model.Route; import org.springframework.cloud.netflix.ribbon.RibbonClient; import org.springframework.cloud.netflix.ribbon.RibbonClients; @@ -37,14 +36,12 @@ import org.springframework.cloud.netflix.ribbon.StaticServerList; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; -import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.reactive.function.client.WebClient; import org.springframework.web.server.ServerWebExchange; -import org.springframework.web.server.WebFilter; import com.netflix.loadbalancer.Server; import com.netflix.loadbalancer.ServerList; diff --git a/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/test/GatewayTestApplication.java b/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/test/GatewayTestApplication.java index be53d5a85..b139b4703 100644 --- a/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/test/GatewayTestApplication.java +++ b/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/test/GatewayTestApplication.java @@ -23,7 +23,7 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.cloud.client.discovery.DiscoveryClient; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.gateway.EnableGateway; -import org.springframework.cloud.gateway.model.RouteLocator; +import org.springframework.cloud.gateway.api.RouteLocator; import org.springframework.cloud.gateway.config.GatewayProperties; import org.springframework.cloud.gateway.config.PropertiesRouteLocator; import org.springframework.cloud.gateway.discovery.DiscoveryClientRouteLocator; diff --git a/spring-cloud-gateway-sample/src/main/java/org/springframework/cloud/gateway/sample/GatewaySampleApplication.java b/spring-cloud-gateway-sample/src/main/java/org/springframework/cloud/gateway/sample/GatewaySampleApplication.java index 3530105b4..945954bc9 100644 --- a/spring-cloud-gateway-sample/src/main/java/org/springframework/cloud/gateway/sample/GatewaySampleApplication.java +++ b/spring-cloud-gateway-sample/src/main/java/org/springframework/cloud/gateway/sample/GatewaySampleApplication.java @@ -21,7 +21,7 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.cloud.gateway.EnableGateway; -import org.springframework.cloud.gateway.model.RouteLocator; +import org.springframework.cloud.gateway.api.RouteLocator; import org.springframework.cloud.gateway.config.GatewayProperties; import org.springframework.cloud.gateway.config.PropertiesRouteLocator; import org.springframework.cloud.gateway.support.CachingRouteLocator; diff --git a/spring-cloud-gateway-sample/src/test/java/org/springframework/cloud/gateway/sample/GatewaySampleApplicationTests.java b/spring-cloud-gateway-sample/src/test/java/org/springframework/cloud/gateway/sample/GatewaySampleApplicationTests.java index 640e3de98..08003343a 100644 --- a/spring-cloud-gateway-sample/src/test/java/org/springframework/cloud/gateway/sample/GatewaySampleApplicationTests.java +++ b/spring-cloud-gateway-sample/src/test/java/org/springframework/cloud/gateway/sample/GatewaySampleApplicationTests.java @@ -20,8 +20,8 @@ package org.springframework.cloud.gateway.sample; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.springframework.boot.context.embedded.LocalServerPort; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.web.server.LocalServerPort; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.test.context.junit4.SpringRunner;