@@ -203,20 +203,20 @@ void headerListContainsMismatch() {
203
203
204
204
assertThatExceptionOfType (AssertionError .class ).isThrownBy (() -> MockRestRequestMatchers
205
205
.header ("foo" , contains (containsString ("ba" ))).match (this .request ))
206
- .withMessage ("Request header values for [foo]\n "
207
- + "Expected: iterable containing [a string containing \" ba\" ]\n "
206
+ .withMessage ("Request header values for [foo]" + System . lineSeparator ()
207
+ + "Expected: iterable containing [a string containing \" ba\" ]" + System . lineSeparator ()
208
208
+ " but: not matched: \" baz\" " );
209
209
210
210
assertThatExceptionOfType (AssertionError .class ).isThrownBy (() -> MockRestRequestMatchers
211
211
.header ("foo" , hasItem (endsWith ("ba" ))).match (this .request ))
212
- .withMessage ("Request header values for [foo]\n "
213
- + "Expected: a collection containing a string ending with \" ba\" \n "
212
+ .withMessage ("Request header values for [foo]" + System . lineSeparator ()
213
+ + "Expected: a collection containing a string ending with \" ba\" " + System . lineSeparator ()
214
214
+ " but: mismatches were: [was \" bar\" , was \" baz\" ]" );
215
215
216
216
assertThatExceptionOfType (AssertionError .class ).isThrownBy (() -> MockRestRequestMatchers
217
217
.header ("foo" , everyItem (endsWith ("ar" ))).match (this .request ))
218
- .withMessage ("Request header values for [foo]\n "
219
- + "Expected: every item is a string ending with \" ar\" \n "
218
+ .withMessage ("Request header values for [foo]" + System . lineSeparator ()
219
+ + "Expected: every item is a string ending with \" ar\" " + System . lineSeparator ()
220
220
+ " but: an item was \" baz\" " );
221
221
}
222
222
@@ -325,20 +325,20 @@ void queryParamListContainsMismatch() {
325
325
326
326
assertThatExceptionOfType (AssertionError .class ).isThrownBy (() -> MockRestRequestMatchers
327
327
.queryParam ("foo" , contains (containsString ("ba" ))).match (this .request ))
328
- .withMessage ("Request queryParam values for [foo]\n "
329
- + "Expected: iterable containing [a string containing \" ba\" ]\n "
328
+ .withMessage ("Request queryParam values for [foo]" + System . lineSeparator ()
329
+ + "Expected: iterable containing [a string containing \" ba\" ]" + System . lineSeparator ()
330
330
+ " but: not matched: \" baz\" " );
331
331
332
332
assertThatExceptionOfType (AssertionError .class ).isThrownBy (() -> MockRestRequestMatchers
333
333
.queryParam ("foo" , hasItem (endsWith ("ba" ))).match (this .request ))
334
- .withMessage ("Request queryParam values for [foo]\n "
335
- + "Expected: a collection containing a string ending with \" ba\" \n "
334
+ .withMessage ("Request queryParam values for [foo]" + System . lineSeparator ()
335
+ + "Expected: a collection containing a string ending with \" ba\" " + System . lineSeparator ()
336
336
+ " but: mismatches were: [was \" bar\" , was \" baz\" ]" );
337
337
338
338
assertThatExceptionOfType (AssertionError .class ).isThrownBy (() -> MockRestRequestMatchers
339
339
.queryParam ("foo" , everyItem (endsWith ("ar" ))).match (this .request ))
340
- .withMessage ("Request queryParam values for [foo]\n "
341
- + "Expected: every item is a string ending with \" ar\" \n "
340
+ .withMessage ("Request queryParam values for [foo]" + System . lineSeparator ()
341
+ + "Expected: every item is a string ending with \" ar\" " + System . lineSeparator ()
342
342
+ " but: an item was \" baz\" " );
343
343
}
344
344
0 commit comments