/** * The <code>notEmpty</code> operator checks that an array or String is not empty. * * @return the criteria */ @Deprecated public Criteria notEmpty() { return empty(false); }
@Test public void a_not_empty_filter_can_be_serialized() { String filter = filter(where("a").empty(false)).toString(); String parsed = parse("[?(@['a'] EMPTY false)]").toString(); assertThat(filter).isEqualTo(parsed); }
@Test public void empty_evals() { assertThat(filter(where("string-key").empty(false)).apply(createPredicateContext(json))).isEqualTo(true); assertThat(filter(where("string-key").empty(true)).apply(createPredicateContext(json))).isEqualTo(false); assertThat(filter(where("string-key-empty").empty(true)).apply(createPredicateContext(json))).isEqualTo(true); assertThat(filter(where("string-key-empty").empty(false)).apply(createPredicateContext(json))).isEqualTo(false); assertThat(filter(where("int-arr").empty(false)).apply(createPredicateContext(json))).isEqualTo(true); assertThat(filter(where("int-arr").empty(true)).apply(createPredicateContext(json))).isEqualTo(false); assertThat(filter(where("arr-empty").empty(true)).apply(createPredicateContext(json))).isEqualTo(true); assertThat(filter(where("arr-empty").empty(false)).apply(createPredicateContext(json))).isEqualTo(false); assertThat(filter(where("null-key").empty(true)).apply(createPredicateContext(json))).isEqualTo(false); assertThat(filter(where("null-key").empty(false)).apply(createPredicateContext(json))).isEqualTo(false); }
/** * The <code>notEmpty</code> operator checks that an array or String is not empty. * * @return the criteria */ @Deprecated public Criteria notEmpty() { return empty(false); }
/** * The <code>notEmpty</code> operator checks that an array or String is not empty. * * @return the criteria */ @Deprecated public Criteria notEmpty() { return empty(false); }