File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
metafacture-json/src/test/java/org/metafacture/json Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -193,8 +193,8 @@ public void testShouldNotPrefixPrettyPrintedOutputWithSpaces() {
193
193
encoder .endRecord ();
194
194
195
195
final InOrder ordered = inOrder (receiver );
196
- ordered .verify (receiver ).process (fixQuotes ("{\n 'L1' : 'V1'\n }" ));
197
- ordered .verify (receiver ).process (fixQuotes ("{\n 'L2' : 'V2'\n }" ));
196
+ ordered .verify (receiver ).process (useSystemSpecificLineSeparator ( fixQuotes ("{\n 'L1' : 'V1'\n }" ) ));
197
+ ordered .verify (receiver ).process (useSystemSpecificLineSeparator ( fixQuotes ("{\n 'L2' : 'V2'\n }" ) ));
198
198
}
199
199
200
200
/*
@@ -206,4 +206,13 @@ private String fixQuotes(final String str) {
206
206
return str .replace ('\'' , '"' );
207
207
}
208
208
209
+ /*
210
+ * Utility method which replaces the new-line character with the platform-specific
211
+ * line separator. This is necessary since Jackson uses different line separators
212
+ * depending on the system environment.
213
+ */
214
+ private String useSystemSpecificLineSeparator (final String str ) {
215
+ return str .replace ("\n " , System .lineSeparator ());
216
+ }
217
+
209
218
}
You can’t perform that action at this time.
0 commit comments