-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Ensure that Transfer-Encoding and Content-Length are not both set
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
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
40 changes: 40 additions & 0 deletions
40
...rc/test/java/org/jboss/resteasy/reactive/server/vertx/test/headers/ChunkedHeaderTest.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,40 @@ | ||
package org.jboss.resteasy.reactive.server.vertx.test.headers; | ||
|
||
import static io.restassured.RestAssured.*; | ||
import static org.hamcrest.CoreMatchers.is; | ||
import static org.hamcrest.CoreMatchers.nullValue; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.core.Response; | ||
|
||
import org.jboss.resteasy.reactive.server.vertx.test.framework.ResteasyReactiveUnitTest; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
public class ChunkedHeaderTest { | ||
|
||
@RegisterExtension | ||
static ResteasyReactiveUnitTest TEST = new ResteasyReactiveUnitTest() | ||
.withApplicationRoot((jar) -> jar.addClasses(TestResource.class)); | ||
|
||
@Test | ||
public void testReturnUni() { | ||
given() | ||
.get("/test/hello") | ||
.then() | ||
.statusCode(200) | ||
.headers("Transfer-Encoding", "chunked") | ||
.headers("Content-Length", is(nullValue())); | ||
} | ||
|
||
@Path("/test") | ||
public static class TestResource { | ||
|
||
@GET | ||
@Path("hello") | ||
public Response hello() { | ||
return Response.ok("hello").header("Transfer-Encoding", "chunked").build(); | ||
} | ||
} | ||
} |