Skip to content

Commit 7df5bb8

Browse files
author
Burak Serdar
committed
Add test to show it fails
1 parent cb672cf commit 7df5bb8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

crud/src/test/java/com/redhat/lightblue/mediator/CompositeFinderTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,16 @@ public void rev_search_with_arraycond() throws Exception {
592592
Assert.assertEquals(2, response.getEntityData().get(0).get("us").size());
593593
}
594594

595+
@Test
596+
public void rev_search_with_arraycond_matchcount() throws Exception {
597+
FindRequest fr = new FindRequest();
598+
fr.setQuery(query("{'array':'us.*.authentications','elemMatch':{ '$and':[ { 'field':'principal','op':'$in','values':['a']}, {'field':'providerName','op':'$eq','rvalue':'p'} ] } }"));
599+
fr.setProjection(projection("[{'field':'*','recursive':1},{'field':'us','recursive':1}]"));
600+
fr.setEntityVersion(new EntityVersion("L", "0.0.1"));
601+
Response response = mediator.find(fr);
602+
Assert.assertEquals(1, response.getMatchCount());
603+
}
604+
595605
@Test
596606
public void elem_match_forward() throws Exception {
597607
FindRequest fr = new FindRequest();

0 commit comments

Comments
 (0)