BasicODataClientQuery extends AbstractODataClientQuery implements Serializable { public String getQuery() { StringBuilder query = new StringBuilder(); query.append(getEdmEntityName()); if (!isSingletonEntity()) { query.append(generateParameters()); } return query.toString(); } BasicODataClientQuery(Builder builder); String getQuery(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testEntitySetQuery() { String resultQuery = new BasicODataClientQuery.Builder() .withEntityType(EntitySetSample.class) .withEntityKey("'someKey'") .withFilterMap("filterKey", "filterValue") .build().getQuery(); assertEquals("EntitySetSamples('someKey')?$filter=filterKey eq 'filterValue'", resultQuery); }
@Test public void testEntitySingletonQuery() { String resultQuery = new BasicODataClientQuery.Builder() .withEntityType(EntitySingletonSample.class) .withEntityKey("'someKey'") .withFilterMap("filterKey", "filterValue") .build().getQuery(); assertEquals("EntitySingletonSample", resultQuery); }