@Test @SuppressWarnings("unchecked") void testCreateEditorEntityType() { String id = "id"; String backend = "backend"; @SuppressWarnings("unchecked") List<Attribute> attributes = mock(List.class); @SuppressWarnings("unchecked") List<Tag> tags = mock(List.class); Attribute idAttribute = mock(Attribute.class); Attribute labelAttribute = mock(Attribute.class); @SuppressWarnings("unchecked") List<Attribute> lookupAttributes = mock(List.class); List<Attribute> referringAttributes = mock(List.class); EntityType entityType = mock(EntityType.class); when(entityType.getId()).thenReturn(id); when(entityType.getBackend()).thenReturn(backend); when(entityType.getOwnAllAttributes()).thenReturn(attributes); when(entityType.getTags()).thenReturn(tags); when(entityType.getLookupAttributes()).thenReturn(lookupAttributes); when(entityType.getIdAttribute()).thenReturn(idAttribute); when(entityType.getLabelAttribute()).thenReturn(labelAttribute); when(entityTypeFactory.create()).thenReturn(entityType); EditorAttributeIdentifier editorIdAttribute = mock(EditorAttributeIdentifier.class); EditorAttributeIdentifier editorLabelAttribute = mock(EditorAttributeIdentifier.class); when(attributeMapper.toEditorAttributes(attributes)).thenReturn(ImmutableList.of()); when(attributeReferenceMapper.toEditorAttributeIdentifier(idAttribute)) .thenReturn(editorIdAttribute); when(attributeReferenceMapper.toEditorAttributeIdentifier(labelAttribute)) .thenReturn(editorLabelAttribute); when(tagMapper.toEditorTags(tags)).thenReturn(ImmutableList.of()); when(attributeReferenceMapper.toEditorAttributeIdentifiers(lookupAttributes)) .thenReturn(ImmutableList.of()); when(attributeReferenceMapper.toEditorAttributeIdentifiers(referringAttributes)) .thenReturn(ImmutableList.of()); EditorEntityType editorEntityType = entityTypeMapper.toEditorEntityType(entityType, referringAttributes); assertEquals( create( id, null, ImmutableMap.of(), null, ImmutableMap.of(), false, backend, null, null, of(), of(), of(), editorIdAttribute, editorLabelAttribute, of()), editorEntityType); }
public EditorEntityType createEditorEntityType() { EntityType entityType = entityTypeFactory.create(); return toEditorEntityType(entityType, ImmutableList.of()); }
EntityTypeMapper { public EditorEntityType createEditorEntityType() { EntityType entityType = entityTypeFactory.create(); return toEditorEntityType(entityType, ImmutableList.of()); } }
EntityTypeMapper { public EditorEntityType createEditorEntityType() { EntityType entityType = entityTypeFactory.create(); return toEditorEntityType(entityType, ImmutableList.of()); } EntityTypeMapper(
      EntityTypeFactory entityTypeFactory,
      AttributeMapper attributeMapper,
      AttributeReferenceMapper attributeReferenceMapper,
      PackageMapper packageMapper,
      TagMapper tagMapper,
      EntityTypeParentMapper entityTypeParentMapper); }
EntityTypeMapper { public EditorEntityType createEditorEntityType() { EntityType entityType = entityTypeFactory.create(); return toEditorEntityType(entityType, ImmutableList.of()); } EntityTypeMapper(
      EntityTypeFactory entityTypeFactory,
      AttributeMapper attributeMapper,
      AttributeReferenceMapper attributeReferenceMapper,
      PackageMapper packageMapper,
      TagMapper tagMapper,
      EntityTypeParentMapper entityTypeParentMapper); EditorEntityType toEditorEntityType(
      EntityType entityType, List<Attribute> referringAttributes); EditorEntityType createEditorEntityType(); EntityType toEntityType(EditorEntityType editorEntityType); }
EntityTypeMapper { public EditorEntityType createEditorEntityType() { EntityType entityType = entityTypeFactory.create(); return toEditorEntityType(entityType, ImmutableList.of()); } EntityTypeMapper(
      EntityTypeFactory entityTypeFactory,
      AttributeMapper attributeMapper,
      AttributeReferenceMapper attributeReferenceMapper,
      PackageMapper packageMapper,
      TagMapper tagMapper,
      EntityTypeParentMapper entityTypeParentMapper); EditorEntityType toEditorEntityType(
      EntityType entityType, List<Attribute> referringAttributes); EditorEntityType createEditorEntityType(); EntityType toEntityType(EditorEntityType editorEntityType);  }