@Test void testGetAttributeMappingsUnknownSourceAndTargetEntityType() { String identifier = "identifier"; String targetAttribute = "targetAttribute"; String algorithm = "algorithm"; String algorithmState = "algorithmState"; Entity attributeMappingEntity = mock(Entity.class); doReturn(identifier).when(attributeMappingEntity).getString("identifier"); doReturn(targetAttribute).when(attributeMappingEntity).getString("targetAttribute"); doReturn(algorithm).when(attributeMappingEntity).getString("algorithm"); doReturn(algorithmState).when(attributeMappingEntity).getString("algorithmState"); AttributeMapping attributeMapping = new AttributeMapping( identifier, targetAttribute, null, algorithm, emptyList(), algorithmState); assertEquals( singletonList(attributeMapping), attributeMappingRepository.getAttributeMappings( singletonList(attributeMappingEntity), null, null)); }
@Override public List<AttributeMapping> getAttributeMappings( List<Entity> attributeMappingEntities, @Nullable @CheckForNull EntityType sourceEntityType, @Nullable @CheckForNull EntityType targetEntityType) { return Lists.transform( attributeMappingEntities, attributeMappingEntity -> toAttributeMapping(attributeMappingEntity, sourceEntityType, targetEntityType)); }
AttributeMappingRepositoryImpl implements AttributeMappingRepository { @Override public List<AttributeMapping> getAttributeMappings( List<Entity> attributeMappingEntities, @Nullable @CheckForNull EntityType sourceEntityType, @Nullable @CheckForNull EntityType targetEntityType) { return Lists.transform( attributeMappingEntities, attributeMappingEntity -> toAttributeMapping(attributeMappingEntity, sourceEntityType, targetEntityType)); } }
AttributeMappingRepositoryImpl implements AttributeMappingRepository { @Override public List<AttributeMapping> getAttributeMappings( List<Entity> attributeMappingEntities, @Nullable @CheckForNull EntityType sourceEntityType, @Nullable @CheckForNull EntityType targetEntityType) { return Lists.transform( attributeMappingEntities, attributeMappingEntity -> toAttributeMapping(attributeMappingEntity, sourceEntityType, targetEntityType)); } AttributeMappingRepositoryImpl(
      DataService dataService, AttributeMappingMetadata attributeMappingMetaData); }
AttributeMappingRepositoryImpl implements AttributeMappingRepository { @Override public List<AttributeMapping> getAttributeMappings( List<Entity> attributeMappingEntities, @Nullable @CheckForNull EntityType sourceEntityType, @Nullable @CheckForNull EntityType targetEntityType) { return Lists.transform( attributeMappingEntities, attributeMappingEntity -> toAttributeMapping(attributeMappingEntity, sourceEntityType, targetEntityType)); } AttributeMappingRepositoryImpl(
      DataService dataService, AttributeMappingMetadata attributeMappingMetaData); @Override List<Entity> upsert(Collection<AttributeMapping> attributeMappings); @Override List<AttributeMapping> getAttributeMappings(
      List<Entity> attributeMappingEntities,
      @Nullable @CheckForNull EntityType sourceEntityType,
      @Nullable @CheckForNull EntityType targetEntityType); }
AttributeMappingRepositoryImpl implements AttributeMappingRepository { @Override public List<AttributeMapping> getAttributeMappings( List<Entity> attributeMappingEntities, @Nullable @CheckForNull EntityType sourceEntityType, @Nullable @CheckForNull EntityType targetEntityType) { return Lists.transform( attributeMappingEntities, attributeMappingEntity -> toAttributeMapping(attributeMappingEntity, sourceEntityType, targetEntityType)); } AttributeMappingRepositoryImpl(
      DataService dataService, AttributeMappingMetadata attributeMappingMetaData); @Override List<Entity> upsert(Collection<AttributeMapping> attributeMappings); @Override List<AttributeMapping> getAttributeMappings(
      List<Entity> attributeMappingEntities,
      @Nullable @CheckForNull EntityType sourceEntityType,
      @Nullable @CheckForNull EntityType targetEntityType);  }