use of org.molgenis.metadata.manager.model.EditorEntityTypeIdentifier in project molgenis by molgenis.
the class EntityTypeReferenceMapperTest method testToEditorEntityTypeIdentifiers.
@Test
public void testToEditorEntityTypeIdentifiers() {
String id = "id";
String label = "label";
EntityType entityType = mock(EntityType.class);
when(entityType.getId()).thenReturn(id);
when(entityType.getLabel()).thenReturn(label);
List<EditorEntityTypeIdentifier> editorEntityTypeIdentifiers = entityTypeReferenceMapper.toEditorEntityTypeIdentifiers(of(entityType));
assertEquals(editorEntityTypeIdentifiers, of(EditorEntityTypeIdentifier.create(id, label)));
}
use of org.molgenis.metadata.manager.model.EditorEntityTypeIdentifier in project molgenis by molgenis.
the class AttributeReferenceMapperTest method testToEditorAttributeIdentifier.
@Test
public void testToEditorAttributeIdentifier() {
String id = "id";
String label = "label";
String entityTypeId = "id";
String entityTypeLabel = "label";
Attribute attribute = mock(Attribute.class);
EntityType entityType = mock(EntityType.class);
when(attribute.getIdentifier()).thenReturn(id);
when(attribute.getLabel()).thenReturn(label);
when(attribute.getEntity()).thenReturn(entityType);
when(entityType.getId()).thenReturn(entityTypeId);
when(entityType.getLabel()).thenReturn(entityTypeLabel);
EditorAttributeIdentifier editorAttributeIdentifier = attributeReferenceMapper.toEditorAttributeIdentifier(attribute);
EditorEntityTypeIdentifier editorEntityTypeIdentifier = EditorEntityTypeIdentifier.create(entityTypeId, entityTypeLabel);
assertEquals(editorAttributeIdentifier, EditorAttributeIdentifier.create(id, label, editorEntityTypeIdentifier));
}
use of org.molgenis.metadata.manager.model.EditorEntityTypeIdentifier in project molgenis by molgenis.
the class AttributeReferenceMapperTest method testToEditorAttributeIdentifiers.
@Test
public void testToEditorAttributeIdentifiers() {
String id = "id";
String label = "label";
String entityTypeId = "id";
String entityTypeLabel = "label";
Attribute attribute = mock(Attribute.class);
EntityType entityType = mock(EntityType.class);
when(attribute.getIdentifier()).thenReturn(id);
when(attribute.getLabel()).thenReturn(label);
when(attribute.getEntity()).thenReturn(entityType);
when(entityType.getId()).thenReturn(entityTypeId);
when(entityType.getLabel()).thenReturn(entityTypeLabel);
ImmutableList<EditorAttributeIdentifier> editorAttributeIdentifier = attributeReferenceMapper.toEditorAttributeIdentifiers(of(attribute));
EditorEntityTypeIdentifier editorEntityTypeIdentifier = EditorEntityTypeIdentifier.create(entityTypeId, entityTypeLabel);
assertEquals(editorAttributeIdentifier, of(EditorAttributeIdentifier.create(id, label, editorEntityTypeIdentifier)));
}
use of org.molgenis.metadata.manager.model.EditorEntityTypeIdentifier in project molgenis by molgenis.
the class EntityTypeReferenceMapperTest method testToEditorEntityTypeIdentifier.
@Test
public void testToEditorEntityTypeIdentifier() {
String id = "id";
String label = "label";
EntityType entityType = mock(EntityType.class);
when(entityType.getId()).thenReturn(id);
when(entityType.getLabel()).thenReturn(label);
EditorEntityTypeIdentifier editorEntityTypeIdentifier = entityTypeReferenceMapper.toEditorEntityTypeIdentifier(entityType);
assertEquals(editorEntityTypeIdentifier, EditorEntityTypeIdentifier.create(id, label));
}
Aggregations