use of org.glassfish.jersey.examples.entityfiltering.selectable.domain.Person in project jersey by jersey.
the class PersonResourceTest method testFiltersSameName.
/**
* Test that 1st and 2nd level filters with the same name act as expected.
*/
@Test
public void testFiltersSameName() throws Exception {
final Person firstLevel = target("people").path("1234").queryParam("select", "familyName,region").request().get(Person.class);
final Person secondLevel = target("people").path("1234").queryParam("select", "familyName,addresses.region").request().get(Person.class);
// Not null values.
assertThat(firstLevel.getRegion(), notNullValue());
assertThat(secondLevel.getAddresses().get(0).getRegion(), notNullValue());
// Null values.
//confirms 2nd level region on addresses is null
assertThat(firstLevel.getAddresses(), nullValue());
assertThat(secondLevel.getRegion(), nullValue());
}
Aggregations