Search in sources :

Example 1 with ManyToManyEntitiesType

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

the class FieldTypeFactoryTest method shouldReturnManyToManyType.

@Test
public void shouldReturnManyToManyType() throws Exception {
    // when
    FieldType fieldType = new ManyToManyEntitiesType("parent", "entity", "joinFieldName", ManyToManyType.Cascade.NULLIFY, true, false, dataDefinitionService);
    // then
    assertEquals(Set.class, fieldType.getType());
    assertTrue(fieldType.toObject(fieldDefinition, new DefaultEntity(dataDefinition)).isValid());
}
Also used : DefaultEntity(com.qcadoo.model.internal.DefaultEntity) ManyToManyEntitiesType(com.qcadoo.model.internal.types.ManyToManyEntitiesType) 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 ManyToManyEntitiesType (com.qcadoo.model.internal.types.ManyToManyEntitiesType)1 Test (org.junit.Test)1