Polish "Order actuator security config after resource-server config"

Closes gh-15472
This commit is contained in:
Madhura Bhave
2019-01-02 13:53:24 -08:00
parent 4597e7cc82
commit 5b990605dc
2 changed files with 6 additions and 11 deletions

View File

@@ -120,17 +120,14 @@ public class ReactiveManagementWebSecurityAutoConfigurationTests {
}
@Test
public void backsOffIfReactiveOAuth2ResourceServerAutoConfigurationSecurityIsAdded() {
public void backOffIfReactiveOAuth2ResourceServerAutoConfigurationPresent() {
this.contextRunner
.withConfiguration(AutoConfigurations
.of(ReactiveOAuth2ResourceServerAutoConfiguration.class))
.withPropertyValues(
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://authserver")
.run((context) -> {
assertThat(context.getBeanNamesForType(
ReactiveManagementWebSecurityAutoConfiguration.class))
.isEmpty();
});
.run((context) -> assertThat(context).doesNotHaveBean(
ReactiveManagementWebSecurityAutoConfiguration.class));
}
@Test

View File

@@ -108,16 +108,14 @@ public class ManagementWebSecurityAutoConfigurationTests {
}
@Test
public void backOffIfOAuth2ResourceServerAutoConfigurationSecurityIsAdded() {
public void backOffIfOAuth2ResourceServerAutoConfigurationPresent() {
this.contextRunner
.withConfiguration(AutoConfigurations
.of(OAuth2ResourceServerAutoConfiguration.class))
.withPropertyValues(
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://authserver")
.run((context) -> {
assertThat(context.getBeanNamesForType(
ManagementWebSecurityConfigurerAdapter.class)).isEmpty();
});
.run((context) -> assertThat(context)
.doesNotHaveBean(ManagementWebSecurityConfigurerAdapter.class));
}
private HttpStatus getResponseStatus(AssertableWebApplicationContext context,