-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25353 from gastaldi/reactive-rest-client
Use encoded request path in rest-client-reactive
- Loading branch information
Showing
3 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...sts/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/RequestEncodingTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package io.quarkus.it.rest.client; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import javax.ws.rs.client.ClientBuilder; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import io.quarkus.test.common.http.TestHTTPResource; | ||
import io.quarkus.test.junit.QuarkusTest; | ||
|
||
@QuarkusTest | ||
public class RequestEncodingTest { | ||
|
||
private static final String ENCODED_PATH = "/with%20space"; | ||
private static final String DECODED_PATH = "/with space"; | ||
|
||
@TestHTTPResource("/") | ||
String root; | ||
|
||
@Test | ||
void testEncodedPath() throws Exception { | ||
var request = ClientBuilder.newClient().target(root + ENCODED_PATH).request(); | ||
try (var response = request.get()) { | ||
assertThat(response.getStatus()) | ||
.as("Unexpected HTTP status with message %s", response.readEntity(String.class)) | ||
.isEqualTo(200); | ||
} | ||
} | ||
|
||
@Test | ||
void testDecodedPath() throws Exception { | ||
var request = ClientBuilder.newClient().target(root + DECODED_PATH).request(); | ||
try (var response = request.get()) { | ||
assertThat(response.getStatus()) | ||
.as("Unexpected HTTP status with message %s", response.readEntity(String.class)) | ||
.isEqualTo(200); | ||
} | ||
} | ||
|
||
} |