use of org.glassfish.jersey.tests.e2e.entity.filtering.domain.OneFilteringOnClassEntity in project jersey by jersey.
the class JsonEntityFilteringOnClassTest method testOneEntityFilteringOnClassDefaultView.
@Test
public void testOneEntityFilteringOnClassDefaultView() throws Exception {
final OneFilteringOnClassEntity entity = target("OneFilteringEntityDefaultView").request().get(OneFilteringOnClassEntity.class);
// OneFilteringOnClassEntity
assertThat(entity.field, is(0));
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.OneFilteringOnClassEntity in project jersey by jersey.
the class JsonEntityFilteringClientTest method testEntityAnnotationsPrimaryView.
@Test
public void testEntityAnnotationsPrimaryView() throws Exception {
final OneFilteringOnClassEntity entity = target().request().post(Entity.entity(OneFilteringOnClassEntity.INSTANCE, MediaType.APPLICATION_JSON_TYPE, new Annotation[] { PrimaryDetailedView.Factory.get() }), OneFilteringOnClassEntity.class);
_testPrimaryViewEntity(entity);
}
use of org.glassfish.jersey.tests.e2e.entity.filtering.domain.OneFilteringOnClassEntity in project jersey by jersey.
the class EntityFilteringClientTest method testInvalidConfiguration.
@Test
public void testInvalidConfiguration() throws Exception {
final ClientConfig config = new ClientConfig().property(EntityFilteringFeature.ENTITY_FILTERING_SCOPE, "invalid_value");
configureClient(config);
final String fields = ClientBuilder.newClient(config).target(getBaseUri()).request().post(Entity.entity(new OneFilteringOnClassEntity(), ENTITY_FILTERING), String.class);
assertThat(fields, equalTo(""));
}
use of org.glassfish.jersey.tests.e2e.entity.filtering.domain.OneFilteringOnClassEntity in project jersey by jersey.
the class EntityFilteringClientTest method testConfiguration.
private void testConfiguration(final String expected, final Annotation... annotations) {
final ClientConfig config = new ClientConfig().property(EntityFilteringFeature.ENTITY_FILTERING_SCOPE, annotations.length == 1 ? annotations[0] : annotations);
configureClient(config);
final String fields = ClientBuilder.newClient(config).target(getBaseUri()).request().post(Entity.entity(new OneFilteringOnClassEntity(), ENTITY_FILTERING), String.class);
assertSameFields(fields, expected);
}
Aggregations