Skip to content

Commit 11105a5

Browse files
committed
UriComponentsBuilder.fromHttpUrl->fromUriString
The fromHttpUrl method is deprecated and replaced with fromUriString Closes gh-
1 parent 38a9aa1 commit 11105a5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

config/src/test/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurerTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public void saml2LoginWhenDefaultAndSamlAuthenticationManagerThenSamlManagerIsUs
253253
public void authenticationRequestWhenAuthenticationRequestResolverBeanThenUses() throws Exception {
254254
this.spring.register(CustomAuthenticationRequestResolverBean.class).autowire();
255255
MvcResult result = this.mvc.perform(get("/saml2/authenticate/registration-id")).andReturn();
256-
UriComponents components = UriComponentsBuilder.fromHttpUrl(result.getResponse().getRedirectedUrl()).build();
256+
UriComponents components = UriComponentsBuilder.fromUriString(result.getResponse().getRedirectedUrl()).build();
257257
String samlRequest = components.getQueryParams().getFirst("SAMLRequest");
258258
String decoded = URLDecoder.decode(samlRequest, "UTF-8");
259259
String inflated = Saml2Utils.samlInflate(Saml2Utils.samlDecode(decoded));
@@ -264,7 +264,7 @@ public void authenticationRequestWhenAuthenticationRequestResolverBeanThenUses()
264264
public void authenticationRequestWhenAuthenticationRequestResolverDslThenUses() throws Exception {
265265
this.spring.register(CustomAuthenticationRequestResolverDsl.class).autowire();
266266
MvcResult result = this.mvc.perform(get("/saml2/authenticate/registration-id")).andReturn();
267-
UriComponents components = UriComponentsBuilder.fromHttpUrl(result.getResponse().getRedirectedUrl()).build();
267+
UriComponents components = UriComponentsBuilder.fromUriString(result.getResponse().getRedirectedUrl()).build();
268268
String samlRequest = components.getQueryParams().getFirst("SAMLRequest");
269269
String decoded = URLDecoder.decode(samlRequest, "UTF-8");
270270
String inflated = Saml2Utils.samlInflate(Saml2Utils.samlDecode(decoded));

oauth2/oauth2-client/src/test/java/org/springframework/security/oauth2/client/web/OAuth2LoginAuthenticationFilterTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ private void setUpAuthorizationRequest(HttpServletRequest request, HttpServletRe
475475
}
476476

477477
private String expandRedirectUri(HttpServletRequest request, ClientRegistration clientRegistration) {
478-
String baseUrl = UriComponentsBuilder.fromHttpUrl(UrlUtils.buildFullRequestUrl(request))
478+
String baseUrl = UriComponentsBuilder.fromUriString(UrlUtils.buildFullRequestUrl(request))
479479
.replaceQuery(null)
480480
.replacePath(request.getContextPath())
481481
.build()

0 commit comments

Comments
 (0)