@Test @DisplayName("not allow null events to pass") void notAllowNullEvents() { MatchFilter filter = new MatchFilter(EventFilter.getDefaultInstance()); assertFalse(filter.test(null)); }
@Override public boolean test(@Nullable Event event) { if (event == null) { return false; } EventMessage eventMessage = event.enclosedMessage(); EventContext context = event.context(); if (!checkEventType(eventMessage)) { return false; } if (!checkAggregateIds(context)) { return false; } if (!check(eventMessage, eventFieldFilters)) { return false; } boolean result = check(context, contextFieldFilters); return result; }
MatchFilter implements Predicate<Event> { @Override public boolean test(@Nullable Event event) { if (event == null) { return false; } EventMessage eventMessage = event.enclosedMessage(); EventContext context = event.context(); if (!checkEventType(eventMessage)) { return false; } if (!checkAggregateIds(context)) { return false; } if (!check(eventMessage, eventFieldFilters)) { return false; } boolean result = check(context, contextFieldFilters); return result; } }
MatchFilter implements Predicate<Event> { @Override public boolean test(@Nullable Event event) { if (event == null) { return false; } EventMessage eventMessage = event.enclosedMessage(); EventContext context = event.context(); if (!checkEventType(eventMessage)) { return false; } if (!checkAggregateIds(context)) { return false; } if (!check(eventMessage, eventFieldFilters)) { return false; } boolean result = check(context, contextFieldFilters); return result; } MatchFilter(EventFilter filter); }
MatchFilter implements Predicate<Event> { @Override public boolean test(@Nullable Event event) { if (event == null) { return false; } EventMessage eventMessage = event.enclosedMessage(); EventContext context = event.context(); if (!checkEventType(eventMessage)) { return false; } if (!checkAggregateIds(context)) { return false; } if (!check(eventMessage, eventFieldFilters)) { return false; } boolean result = check(context, contextFieldFilters); return result; } MatchFilter(EventFilter filter); @Override boolean test(@Nullable Event event); }
MatchFilter implements Predicate<Event> { @Override public boolean test(@Nullable Event event) { if (event == null) { return false; } EventMessage eventMessage = event.enclosedMessage(); EventContext context = event.context(); if (!checkEventType(eventMessage)) { return false; } if (!checkAggregateIds(context)) { return false; } if (!check(eventMessage, eventFieldFilters)) { return false; } boolean result = check(context, contextFieldFilters); return result; } MatchFilter(EventFilter filter); @Override boolean test(@Nullable Event event);  }