Polish
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
<!-- Provided -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
<artifactId>spring-boot-actuator</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -54,8 +54,7 @@ public class InfoEndpoint extends AbstractEndpoint<Map<String, Object>> {
|
||||
* Constructor provided for backward compatibility.
|
||||
* @param info a map (which is added to the info)
|
||||
* @param infoContributors the info contributors to use
|
||||
*
|
||||
* @deprecated in favour of the constructor without the map
|
||||
* @deprecated as of 1.4 in favor of the constructor without the map
|
||||
*/
|
||||
@Deprecated
|
||||
public InfoEndpoint(Map<String, Object> info, InfoContributor... infoContributors) {
|
||||
|
||||
@@ -31,6 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
@Deprecated
|
||||
public class InfoEndpointCompatibilityTests {
|
||||
|
||||
@Test
|
||||
@@ -55,4 +56,5 @@ public class InfoEndpointCompatibilityTests {
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,4 +35,5 @@ public interface Jackson2ObjectMapperBuilderCustomizer {
|
||||
* @param jacksonObjectMapperBuilder the jacksonObjectMapperBuilder to customize
|
||||
*/
|
||||
void customize(Jackson2ObjectMapperBuilder jacksonObjectMapperBuilder);
|
||||
|
||||
}
|
||||
|
||||
@@ -37,6 +37,11 @@ import org.springframework.security.web.util.matcher.RequestHeaderRequestMatcher
|
||||
import org.springframework.web.accept.ContentNegotiationStrategy;
|
||||
import org.springframework.web.accept.HeaderContentNegotiationStrategy;
|
||||
|
||||
/**
|
||||
* Configurer for OAuth2 Single Sign On (SSO).
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
class SsoSecurityConfigurer {
|
||||
|
||||
private ApplicationContext applicationContext;
|
||||
@@ -46,7 +51,8 @@ class SsoSecurityConfigurer {
|
||||
}
|
||||
|
||||
public void configure(HttpSecurity http) throws Exception {
|
||||
OAuth2SsoProperties sso = this.applicationContext.getBean(OAuth2SsoProperties.class);
|
||||
OAuth2SsoProperties sso = this.applicationContext
|
||||
.getBean(OAuth2SsoProperties.class);
|
||||
// Delay the processing of the filter until we know the
|
||||
// SessionAuthenticationStrategy is available:
|
||||
http.apply(new OAuth2ClientAuthenticationConfigurer(oauth2SsoFilter(sso)));
|
||||
|
||||
@@ -36,8 +36,8 @@ import org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfigurat
|
||||
import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration;
|
||||
import org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext;
|
||||
import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory;
|
||||
import org.springframework.boot.test.EnvironmentTestUtils;
|
||||
import org.springframework.boot.test.TestRestTemplate;
|
||||
import org.springframework.boot.test.util.EnvironmentTestUtils;
|
||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
@@ -159,7 +159,6 @@ public class SessionAutoConfigurationTests extends AbstractSessionAutoConfigurat
|
||||
.isEqualTo("foobar");
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
static class SessionRepositoryConfiguration {
|
||||
|
||||
|
||||
@@ -162,8 +162,8 @@ public class DispatcherServletAutoConfigurationTests {
|
||||
.containsExactly(true);
|
||||
assertThat(bean).extracting("dispatchOptionsRequest").containsExactly(true);
|
||||
assertThat(bean).extracting("dispatchTraceRequest").containsExactly(true);
|
||||
assertThat(
|
||||
new DirectFieldAccessor(this.context.getBean("dispatcherServletRegistration"))
|
||||
assertThat(new DirectFieldAccessor(
|
||||
this.context.getBean("dispatcherServletRegistration"))
|
||||
.getPropertyValue("loadOnStartup")).isEqualTo(5);
|
||||
}
|
||||
|
||||
|
||||
@@ -335,7 +335,6 @@
|
||||
<version>1.4.0.BUILD-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<!-- TODO: remove in 2.0 -->
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-redis</artifactId>
|
||||
<version>1.4.0.BUILD-SNAPSHOT</version>
|
||||
|
||||
@@ -8,9 +8,8 @@
|
||||
</parent>
|
||||
<artifactId>spring-boot-starter-redis</artifactId>
|
||||
<name>spring-boot-starter-redis (DEPRECATED)</name>
|
||||
<description>DEPRECATED (use spring-boot-starter-data-redis instead).
|
||||
Starter for using Redis key-value data store with Spring Data Redis and
|
||||
the Jedis client</description>
|
||||
<description>Starter for using Redis key-value data store with Spring Data Redis and
|
||||
the Jedis client. Deprecated as of 1.4 in favor of spring-boot-starter-data-redis</description>
|
||||
<url>http://projects.spring.io/spring-boot/</url>
|
||||
<organization>
|
||||
<name>Pivotal Software, Inc.</name>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright 2012-2016 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.starter.redis;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* {@link EnableAutoConfiguration Auto-configuration} to print a deprecation warning about
|
||||
* the starter.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @since 1.4.0
|
||||
*/
|
||||
@Configuration
|
||||
@Deprecated
|
||||
public class RedisStarterDepricationWarningAutoConfiguration {
|
||||
|
||||
private static final Log logger = LogFactory
|
||||
.getLog(RedisStarterDepricationWarningAutoConfiguration.class);
|
||||
|
||||
@PostConstruct
|
||||
public void logWarning() {
|
||||
logger.warn("spring-boot-starter-redis is deprecated as of Spring Boot 1.4, "
|
||||
+ "please migrate to spring-boot-starter-data-redis");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
# Auto Configure
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
org.springframework.boot.starter.redis.RedisStarterDepricationWarningAutoConfiguration
|
||||
@@ -19,51 +19,46 @@ package org.springframework.boot.test;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
/**
|
||||
* Convenient subclass of {@link RestTemplate} that is suitable for integration
|
||||
* tests. They are fault tolerant, and optionally can carry Basic authentication
|
||||
* headers. If Apache Http Client 4.3.2 or better is available (recommended) it
|
||||
* will be used as the client, and by default configured to ignore cookies and
|
||||
* redirects.
|
||||
* Convenient subclass of {@link RestTemplate} that is suitable for integration tests.
|
||||
* They are fault tolerant, and optionally can carry Basic authentication headers. If
|
||||
* Apache Http Client 4.3.2 or better is available (recommended) it will be used as the
|
||||
* client, and by default configured to ignore cookies and redirects.
|
||||
*
|
||||
* @author Dave Syer
|
||||
* @author Phillip Webb
|
||||
* @deprecated as of 1.4 in favor of
|
||||
* {@link org.springframework.boot.test.web.client.TestRestTemplate}
|
||||
* {@link org.springframework.boot.test.web.client.TestRestTemplate}
|
||||
*/
|
||||
@Deprecated
|
||||
public class TestRestTemplate extends org.springframework.boot.test.web.client.TestRestTemplate {
|
||||
public class TestRestTemplate
|
||||
extends org.springframework.boot.test.web.client.TestRestTemplate {
|
||||
|
||||
/**
|
||||
* Create a new {@link TestRestTemplate} instance.
|
||||
*
|
||||
* @param httpClientOptions
|
||||
* client options to use if the Apache HTTP Client is used
|
||||
* @param httpClientOptions client options to use if the Apache HTTP Client is used
|
||||
*/
|
||||
public TestRestTemplate(HttpClientOption... httpClientOptions) {
|
||||
super(options(httpClientOptions));
|
||||
super(convertOptions(httpClientOptions));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new {@link TestRestTemplate} instance with the specified
|
||||
* credentials.
|
||||
*
|
||||
* @param username
|
||||
* the username to use (or {@code null})
|
||||
* @param password
|
||||
* the password (or {@code null})
|
||||
* @param httpClientOptions
|
||||
* client options to use if the Apache HTTP Client is used
|
||||
* Create a new {@link TestRestTemplate} instance with the specified credentials.
|
||||
* @param username the username to use (or {@code null})
|
||||
* @param password the password (or {@code null})
|
||||
* @param httpClientOptions client options to use if the Apache HTTP Client is used
|
||||
*/
|
||||
public TestRestTemplate(String username, String password, HttpClientOption... httpClientOptions) {
|
||||
super(username, password, options(httpClientOptions));
|
||||
public TestRestTemplate(String username, String password,
|
||||
HttpClientOption... httpClientOptions) {
|
||||
super(username, password, convertOptions(httpClientOptions));
|
||||
}
|
||||
|
||||
private static org.springframework.boot.test.web.client.TestRestTemplate.HttpClientOption[] options(
|
||||
HttpClientOption[] httpClientOptions) {
|
||||
org.springframework.boot.test.web.client.TestRestTemplate.HttpClientOption[] result = new org.springframework.boot.test.web.client.TestRestTemplate.HttpClientOption[httpClientOptions.length];
|
||||
for (int i = 0; i < httpClientOptions.length; i++) {
|
||||
HttpClientOption httpClientOption = httpClientOptions[i];
|
||||
result[i] = org.springframework.boot.test.web.client.TestRestTemplate.HttpClientOption.valueOf(httpClientOption.name());
|
||||
private static org.springframework.boot.test.web.client.TestRestTemplate.HttpClientOption[] convertOptions(
|
||||
HttpClientOption[] options) {
|
||||
org.springframework.boot.test.web.client.TestRestTemplate.HttpClientOption[] result = new org.springframework.boot.test.web.client.TestRestTemplate.HttpClientOption[options.length];
|
||||
for (int i = 0; i < options.length; i++) {
|
||||
HttpClientOption option = options[i];
|
||||
result[i] = org.springframework.boot.test.web.client.TestRestTemplate.HttpClientOption
|
||||
.valueOf(option.name());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -20,11 +20,18 @@ import org.junit.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Tests for the deprecated {@link TestRestTemplate}.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
@Deprecated
|
||||
public class TestRestTemplateTests {
|
||||
|
||||
@Test
|
||||
public void canCreateTemplateFromOwnOptions() {
|
||||
TestRestTemplate template = new TestRestTemplate(TestRestTemplate.HttpClientOption.ENABLE_REDIRECTS);
|
||||
TestRestTemplate template = new TestRestTemplate(
|
||||
TestRestTemplate.HttpClientOption.ENABLE_REDIRECTS);
|
||||
assertThat(template).isNotNull();
|
||||
}
|
||||
|
||||
|
||||
@@ -1065,7 +1065,6 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private class TestGzipInputStreamFactory implements InputStreamFactory {
|
||||
|
||||
private final AtomicBoolean requested = new AtomicBoolean(false);
|
||||
|
||||
Reference in New Issue
Block a user