use of io.crnk.core.engine.internal.information.resource.RawResourceFieldAccessor in project crnk-framework by crnk-project.
the class RawResourceFieldAccessorTest method attribute.
@Test
public void attribute() {
RawResourceFieldAccessor accessor = new RawResourceFieldAccessor("name", ResourceFieldType.ATTRIBUTE, String.class);
Assert.assertEquals("Doe", accessor.getValue(resource));
}
use of io.crnk.core.engine.internal.information.resource.RawResourceFieldAccessor in project crnk-framework by crnk-project.
the class RawResourceFieldAccessorTest method links.
@Test
public void links() {
RawResourceFieldAccessor accessor = new RawResourceFieldAccessor("links", ResourceFieldType.LINKS_INFORMATION, TestLinks.class);
TestLinks value = (TestLinks) accessor.getValue(resource);
Assert.assertEquals("someLink", value.name);
}
use of io.crnk.core.engine.internal.information.resource.RawResourceFieldAccessor in project crnk-framework by crnk-project.
the class RawResourceFieldAccessorTest method meta.
@Test
public void meta() {
RawResourceFieldAccessor accessor = new RawResourceFieldAccessor("meta", ResourceFieldType.META_INFORMATION, TestMeta.class);
TestMeta value = (TestMeta) accessor.getValue(resource);
Assert.assertEquals("someMeta", value.name);
}
use of io.crnk.core.engine.internal.information.resource.RawResourceFieldAccessor in project crnk-framework by crnk-project.
the class RawResourceFieldAccessorTest method relationship.
@Test
public void relationship() {
RawResourceFieldAccessor accessor = new RawResourceFieldAccessor("address", ResourceFieldType.RELATIONSHIP, ResourceIdentifier.class);
ResourceIdentifier value = (ResourceIdentifier) accessor.getValue(resource);
Assert.assertEquals("zurich", value.getId());
}
use of io.crnk.core.engine.internal.information.resource.RawResourceFieldAccessor in project crnk-framework by crnk-project.
the class RawResourceFieldAccessorTest method id.
@Test
public void id() {
RawResourceFieldAccessor accessor = new RawResourceFieldAccessor("id", ResourceFieldType.ID, String.class);
Assert.assertEquals("someId", accessor.getValue(resource));
}
Aggregations