Skip to content

Commit

Permalink
Fix Test
Browse files Browse the repository at this point in the history
Issue gh-14553
  • Loading branch information
jzheaux committed Mar 22, 2024
1 parent afcce0c commit e18ec48
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class OidcBackChannelLogoutHandlerTests {
public void computeLogoutEndpointWhenDifferentHostnameThenLocalhost() {
OidcBackChannelLogoutHandler logoutHandler = new OidcBackChannelLogoutHandler();
MockHttpServletRequest request = new MockHttpServletRequest("GET", "/back-channel/logout");
request.setRemoteHost("host.docker.internal");
request.setServerName("host.docker.internal");
request.setServerPort(8090);
String endpoint = logoutHandler.computeLogoutEndpoint(request);
assertThat(endpoint).isEqualTo("http://localhost:8090/logout");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@
package org.springframework.security.config.web.server;

import org.junit.jupiter.api.Test;
import reactor.core.publisher.Mono;

import org.springframework.mock.http.server.reactive.MockServerHttpRequest;
import org.springframework.mock.web.server.MockServerWebExchange;
import org.springframework.security.web.server.WebFilterExchange;
import org.springframework.web.server.ServerWebExchange;

import static org.assertj.core.api.Assertions.assertThat;

Expand All @@ -38,8 +34,7 @@ public void computeLogoutEndpointWhenDifferentHostnameThenLocalhost() {
MockServerHttpRequest request = MockServerHttpRequest
.get("https://host.docker.internal:8090/back-channel/logout")
.build();
ServerWebExchange exchange = new MockServerWebExchange.Builder(request).build();
String endpoint = logoutHandler.computeLogoutEndpoint(new WebFilterExchange(exchange, (ex) -> Mono.empty()));
String endpoint = logoutHandler.computeLogoutEndpoint(request);
assertThat(endpoint).isEqualTo("https://localhost:8090/logout");
}

Expand Down

0 comments on commit e18ec48

Please sign in to comment.