use of org.glassfish.jersey.tests.e2e.entity.filtering.domain.OneFilteringSubEntity in project jersey by jersey.
the class JsonEntityFilteringClientTest method _testPrimaryViewEntity.
private void _testPrimaryViewEntity(final OneFilteringOnClassEntity entity) {
// OneFilteringOnClassEntity
assertThat(entity.field, is(10));
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.OneFilteringSubEntity in project jersey by jersey.
the class JsonEntityFilteringOnClassTest method testManyFilteringsEntitySecondaryView.
@Test
public void testManyFilteringsEntitySecondaryView() throws Exception {
final ManyFilteringsOnClassEntity entity = target("ManyFilteringsEntitySecondaryView").request().get(ManyFilteringsOnClassEntity.class);
// ManyFilteringsOnClassEntity
assertThat(entity.field, is(50));
assertThat(entity.accessorTransient, is("propertyproperty"));
assertThat(entity.getProperty(), is("property"));
// FilteredClassEntity
final FilteredClassEntity filtered = entity.filtered;
assertThat(filtered, notNullValue());
assertThat(filtered.field, is(0));
assertThat(filtered.getProperty(), nullValue());
// DefaultFilteringSubEntity
assertThat(entity.defaultEntities, notNullValue());
assertThat(entity.defaultEntities.size(), is(1));
final DefaultFilteringSubEntity defaultFilteringSubEntity = entity.defaultEntities.get(0);
assertThat(defaultFilteringSubEntity.field, is(true));
assertThat(defaultFilteringSubEntity.getProperty(), is(20L));
// OneFilteringSubEntity
assertThat(entity.oneEntities, notNullValue());
assertThat(entity.oneEntities.size(), is(1));
final OneFilteringSubEntity oneFilteringSubEntity = entity.oneEntities.get(0);
assertThat(oneFilteringSubEntity.field1, is(20));
assertThat(oneFilteringSubEntity.field2, is(0));
assertThat(oneFilteringSubEntity.getProperty1(), nullValue());
assertThat(oneFilteringSubEntity.getProperty2(), is("property2"));
// ManyFilteringsSubEntity
assertThat(entity.manyEntities, notNullValue());
assertThat(entity.manyEntities.size(), is(1));
final ManyFilteringsSubEntity manyFilteringsSubEntity = entity.manyEntities.get(0);
assertThat(manyFilteringsSubEntity.field1, is(60));
assertThat(manyFilteringsSubEntity.field2, is(70));
assertThat(manyFilteringsSubEntity.getProperty1(), nullValue());
assertThat(manyFilteringsSubEntity.getProperty2(), is("property2"));
}
use of org.glassfish.jersey.tests.e2e.entity.filtering.domain.OneFilteringSubEntity in project jersey by jersey.
the class JsonEntityFilteringOnClassTest method testManyFilteringsEntityPrimaryView.
@Test
public void testManyFilteringsEntityPrimaryView() throws Exception {
final ManyFilteringsOnClassEntity entity = target("ManyFilteringsEntityPrimaryView").request().get(ManyFilteringsOnClassEntity.class);
// ManyFilteringsOnClassEntity
assertThat(entity.field, is(50));
assertThat(entity.accessorTransient, is("propertyproperty"));
assertThat(entity.getProperty(), is("property"));
// FilteredClassEntity
final FilteredClassEntity filtered = entity.filtered;
assertThat(filtered, notNullValue());
assertThat(filtered.field, is(0));
assertThat(filtered.getProperty(), nullValue());
// DefaultFilteringSubEntity
assertThat(entity.defaultEntities, notNullValue());
assertThat(entity.defaultEntities.size(), is(1));
final DefaultFilteringSubEntity defaultFilteringSubEntity = entity.defaultEntities.get(0);
assertThat(defaultFilteringSubEntity.field, is(true));
assertThat(defaultFilteringSubEntity.getProperty(), is(20L));
// OneFilteringSubEntity
assertThat(entity.oneEntities, notNullValue());
assertThat(entity.oneEntities.size(), is(1));
final OneFilteringSubEntity oneFilteringSubEntity = entity.oneEntities.get(0);
assertThat(oneFilteringSubEntity.field1, is(20));
assertThat(oneFilteringSubEntity.field2, is(30));
assertThat(oneFilteringSubEntity.getProperty1(), is("property1"));
assertThat(oneFilteringSubEntity.getProperty2(), is("property2"));
// ManyFilteringsSubEntity
assertThat(entity.manyEntities, notNullValue());
assertThat(entity.manyEntities.size(), is(1));
final ManyFilteringsSubEntity manyFilteringsSubEntity = entity.manyEntities.get(0);
assertThat(manyFilteringsSubEntity.field1, is(60));
assertThat(manyFilteringsSubEntity.field2, is(0));
assertThat(manyFilteringsSubEntity.getProperty1(), is("property1"));
assertThat(manyFilteringsSubEntity.getProperty2(), nullValue());
}
use of org.glassfish.jersey.tests.e2e.entity.filtering.domain.OneFilteringSubEntity in project jersey by jersey.
the class JsonEntityFilteringOnClassTest method testOneEntityFilteringOnClass.
@Test
public void testOneEntityFilteringOnClass() throws Exception {
final OneFilteringOnClassEntity entity = target("OneFilteringEntity").request().get(OneFilteringOnClassEntity.class);
// OneFilteringOnClassEntity
assertThat(entity.field, is(10));
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.OneFilteringSubEntity in project jersey by jersey.
the class JsonEntityFilteringOnPropertiesTest method testManyFilteringsEntitySecondaryView.
@Test
public void testManyFilteringsEntitySecondaryView() throws Exception {
final ManyFilteringsOnPropertiesEntity entity = target("ManyFilteringsEntitySecondaryView").request().get(ManyFilteringsOnPropertiesEntity.class);
// ManyFilteringsOnPropertiesEntity
assertThat(entity.field, is(90));
assertThat(entity.accessorTransient, is("propertyproperty"));
assertThat(entity.getProperty(), is("property"));
// FilteredClassEntity
final FilteredClassEntity filtered = entity.filtered;
assertThat(filtered, notNullValue());
assertThat(filtered.field, is(0));
assertThat(filtered.getProperty(), nullValue());
// DefaultFilteringSubEntity
assertThat(entity.defaultEntities, nullValue());
// OneFilteringSubEntity
assertThat(entity.oneEntities, notNullValue());
assertThat(entity.oneEntities.size(), is(1));
final OneFilteringSubEntity oneFilteringSubEntity = entity.oneEntities.get(0);
assertThat(oneFilteringSubEntity.field1, is(20));
assertThat(oneFilteringSubEntity.field2, is(0));
assertThat(oneFilteringSubEntity.getProperty1(), nullValue());
assertThat(oneFilteringSubEntity.getProperty2(), is("property2"));
// ManyFilteringsSubEntity
assertThat(entity.manyEntities, notNullValue());
assertThat(entity.manyEntities.size(), is(1));
final ManyFilteringsSubEntity manyFilteringsSubEntity = entity.manyEntities.get(0);
assertThat(manyFilteringsSubEntity.field1, is(60));
assertThat(manyFilteringsSubEntity.field2, is(70));
assertThat(manyFilteringsSubEntity.getProperty1(), nullValue());
assertThat(manyFilteringsSubEntity.getProperty2(), is("property2"));
}
Aggregations