File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
gitlfs-client/src/test/java/ru/bozaro/gitlfs/client
gitlfs-common/src/main/java/ru/bozaro/gitlfs/common Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,11 @@ public HttpReplay(@NotNull List<HttpRecord> records) {
28
28
public HttpResponse executeMethod (@ NotNull HttpUriRequest request ) throws IOException {
29
29
final HttpRecord record = records .pollFirst ();
30
30
Assert .assertNotNull (record );
31
- Assert .assertEquals (record .getRequest ().toString (), new HttpRecord .Request (request ).toString ());
31
+
32
+ final String expected = record .getRequest ().toString ();
33
+ final String actual = new HttpRecord .Request (request ).toString ();
34
+ Assert .assertEquals (actual , expected );
35
+
32
36
return record .getResponse ().toHttpResponse ();
33
37
}
34
38
Original file line number Diff line number Diff line change 2
2
3
3
import com .fasterxml .jackson .annotation .JsonInclude ;
4
4
import com .fasterxml .jackson .core .JsonProcessingException ;
5
+ import com .fasterxml .jackson .core .util .DefaultIndenter ;
6
+ import com .fasterxml .jackson .core .util .DefaultPrettyPrinter ;
5
7
import com .fasterxml .jackson .databind .ObjectMapper ;
6
8
import com .fasterxml .jackson .databind .SerializationFeature ;
7
9
import com .fasterxml .jackson .databind .util .StdDateFormat ;
8
10
import org .jetbrains .annotations .NotNull ;
9
11
12
+ import static com .fasterxml .jackson .core .util .DefaultPrettyPrinter .DEFAULT_ROOT_VALUE_SEPARATOR ;
13
+
10
14
/**
11
15
* Json utility class.
12
16
*
@@ -25,6 +29,12 @@ public static ObjectMapper createMapper() {
25
29
mapper .disable (SerializationFeature .WRITE_DATES_AS_TIMESTAMPS );
26
30
mapper .enable (SerializationFeature .INDENT_OUTPUT );
27
31
mapper .setDateFormat (new StdDateFormat ());
32
+
33
+ // By default, pretty printer uses system newline. Explicitly configure it to use \n
34
+ mapper .setDefaultPrettyPrinter (
35
+ new DefaultPrettyPrinter (DEFAULT_ROOT_VALUE_SEPARATOR )
36
+ .withObjectIndenter (new DefaultIndenter (" " , "\n " )));
37
+
28
38
mapper .setSerializationInclusion (JsonInclude .Include .NON_NULL );
29
39
return mapper ;
30
40
}
You can’t perform that action at this time.
0 commit comments