Polishing contribution

Closes gh-33638
This commit is contained in:
rstoyanchev
2024-10-08 07:05:16 +01:00
parent a78385f8e5
commit a84a41fa43
3 changed files with 10 additions and 6 deletions

View File

@@ -29,6 +29,8 @@ import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
/**
* Unit tests for {@link ReactorUriHelper}.
*
* @author Arjen Poutsma
*/
class ReactorUriHelperTests {
@@ -58,14 +60,14 @@ class ReactorUriHelperTests {
" | /",
"'' | /",
})
void forwardedPrefix(String prefixHeader, String expectedPath) throws URISyntaxException {
void forwardedPrefix(String forwardedPrefixHeader, String expectedPath) throws URISyntaxException {
HttpServerRequest nettyRequest = mock();
given(nettyRequest.scheme()).willReturn("https");
given(nettyRequest.hostName()).willReturn("localhost");
given(nettyRequest.hostPort()).willReturn(443);
given(nettyRequest.uri()).willReturn("/");
given(nettyRequest.forwardedPrefix()).willReturn(prefixHeader);
given(nettyRequest.forwardedPrefix()).willReturn(forwardedPrefixHeader);
URI uri = ReactorUriHelper.createUri(nettyRequest);
assertThat(uri).hasScheme("https")
@@ -75,5 +77,4 @@ class ReactorUriHelperTests {
.hasToString("https://localhost" + expectedPath);
}
}