File tree 1 file changed +6
-8
lines changed
src/test/java/org/neo4j/doc/domain/examples 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 20
20
21
21
package org .neo4j .doc .domain .examples ;
22
22
23
+ import com .fasterxml .jackson .databind .MapperFeature ;
23
24
import com .fasterxml .jackson .databind .ObjectMapper ;
25
+ import com .fasterxml .jackson .databind .json .JsonMapper ;
24
26
import com .fasterxml .jackson .databind .module .SimpleModule ;
25
27
import org .neo4j .doc .tools .NodeCypherSerializer ;
26
28
import org .neo4j .graphdb .Node ;
27
29
28
30
public class Mapper {
29
31
30
- public static ObjectMapper MAPPER = new ObjectMapper ();
31
-
32
- static {
33
- SimpleModule module = new SimpleModule ();
34
- module .addSerializer (Node .class , new NodeCypherSerializer ());
35
- MAPPER .registerModule (module );
36
- }
37
-
32
+ public static ObjectMapper MAPPER = JsonMapper .builder ()
33
+ .configure (MapperFeature .SORT_PROPERTIES_ALPHABETICALLY , true )
34
+ .addModule (new SimpleModule ().addSerializer (Node .class , new NodeCypherSerializer ()))
35
+ .build ();
38
36
}
You can’t perform that action at this time.
0 commit comments