Skip to content

Commit

Permalink
use system line separator (#925)
Browse files Browse the repository at this point in the history
* use system line separator

* uses stream join
  • Loading branch information
nhomble authored Jan 11, 2021
1 parent 4ed9e25 commit a6babcf
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@
import org.junit.jupiter.api.Test;
import org.zalando.logbook.BodyFilter;

import java.util.stream.Collectors;
import java.util.stream.Stream;

import static org.assertj.core.api.Assertions.assertThat;

class PrettyPrintingJsonBodyFilterTest {

private final BodyFilter unit = new PrettyPrintingJsonBodyFilter();

/*language=JSON*/
private final String pretty = "{\n" +
" \"root\" : {\n" +
" \"child\" : \"text\"\n" +
" }\n" +
"}";
private final String pretty = Stream.of(
"{",
" \"root\" : {",
" \"child\" : \"text\"",
" }",
"}"
).collect(Collectors.joining(System.lineSeparator()));

/*language=JSON*/
private final String compacted = "{\"root\":{\"child\":\"text\"}}";
Expand Down

0 comments on commit a6babcf

Please sign in to comment.