CollectionRequest extends BaseRequest { @Override public Cardinality getCardinality() { return Cardinality.COLLECTION; } CollectionRequest(Map<String, Object> queryProperties, String queryString);  CollectionRequest(Map<String, Object> queryProperties, String queryString, Map<String, Object> updateProperties); @Override Cardinality getCardinality();  }
@Test public void testNoProperties() { String query = "name:foo*"; Request request = new CollectionRequest(null, query); assertEquals(Request.Cardinality.COLLECTION, request.getCardinality()); assertTrue(request.getQueryProperties().isEmpty()); assertNull(request.getProperty("foo")); assertTrue(request.getAdditionalSelectProperties().isEmpty()); }
@Test public void testWithProperties() { String query = "name:foo*"; Map<String, Object> properties = new HashMap<>(); properties.put("foo", "fooValue"); properties.put("someBoolean", true); Request request = new CollectionRequest(properties, query); assertEquals(Request.Cardinality.COLLECTION, request.getCardinality()); assertEquals(properties, request.getQueryProperties()); assertEquals("fooValue", request.getProperty("foo")); assertTrue(request.<Boolean>getProperty("someBoolean")); assertNull(request.getProperty("other")); assertTrue(request.getAdditionalSelectProperties().isEmpty()); }