Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compression test failures as media types compressed by defaults has changed #2057

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,16 @@ public Uni<String> smallCompressionCustomType() {
@GET
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/small/default_no_compression_json")
public Uni<String> defaultNoCompressionJson() {
@Path("/small/default_compression_json")
public Uni<String> defaultCompressionJson() {
return defaultSmallResponse();
}

@GET
@Consumes(MediaType.APPLICATION_XHTML_XML)
@Produces(MediaType.APPLICATION_XHTML_XML)
@Path("/small/default_compression_xhtml_xml")
public Uni<String> defaultCompressionXhtmlXml() {
return defaultSmallResponse();
}

Expand All @@ -103,8 +111,8 @@ public Uni<String> defaultNoCompressionFormData() {
}

@GET
@Consumes({ MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN })
@Produces({ MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN })
@Consumes({ MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
@Produces({ MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
@Path("/small/mixing_types")
public Uni<String> mixingContentTypes() {
return defaultSmallResponse();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ public class CompressionHandlerIT {
BASE_PATH + "/default_compression_text_plain", MediaType.TEXT_PLAIN,
BASE_PATH + "/default_compression_text_html", MediaType.TEXT_HTML,
BASE_PATH + "/default_compression_text_xml", MediaType.TEXT_XML,
BASE_PATH + "/default_compression_json", MediaType.APPLICATION_JSON,
BASE_PATH + "/default_compression_xhtml_xml", MediaType.APPLICATION_XHTML_XML,
BASE_PATH + "/default_compression_text_css", "text/css",
BASE_PATH + "/default_compression_text_js", "text/javascript",
BASE_PATH + "/default_compression_app_js", "application/javascript");

private static final Map<String, String> DEFAULT_SMALL_NO_GZIP_ENDPOINTS = Map.of(
BASE_PATH + "/default_no_compression_json", MediaType.APPLICATION_JSON,
BASE_PATH + "/default_no_compression_xml", MediaType.APPLICATION_XML,
BASE_PATH + "/default_no_compression_form_data", MediaType.MULTIPART_FORM_DATA);

Expand Down Expand Up @@ -64,7 +65,7 @@ public void forceNoCompression() {

@Test
public void mixingTypes() {
assertUnCompressed(BASE_PATH + "/mixing_types", MediaType.APPLICATION_JSON);
assertUnCompressed(BASE_PATH + "/mixing_types", MediaType.APPLICATION_XML);
assertUnCompressed(BASE_PATH + "/mixing_types", MediaType.TEXT_PLAIN);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,15 @@ public void smallCompressionCustomType(RoutingContext rc) {
defaultSmallResponse(rc);
}

@Route(path = "/default_no_compression_json", consumes = { MediaType.APPLICATION_JSON }, produces = {
@Route(path = "/default_compression_json", consumes = { MediaType.APPLICATION_JSON }, produces = {
MediaType.APPLICATION_JSON })
public void defaultNoCompressionJson(RoutingContext rc) {
public void defaultCompressionJson(RoutingContext rc) {
defaultSmallResponse(rc);
}

@Route(path = "/default_compression_xhtml_xml", consumes = { MediaType.APPLICATION_XHTML_XML }, produces = {
MediaType.APPLICATION_XHTML_XML })
public void defaultCompressionXhtmlXml(RoutingContext rc) {
defaultSmallResponse(rc);
}

Expand All @@ -74,8 +80,8 @@ public void defaultNoCompressionFormData(RoutingContext rc) {
defaultSmallResponse(rc);
}

@Route(path = "/mixing_types", consumes = { MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN }, produces = {
MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN })
@Route(path = "/mixing_types", consumes = { MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN }, produces = {
MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
public void mixingContentTypes(RoutingContext rc) {
defaultSmallResponse(rc);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ public class CompressionHandlerIT {
BASE_PATH + "/default_compression_text_plain", MediaType.TEXT_PLAIN,
BASE_PATH + "/default_compression_text_html", MediaType.TEXT_HTML,
BASE_PATH + "/default_compression_text_xml", MediaType.TEXT_XML,
BASE_PATH + "/default_compression_json", MediaType.APPLICATION_JSON,
BASE_PATH + "/default_compression_xhtml_xml", MediaType.APPLICATION_XHTML_XML,
BASE_PATH + "/default_compression_text_css", "text/css",
BASE_PATH + "/default_compression_text_js", "text/javascript",
BASE_PATH + "/default_compression_app_js", "application/javascript");

private static final Map<String, String> DEFAULT_SMALL_NO_GZIP_ENDPOINTS = Map.of(
BASE_PATH + "/default_no_compression_json", MediaType.APPLICATION_JSON,
BASE_PATH + "/default_no_compression_xml", MediaType.APPLICATION_XML,
BASE_PATH + "/default_no_compression_form_data", MediaType.MULTIPART_FORM_DATA);

Expand Down Expand Up @@ -77,7 +78,7 @@ public void forceNoCompression() {

@Test
public void mixingTypes() {
assertUnCompressed(BASE_PATH + "/mixing_types", MediaType.APPLICATION_JSON);
assertUnCompressed(BASE_PATH + "/mixing_types", MediaType.APPLICATION_XML);
assertUnCompressed(BASE_PATH + "/mixing_types", MediaType.TEXT_PLAIN);
}

Expand Down