|
|
|
@ -81,15 +81,6 @@ public class OAuth2WebSecurityConfigurationTests {
|
|
|
|
|
.run((context) -> assertThat(getAuthCodeFilters(context)).isEmpty());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void securityConfigurerBacksOffWhenOtherWebSecurityAdapterPresent()
|
|
|
|
|
throws Exception {
|
|
|
|
|
this.contextRunner
|
|
|
|
|
.withUserConfiguration(TestWebSecurityConfigurerConfig.class,
|
|
|
|
|
OAuth2WebSecurityConfiguration.class)
|
|
|
|
|
.run((context) -> assertThat(getAuthCodeFilters(context)).isEmpty());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void configurationRegistersAuthorizedClientServiceBean() throws Exception {
|
|
|
|
|
this.contextRunner.withUserConfiguration(ClientRepositoryConfiguration.class,
|
|
|
|
@ -103,6 +94,18 @@ public class OAuth2WebSecurityConfigurationTests {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void securityConfigurerBacksOffWhenOtherWebSecurityAdapterPresent()
|
|
|
|
|
throws Exception {
|
|
|
|
|
this.contextRunner
|
|
|
|
|
.withUserConfiguration(TestWebSecurityConfigurerConfig.class,
|
|
|
|
|
OAuth2WebSecurityConfiguration.class)
|
|
|
|
|
.run((context) -> {
|
|
|
|
|
assertThat(getAuthCodeFilters(context)).isEmpty();
|
|
|
|
|
assertThat(context).getBean(OAuth2AuthorizedClientService.class).isNotNull();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void authorizedClientServiceBeanIsConditionalOnMissingBean() throws Exception {
|
|
|
|
|
this.contextRunner
|
|
|
|
|