Browse Source

Polish

pull/8593/merge
Phillip Webb 9 years ago
parent
commit
34de119eba
  1. 2
      spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpointTests.java
  2. 14
      spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/HttpHandlerAutoConfiguration.java
  3. 4
      spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/ResourceServerTokenServicesConfigurationTests.java
  4. 13
      spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/HttpHandlerAutoConfigurationTests.java
  5. 2
      spring-boot-integration-tests/spring-boot-gradle-tests/src/test/java/org/springframework/boot/gradle/InstallTests.java
  6. 2
      spring-boot-integration-tests/spring-boot-gradle-tests/src/test/java/org/springframework/boot/gradle/ProjectCreator.java

2
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpointTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2012-2017 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.

14
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/HttpHandlerAutoConfiguration.java

@ -38,6 +38,7 @@ import org.springframework.web.reactive.DispatcherHandler; @@ -38,6 +38,7 @@ import org.springframework.web.reactive.DispatcherHandler;
import org.springframework.web.reactive.function.server.HandlerStrategies;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.RouterFunctions;
import org.springframework.web.reactive.function.server.ServerResponse;
import org.springframework.web.reactive.result.view.ViewResolver;
import org.springframework.web.server.WebFilter;
import org.springframework.web.server.WebHandler;
@ -85,16 +86,16 @@ public class HttpHandlerAutoConfiguration { @@ -85,16 +86,16 @@ public class HttpHandlerAutoConfiguration {
private final WebSessionManager webSessionManager;
private final List<HttpMessageReader> messageReaders;
private final List<HttpMessageReader<?>> messageReaders;
private final List<HttpMessageWriter> messageWriters;
private final List<HttpMessageWriter<?>> messageWriters;
private final List<ViewResolver> viewResolvers;
public FunctionalConfig(ObjectProvider<List<WebFilter>> webFilters,
ObjectProvider<WebSessionManager> webSessionManager,
ObjectProvider<List<HttpMessageReader>> messageReaders,
ObjectProvider<List<HttpMessageWriter>> messageWriters,
ObjectProvider<List<HttpMessageReader<?>>> messageReaders,
ObjectProvider<List<HttpMessageWriter<?>>> messageWriters,
ObjectProvider<List<ViewResolver>> viewResolvers) {
this.webFilters = webFilters.getIfAvailable();
if (this.webFilters != null) {
@ -107,9 +108,10 @@ public class HttpHandlerAutoConfiguration { @@ -107,9 +108,10 @@ public class HttpHandlerAutoConfiguration {
}
@Bean
public HttpHandler httpHandler(List<RouterFunction> routerFunctions) {
public <T extends ServerResponse> HttpHandler httpHandler(
List<RouterFunction<T>> routerFunctions) {
routerFunctions.sort(new AnnotationAwareOrderComparator());
RouterFunction routerFunction = routerFunctions.stream()
RouterFunction<T> routerFunction = routerFunctions.stream()
.reduce(RouterFunction::and).get();
HandlerStrategies.Builder strategiesBuilder = HandlerStrategies.builder();
if (this.messageReaders != null) {

4
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/ResourceServerTokenServicesConfigurationTests.java

@ -252,7 +252,7 @@ public class ResourceServerTokenServicesConfigurationTests { @@ -252,7 +252,7 @@ public class ResourceServerTokenServicesConfigurationTests {
EnvironmentTestUtils.addEnvironment(this.environment,
"security.oauth2.resource.jwt.key-uri=http://localhost:12345/banana");
this.context = new SpringApplicationBuilder(ResourceConfiguration.class)
.environment(this.environment).web(false).run();
.environment(this.environment).web(WebApplicationType.NONE).run();
assertThat(this.context.getBeansOfType(JwtAccessTokenConverter.class)).hasSize(1);
}
@ -262,7 +262,7 @@ public class ResourceServerTokenServicesConfigurationTests { @@ -262,7 +262,7 @@ public class ResourceServerTokenServicesConfigurationTests {
"security.oauth2.resource.jwt.key-uri=http://localhost:12345/banana");
this.context = new SpringApplicationBuilder(ResourceConfiguration.class,
JwtAccessTokenConverterRestTemplateCustomizerConfiguration.class)
.environment(this.environment).web(false).run();
.environment(this.environment).web(WebApplicationType.NONE).run();
JwtAccessTokenConverterRestTemplateCustomizer customizer = this.context
.getBean(JwtAccessTokenConverterRestTemplateCustomizer.class);
verify(customizer).customize(any(RestTemplate.class));

13
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/HttpHandlerAutoConfigurationTests.java

@ -31,6 +31,7 @@ import org.springframework.http.server.reactive.HttpHandler; @@ -31,6 +31,7 @@ import org.springframework.http.server.reactive.HttpHandler;
import org.springframework.web.reactive.function.server.RequestPredicates;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.RouterFunctions;
import org.springframework.web.reactive.function.server.ServerResponse;
import org.springframework.web.server.WebFilter;
import org.springframework.web.server.WebHandler;
import org.springframework.web.server.handler.FilteringWebHandler;
@ -149,9 +150,9 @@ public class HttpHandlerAutoConfigurationTests { @@ -149,9 +150,9 @@ public class HttpHandlerAutoConfigurationTests {
protected static class FunctionalConfig {
@Bean
public RouterFunction routerFunction() {
public RouterFunction<ServerResponse> routerFunction() {
return RouterFunctions.route(RequestPredicates.GET("/test"),
serverRequest -> null);
(serverRequest) -> null);
}
}
@ -160,9 +161,9 @@ public class HttpHandlerAutoConfigurationTests { @@ -160,9 +161,9 @@ public class HttpHandlerAutoConfigurationTests {
protected static class FunctionalConfigWithWebFilters {
@Bean
public RouterFunction routerFunction() {
public RouterFunction<ServerResponse> routerFunction() {
return RouterFunctions.route(RequestPredicates.GET("/test"),
serverRequest -> null);
(serverRequest) -> null);
}
@Bean
@ -181,9 +182,9 @@ public class HttpHandlerAutoConfigurationTests { @@ -181,9 +182,9 @@ public class HttpHandlerAutoConfigurationTests {
}
@Bean
public RouterFunction routerFunction() {
public RouterFunction<ServerResponse> routerFunction() {
return RouterFunctions.route(RequestPredicates.GET("/test"),
serverRequest -> null);
(serverRequest) -> null);
}
}

2
spring-boot-integration-tests/spring-boot-gradle-tests/src/test/java/org/springframework/boot/gradle/InstallTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2015 the original author or authors.
* Copyright 2012-2017 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.

2
spring-boot-integration-tests/spring-boot-gradle-tests/src/test/java/org/springframework/boot/gradle/ProjectCreator.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2012-2017 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.

Loading…
Cancel
Save