Polish "Remove usages of BasicAuthorizationInterceptor"

Closes gh-14830
This commit is contained in:
Stephane Nicoll 2018-10-16 10:19:08 +02:00
parent 8b14754cda
commit 1e6851cf81
1 changed files with 10 additions and 0 deletions

View File

@ -330,6 +330,16 @@ public class RestTemplateBuilderTests {
assertThat(interceptor).extracting("password").containsExactly("boot");
}
@Test
@Deprecated
public void basicAuthorizationShouldApply() {
RestTemplate template = this.builder.basicAuthorization("spring", "boot").build();
ClientHttpRequestInterceptor interceptor = template.getInterceptors().get(0);
assertThat(interceptor).isInstanceOf(BasicAuthenticationInterceptor.class);
assertThat(interceptor).extracting("username").containsExactly("spring");
assertThat(interceptor).extracting("password").containsExactly("boot");
}
@Test
public void customizersWhenCustomizersAreNullShouldThrowException() {
assertThatIllegalArgumentException()