@@ -256,6 +256,8 @@ public Events assertStatistics(Consumer<EventStatistics> statisticsConsumer) {
256
256
* </pre>
257
257
*
258
258
* @param conditions the conditions to match against; never {@code null}
259
+ * @see #assertEventsMatchLoosely(Condition...)
260
+ * @see #assertEventsMatchLooselyInOrder(Condition...)
259
261
* @see EventConditions
260
262
* @see TestExecutionResultConditions
261
263
*/
@@ -267,9 +269,10 @@ public final void assertEventsMatchExactly(Condition<? super Event>... condition
267
269
268
270
/**
269
271
* Assert that all provided conditions are matched by an {@linkplain Event event}
270
- * contained in this {@code Events} object regardless of order.
271
- * Note that this method does a partial match, i.e. some events may not match any
272
- * of the provided conditions.
272
+ * contained in this {@code Events} object, regardless of order.
273
+ *
274
+ * <p>Note that this method performs a partial match. Thus, some events may
275
+ * not match any of the provided conditions.
273
276
*
274
277
* <p>Conditions can be imported statically from {@link EventConditions}
275
278
* and {@link TestExecutionResultConditions}.
@@ -284,8 +287,11 @@ public final void assertEventsMatchExactly(Condition<? super Event>... condition
284
287
* </pre>
285
288
*
286
289
* @param conditions the conditions to match against; never {@code null}
290
+ * @see #assertEventsMatchExactly(Condition...)
291
+ * @see #assertEventsMatchLooselyInOrder(Condition...)
287
292
* @see EventConditions
288
293
* @see TestExecutionResultConditions
294
+ * @since 1.7
289
295
*/
290
296
@ SafeVarargs
291
297
@ SuppressWarnings ("varargs" )
@@ -298,9 +304,10 @@ public final void assertEventsMatchLoosely(Condition<? super Event>... condition
298
304
/**
299
305
* Assert that all provided conditions are matched by an {@linkplain Event event}
300
306
* contained in this {@code Events} object.
301
- * Note that this method does a partial match, i.e. some events may not match any
302
- * of the provided conditions.
303
- * However, the conditions provided must be in the correct order.
307
+ *
308
+ * <p>Note that this method performs a partial match. Thus, some events may
309
+ * not match any of the provided conditions; however, the conditions provided
310
+ * must be in the correct order.
304
311
*
305
312
* <p>Conditions can be imported statically from {@link EventConditions}
306
313
* and {@link TestExecutionResultConditions}.
@@ -315,8 +322,11 @@ public final void assertEventsMatchLoosely(Condition<? super Event>... condition
315
322
* </pre>
316
323
*
317
324
* @param conditions the conditions to match against; never {@code null}
325
+ * @see #assertEventsMatchExactly(Condition...)
326
+ * @see #assertEventsMatchLoosely(Condition...)
318
327
* @see EventConditions
319
328
* @see TestExecutionResultConditions
329
+ * @since 1.7
320
330
*/
321
331
@ SafeVarargs
322
332
@ SuppressWarnings ("varargs" )
@@ -441,9 +451,7 @@ private static boolean isNotInIncreasingOrder(List<Integer> indices) {
441
451
}
442
452
443
453
private static void checkCondition (List <Event > events , SoftAssertions softly , Condition <? super Event > condition ) {
444
- boolean matches = events .stream ().anyMatch (condition ::matches );
445
-
446
- if (!matches ) {
454
+ if (events .stream ().noneMatch (condition ::matches )) {
447
455
softly .fail ("Condition did not match any event: " + condition );
448
456
}
449
457
}
0 commit comments