Search in sources :

Example 1 with BelongsToEntityType

use of com.qcadoo.model.internal.types.BelongsToEntityType in project qcadoo by qcadoo.

the class FieldTypeFactoryTest method shouldReturnBelongToType.

@Test
public void shouldReturnBelongToType() throws Exception {
    // when
    FieldType fieldType = new BelongsToEntityType("parent", "entity", dataDefinitionService, false, true);
    // then
    assertEquals(Object.class, fieldType.getType());
    assertTrue(fieldType.toObject(fieldDefinition, new DefaultEntity(dataDefinition)).isValid());
}
Also used : DefaultEntity(com.qcadoo.model.internal.DefaultEntity) BelongsToEntityType(com.qcadoo.model.internal.types.BelongsToEntityType) FieldType(com.qcadoo.model.api.types.FieldType) DataAccessTest(com.qcadoo.model.internal.DataAccessTest) Test(org.junit.Test)

Aggregations

FieldType (com.qcadoo.model.api.types.FieldType)1 DataAccessTest (com.qcadoo.model.internal.DataAccessTest)1 DefaultEntity (com.qcadoo.model.internal.DefaultEntity)1 BelongsToEntityType (com.qcadoo.model.internal.types.BelongsToEntityType)1 Test (org.junit.Test)1