use of org.glassfish.jersey.tests.e2e.entity.filtering.domain.OneFilteringOnPropertiesEntity in project jersey by jersey.
the class JsonEntityFilteringOnPropertiesTest method testOneEntityFilteringOnPropertiesDefaultView.
@Test
public void testOneEntityFilteringOnPropertiesDefaultView() throws Exception {
final OneFilteringOnPropertiesEntity entity = target("OneFilteringEntityDefaultView").request().get(OneFilteringOnPropertiesEntity.class);
// OneFilteringOnPropertiesEntity
assertThat(entity.field, is(80));
assertThat(entity.accessorTransient, nullValue());
assertThat(entity.getProperty(), nullValue());
// FilteredClassEntity
final FilteredClassEntity filtered = entity.getFiltered();
assertThat(filtered, nullValue());
// DefaultFilteringSubEntity
assertThat(entity.getDefaultEntities(), nullValue());
// OneFilteringSubEntity
assertThat(entity.getSubEntities(), nullValue());
}
use of org.glassfish.jersey.tests.e2e.entity.filtering.domain.OneFilteringOnPropertiesEntity in project jersey by jersey.
the class JsonEntityFilteringOnPropertiesTest method testOneEntityFilteringOnProperties.
@Test
public void testOneEntityFilteringOnProperties() throws Exception {
final OneFilteringOnPropertiesEntity entity = target("OneFilteringEntity").request().get(OneFilteringOnPropertiesEntity.class);
// OneFilteringOnPropertiesEntity
assertThat(entity.field, is(80));
assertThat(entity.accessorTransient, is("propertyproperty"));
assertThat(entity.getProperty(), is("property"));
// FilteredClassEntity
final FilteredClassEntity filtered = entity.getFiltered();
assertThat(filtered, notNullValue());
assertThat(filtered.field, is(0));
assertThat(filtered.getProperty(), nullValue());
// DefaultFilteringSubEntity
assertThat(entity.getDefaultEntities(), notNullValue());
assertThat(entity.getDefaultEntities().size(), is(1));
final DefaultFilteringSubEntity defaultFilteringSubEntity = entity.getDefaultEntities().get(0);
assertThat(defaultFilteringSubEntity.field, is(true));
assertThat(defaultFilteringSubEntity.getProperty(), is(20L));
// OneFilteringSubEntity
assertThat(entity.getSubEntities(), notNullValue());
assertThat(entity.getSubEntities().size(), is(1));
final OneFilteringSubEntity oneFilteringSubEntity = entity.getSubEntities().get(0);
assertThat(oneFilteringSubEntity.field1, is(20));
assertThat(oneFilteringSubEntity.field2, is(30));
assertThat(oneFilteringSubEntity.getProperty1(), is("property1"));
assertThat(oneFilteringSubEntity.getProperty2(), is("property2"));
}
use of org.glassfish.jersey.tests.e2e.entity.filtering.domain.OneFilteringOnPropertiesEntity in project jersey by jersey.
the class JsonEntityFilteringOnPropertiesTest method testOneEntityFilteringOnPropertiesDefaultViewResponse.
@Test
public void testOneEntityFilteringOnPropertiesDefaultViewResponse() throws Exception {
final OneFilteringOnPropertiesEntity entity = target("OneFilteringEntityDefaultViewResponse").request().get(OneFilteringOnPropertiesEntity.class);
// OneFilteringOnPropertiesEntity
assertThat(entity.field, is(80));
assertThat(entity.accessorTransient, nullValue());
assertThat(entity.getProperty(), nullValue());
// FilteredClassEntity
final FilteredClassEntity filtered = entity.getFiltered();
assertThat(filtered, nullValue());
// DefaultFilteringSubEntity
assertThat(entity.getDefaultEntities(), nullValue());
// OneFilteringSubEntity
assertThat(entity.getSubEntities(), nullValue());
}
Aggregations