This commit is contained in:
Phillip Webb 2018-01-30 12:31:49 -08:00 committed by Stephane Nicoll
parent f86b44f2ec
commit af8e155c6d
8 changed files with 25 additions and 28 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -78,8 +78,7 @@ public class OAuth2RestOperationsConfigurationTests {
EnvironmentTestUtils.addEnvironment(this.environment, EnvironmentTestUtils.addEnvironment(this.environment,
"security.oauth2.client.client-id=acme"); "security.oauth2.client.client-id=acme");
initializeContext(ConfigForRequestScopedConfiguration.class, false); initializeContext(ConfigForRequestScopedConfiguration.class, false);
assertThat(this.context.containsBean("oauth2ClientContext")) assertThat(this.context.containsBean("oauth2ClientContext")).isTrue();
.isTrue();
} }
@Test @Test
@ -95,8 +94,7 @@ public class OAuth2RestOperationsConfigurationTests {
EnvironmentTestUtils.addEnvironment(this.environment, EnvironmentTestUtils.addEnvironment(this.environment,
"security.oauth2.client.client-id=acme"); "security.oauth2.client.client-id=acme");
initializeContext(ConfigForSessionScopedConfiguration.class, false); initializeContext(ConfigForSessionScopedConfiguration.class, false);
assertThat(this.context.containsBean("oauth2ClientContext")) assertThat(this.context.containsBean("oauth2ClientContext")).isTrue();
.isTrue();
} }
@Test @Test
@ -109,8 +107,7 @@ public class OAuth2RestOperationsConfigurationTests {
private void initializeContext(Class<?> configuration, boolean isClientCredentials) { private void initializeContext(Class<?> configuration, boolean isClientCredentials) {
this.context = new SpringApplicationBuilder(configuration) this.context = new SpringApplicationBuilder(configuration)
.environment(this.environment) .environment(this.environment).web(!isClientCredentials).run();
.web(!isClientCredentials).run();
} }
@Configuration @Configuration
@ -126,7 +123,8 @@ public class OAuth2RestOperationsConfigurationTests {
@Configuration @Configuration
@Import({ OAuth2ClientConfiguration.class, OAuth2RestOperationsConfiguration.class }) @Import({ OAuth2ClientConfiguration.class, OAuth2RestOperationsConfiguration.class })
protected static class ConfigForSessionScopedConfiguration extends WebApplicationConfiguration { protected static class ConfigForSessionScopedConfiguration
extends WebApplicationConfiguration {
@Bean @Bean
public SecurityProperties securityProperties() { public SecurityProperties securityProperties() {
@ -136,7 +134,8 @@ public class OAuth2RestOperationsConfigurationTests {
} }
@Configuration @Configuration
protected static class ConfigForRequestScopedConfiguration extends WebApplicationConfiguration { protected static class ConfigForRequestScopedConfiguration
extends WebApplicationConfiguration {
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -191,7 +191,6 @@ class TypeUtils {
if (type.getTypeArguments().isEmpty()) { if (type.getTypeArguments().isEmpty()) {
return qualifiedName; return qualifiedName;
} }
else {
StringBuilder name = new StringBuilder(); StringBuilder name = new StringBuilder();
name.append(qualifiedName); name.append(qualifiedName);
if (!type.getTypeArguments().isEmpty()) { if (!type.getTypeArguments().isEmpty()) {
@ -199,7 +198,6 @@ class TypeUtils {
} }
return name.toString(); return name.toString();
} }
}
private void appendTypeArguments(DeclaredType type, StringBuilder name) { private void appendTypeArguments(DeclaredType type, StringBuilder name) {
name.append("<"); name.append("<");

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -123,8 +123,7 @@ public enum DatabaseDriver {
* Firebird. * Firebird.
*/ */
FIREBIRD("Firebird", "org.firebirdsql.jdbc.FBDriver", FIREBIRD("Firebird", "org.firebirdsql.jdbc.FBDriver",
"org.firebirdsql.ds.FBXADataSource", "org.firebirdsql.ds.FBXADataSource", "SELECT 1 FROM RDB$DATABASE") {
"SELECT 1 FROM RDB$DATABASE") {
@Override @Override
protected Collection<String> getUrlPrefixes() { protected Collection<String> getUrlPrefixes() {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2016 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -337,8 +337,9 @@ public class RestTemplateBuilder {
/** /**
* Set the {@link ClientHttpRequestFactory} that should be used with the * Set the {@link ClientHttpRequestFactory} that should be used with the
* {@link RestTemplate}. * {@link RestTemplate}.
* <p>Note that this request factory will be shared with all builder instances * <p>
* derived from that point. * Note that this request factory will be shared with all builder instances derived
* from that point.
* @param requestFactory the request factory to use * @param requestFactory the request factory to use
* @return a new builder instance * @return a new builder instance
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.