Commit 5b990605 authored by Madhura Bhave's avatar Madhura Bhave

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

Closes gh-15472
parent 4597e7cc
...@@ -120,17 +120,14 @@ public class ReactiveManagementWebSecurityAutoConfigurationTests { ...@@ -120,17 +120,14 @@ public class ReactiveManagementWebSecurityAutoConfigurationTests {
} }
@Test @Test
public void backsOffIfReactiveOAuth2ResourceServerAutoConfigurationSecurityIsAdded() { public void backOffIfReactiveOAuth2ResourceServerAutoConfigurationPresent() {
this.contextRunner this.contextRunner
.withConfiguration(AutoConfigurations .withConfiguration(AutoConfigurations
.of(ReactiveOAuth2ResourceServerAutoConfiguration.class)) .of(ReactiveOAuth2ResourceServerAutoConfiguration.class))
.withPropertyValues( .withPropertyValues(
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://authserver") "spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://authserver")
.run((context) -> { .run((context) -> assertThat(context).doesNotHaveBean(
assertThat(context.getBeanNamesForType( ReactiveManagementWebSecurityAutoConfiguration.class));
ReactiveManagementWebSecurityAutoConfiguration.class))
.isEmpty();
});
} }
@Test @Test
......
...@@ -108,16 +108,14 @@ public class ManagementWebSecurityAutoConfigurationTests { ...@@ -108,16 +108,14 @@ public class ManagementWebSecurityAutoConfigurationTests {
} }
@Test @Test
public void backOffIfOAuth2ResourceServerAutoConfigurationSecurityIsAdded() { public void backOffIfOAuth2ResourceServerAutoConfigurationPresent() {
this.contextRunner this.contextRunner
.withConfiguration(AutoConfigurations .withConfiguration(AutoConfigurations
.of(OAuth2ResourceServerAutoConfiguration.class)) .of(OAuth2ResourceServerAutoConfiguration.class))
.withPropertyValues( .withPropertyValues(
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://authserver") "spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://authserver")
.run((context) -> { .run((context) -> assertThat(context)
assertThat(context.getBeanNamesForType( .doesNotHaveBean(ManagementWebSecurityConfigurerAdapter.class));
ManagementWebSecurityConfigurerAdapter.class)).isEmpty();
});
} }
private HttpStatus getResponseStatus(AssertableWebApplicationContext context, private HttpStatus getResponseStatus(AssertableWebApplicationContext context,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment