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() {
193193 encoder .endRecord ();
194194
195195 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 }" ) ));
198198 }
199199
200200 /*
@@ -206,4 +206,13 @@ private String fixQuotes(final String str) {
206206 return str .replace ('\'' , '"' );
207207 }
208208
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+
209218}
You can’t perform that action at this time.
0 commit comments