File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/main/java/com/endava/cats/util Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -77,8 +77,9 @@ public abstract class JsonUtils {
77
77
private static final Pattern JSON_SQUARE_BR_KEYS = Pattern .compile ("\\ w+(\\ [(?>[a-zA-Z0-9_*]*[a-zA-Z][a-zA-Z0-9_*]*)])+\\ w*" );
78
78
private static final Pattern EMPTY_SQUARE_BRACKETS = Pattern .compile ("\\ w+\\ []\\ w*" );
79
79
80
+
80
81
/**
81
- * To not be used to serialize data ending in console of files. Use the TestCaseExporter serializer for that.
82
+ * To not be used to serialize data ending in console or files. Use the TestCaseExporter serializer for that.
82
83
*/
83
84
public static final Gson GSON = new GsonBuilder ()
84
85
.setStrictness (Strictness .LENIENT )
@@ -90,6 +91,15 @@ public abstract class JsonUtils {
90
91
.serializeNulls ()
91
92
.create ();
92
93
94
+ public static final Gson GSON_NO_PRETTY_PRINTING = new GsonBuilder ()
95
+ .setStrictness (Strictness .LENIENT )
96
+ .disableHtmlEscaping ()
97
+ .setExclusionStrategies (new ExcludeTestCaseStrategy ())
98
+ .registerTypeAdapter (Long .class , new LongTypeSerializer ())
99
+ .registerTypeAdapter (OffsetDateTime .class , new OffsetDatetimeTypeAdapter ())
100
+ .serializeNulls ()
101
+ .create ();
102
+
93
103
public static final Configuration SUPPRESS_EXCEPTIONS_CONFIGURATION = new Configuration .ConfigurationBuilder ().options (Option .SUPPRESS_EXCEPTIONS ).build ();
94
104
95
105
public static final Configuration GSON_CONFIGURATION = Configuration .builder ().jsonProvider (new GsonJsonProvider (GSON )).mappingProvider (new GsonMappingProvider (GSON )).build ();
You can’t perform that action at this time.
0 commit comments