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