Skip to content

Commit 1e6851c

Browse files
committed
Polish "Remove usages of BasicAuthorizationInterceptor"
Closes gh-14830
1 parent 8b14754 commit 1e6851c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,16 @@ public void basicAuthenticationShouldApply() {
330330
assertThat(interceptor).extracting("password").containsExactly("boot");
331331
}
332332

333+
@Test
334+
@Deprecated
335+
public void basicAuthorizationShouldApply() {
336+
RestTemplate template = this.builder.basicAuthorization("spring", "boot").build();
337+
ClientHttpRequestInterceptor interceptor = template.getInterceptors().get(0);
338+
assertThat(interceptor).isInstanceOf(BasicAuthenticationInterceptor.class);
339+
assertThat(interceptor).extracting("username").containsExactly("spring");
340+
assertThat(interceptor).extracting("password").containsExactly("boot");
341+
}
342+
333343
@Test
334344
public void customizersWhenCustomizersAreNullShouldThrowException() {
335345
assertThatIllegalArgumentException()

0 commit comments

Comments
 (0)