use of io.crnk.core.engine.information.resource.ResourceInformation in project crnk-framework by crnk-project.
the class DefaultResourceInformationProviderTest method shouldHaveGetterBooleanWithGetPrefix.
@Test
public void shouldHaveGetterBooleanWithGetPrefix() throws Exception {
ResourceInformation resourceInformation = resourceInformationProvider.build(Task.class);
assertThat(containsFieldWithName(resourceInformation, "deleted")).isTrue();
assertThat(containsFieldWithName(resourceInformation, "tDeleted")).isFalse();
}
use of io.crnk.core.engine.information.resource.ResourceInformation in project crnk-framework by crnk-project.
the class DefaultResourceInformationProviderTest method shouldNotIncludeIgnoredInterfaceMethod.
@Test
public void shouldNotIncludeIgnoredInterfaceMethod() throws Exception {
ResourceInformation resourceInformation = resourceInformationProvider.build(JsonIgnoreMethodImpl.class);
assertThat(resourceInformation.findFieldByName("ignoredMember")).isNull();
}
use of io.crnk.core.engine.information.resource.ResourceInformation in project crnk-framework by crnk-project.
the class DefaultResourceInformationProviderTest method checkWriteOnlyAttributesCurrentlyNotSupported.
@Test
public void checkWriteOnlyAttributesCurrentlyNotSupported() throws Exception {
ResourceInformation resourceInformation = resourceInformationProvider.build(WriteOnlyAttributeResource.class);
Assert.assertNull(resourceInformation.findAttributeFieldByName("attribute"));
}
use of io.crnk.core.engine.information.resource.ResourceInformation in project crnk-framework by crnk-project.
the class DefaultResourceInformationProviderTest method shouldIgnoreStaticAttributes.
@Test
public void shouldIgnoreStaticAttributes() throws Exception {
ResourceInformation resourceInformation = resourceInformationProvider.build(IgnoredStaticAttributeResource.class);
Assert.assertNull(resourceInformation.findFieldByName("attribute"));
}
use of io.crnk.core.engine.information.resource.ResourceInformation in project crnk-framework by crnk-project.
the class DefaultResourceInformationProviderTest method shouldHaveNoneForDefaultLookupBehavior.
@Test
public void shouldHaveNoneForDefaultLookupBehavior() throws Exception {
ResourceInformation resourceInformation = resourceInformationProvider.build(JsonResourceWithDefaultLookupBehaviorRelationship.class);
assertThat(resourceInformation.getRelationshipFields()).extracting("lookupIncludeBehavior").contains(LookupIncludeBehavior.NONE);
}
Aggregations