@Test @DisplayName("not match by wrong field name") void notMatchByWrongField() { String wrongName = "wrong"; Column target = booleanColumn(); Multimap<Column, Filter> filters = ImmutableMultimap.of(target, eq(wrongName, "any")); CompositeQueryParameter parameter = createParams(filters, EITHER); QueryParameters params = QueryParameters.newBuilder() .add(parameter) .build(); EntityQuery<?> query = createQuery(Collections.emptyList(), params); EntityQueryMatcher<?> matcher = new EntityQueryMatcher<>(query); EntityRecord record = EntityRecord.newBuilder() .setEntityId(Any.getDefaultInstance()) .build(); EntityRecordWithColumns recordWithColumns = EntityRecordWithColumns.of(record, Collections.emptyMap()); assertFalse(matcher.test(recordWithColumns)); }
@Override public boolean test(@Nullable EntityRecordWithColumns input) { if (input == null) { return false; } boolean result = idMatches(input) && columnValuesMatch(input); return result; }
EntityQueryMatcher implements Predicate<@Nullable EntityRecordWithColumns> { @Override public boolean test(@Nullable EntityRecordWithColumns input) { if (input == null) { return false; } boolean result = idMatches(input) && columnValuesMatch(input); return result; } }
EntityQueryMatcher implements Predicate<@Nullable EntityRecordWithColumns> { @Override public boolean test(@Nullable EntityRecordWithColumns input) { if (input == null) { return false; } boolean result = idMatches(input) && columnValuesMatch(input); return result; } EntityQueryMatcher(EntityQuery<I> query); }
EntityQueryMatcher implements Predicate<@Nullable EntityRecordWithColumns> { @Override public boolean test(@Nullable EntityRecordWithColumns input) { if (input == null) { return false; } boolean result = idMatches(input) && columnValuesMatch(input); return result; } EntityQueryMatcher(EntityQuery<I> query); @Override boolean test(@Nullable EntityRecordWithColumns input); }
EntityQueryMatcher implements Predicate<@Nullable EntityRecordWithColumns> { @Override public boolean test(@Nullable EntityRecordWithColumns input) { if (input == null) { return false; } boolean result = idMatches(input) && columnValuesMatch(input); return result; } EntityQueryMatcher(EntityQuery<I> query); @Override boolean test(@Nullable EntityRecordWithColumns input);  }