Skip to content

Commit

Permalink
Resteasy Reactive: Fix line separator for "x-ndjson" and "stream+json".
Browse files Browse the repository at this point in the history
We're wrongly using `/n` instead of `\n`.
This was done in quarkusio#20908
  • Loading branch information
Sgitario committed Mar 9, 2022
1 parent 07cc8d4 commit a619566
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ public void testNdJsonMultiFromMulti() {
when().get(uri.toString() + "sse/ndjson/multi")
.then().statusCode(HttpStatus.SC_OK)
// @formatter:off
.body(is("{\"name\":\"hello\"}/n"
+ "{\"name\":\"stef\"}/n"))
.body(is("{\"name\":\"hello\"}\n"
+ "{\"name\":\"stef\"}\n"))
// @formatter:on
.header(HttpHeaders.CONTENT_TYPE, containsString(RestMediaType.APPLICATION_NDJSON));
}
Expand All @@ -130,8 +130,8 @@ public void testStreamJsonMultiFromMulti() {
when().get(uri.toString() + "sse/stream-json/multi")
.then().statusCode(HttpStatus.SC_OK)
// @formatter:off
.body(is("{\"name\":\"hello\"}/n"
+ "{\"name\":\"stef\"}/n"))
.body(is("{\"name\":\"hello\"}\n"
+ "{\"name\":\"stef\"}\n"))
// @formatter:on
.header(HttpHeaders.CONTENT_TYPE, containsString(RestMediaType.APPLICATION_STREAM_JSON));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ public void testNdJsonMultiFromMulti() {
when().get(uri.toString() + "sse/ndjson/multi")
.then().statusCode(HttpStatus.SC_OK)
// @formatter:off
.body(is("{\"name\":\"hello\"}/n"
+ "{\"name\":\"stef\"}/n"))
.body(is("{\"name\":\"hello\"}\n"
+ "{\"name\":\"stef\"}\n"))
// @formatter:on
.header(HttpHeaders.CONTENT_TYPE, containsString(RestMediaType.APPLICATION_NDJSON));
}
Expand All @@ -128,8 +128,8 @@ public void testStreamJsonMultiFromMulti() {
when().get(uri.toString() + "sse/stream-json/multi")
.then().statusCode(HttpStatus.SC_OK)
// @formatter:off
.body(is("{\"name\":\"hello\"}/n"
+ "{\"name\":\"stef\"}/n"))
.body(is("{\"name\":\"hello\"}\n"
+ "{\"name\":\"stef\"}\n"))
// @formatter:on
.header(HttpHeaders.CONTENT_TYPE, containsString(RestMediaType.APPLICATION_STREAM_JSON));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void accept(Object v, Throwable t) {

private static class ChunkedStreamingMultiSubscriber extends StreamingMultiSubscriber {

private static final String LINE_SEPARATOR = "/n";
private static final String LINE_SEPARATOR = "\n";

private boolean isFirstItem = true;

Expand Down

0 comments on commit a619566

Please sign in to comment.