|
|
@ -85,12 +85,8 @@ public class OAuth2WebSecurityConfigurationTests {
|
|
|
|
public void configurationRegistersAuthorizedClientServiceBean() {
|
|
|
|
public void configurationRegistersAuthorizedClientServiceBean() {
|
|
|
|
this.contextRunner.withUserConfiguration(ClientRepositoryConfiguration.class,
|
|
|
|
this.contextRunner.withUserConfiguration(ClientRepositoryConfiguration.class,
|
|
|
|
OAuth2WebSecurityConfiguration.class).run((context) -> {
|
|
|
|
OAuth2WebSecurityConfiguration.class).run((context) -> {
|
|
|
|
OAuth2AuthorizedClientService bean = context
|
|
|
|
assertThat(context)
|
|
|
|
.getBean(OAuth2AuthorizedClientService.class);
|
|
|
|
.hasSingleBean(OAuth2AuthorizedClientService.class);
|
|
|
|
OAuth2AuthorizedClientService authorizedClientService = (OAuth2AuthorizedClientService) ReflectionTestUtils
|
|
|
|
|
|
|
|
.getField(getAuthCodeFilters(context).get(0),
|
|
|
|
|
|
|
|
"authorizedClientService");
|
|
|
|
|
|
|
|
assertThat(authorizedClientService).isEqualTo(bean);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -110,12 +106,9 @@ public class OAuth2WebSecurityConfigurationTests {
|
|
|
|
.withUserConfiguration(OAuth2AuthorizedClientServiceConfiguration.class,
|
|
|
|
.withUserConfiguration(OAuth2AuthorizedClientServiceConfiguration.class,
|
|
|
|
OAuth2WebSecurityConfiguration.class)
|
|
|
|
OAuth2WebSecurityConfiguration.class)
|
|
|
|
.run((context) -> {
|
|
|
|
.run((context) -> {
|
|
|
|
OAuth2AuthorizedClientService bean = context
|
|
|
|
assertThat(context)
|
|
|
|
.getBean(OAuth2AuthorizedClientService.class);
|
|
|
|
.hasSingleBean(OAuth2AuthorizedClientService.class);
|
|
|
|
OAuth2AuthorizedClientService authorizedClientService = (OAuth2AuthorizedClientService) ReflectionTestUtils
|
|
|
|
assertThat(context).hasBean("testAuthorizedClientService");
|
|
|
|
.getField(getAuthCodeFilters(context).get(0),
|
|
|
|
|
|
|
|
"authorizedClientService");
|
|
|
|
|
|
|
|
assertThat(authorizedClientService).isEqualTo(bean);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|