@Test void testGetMappingProject() { String projectName = "test_project"; MappingProject actualAddedMappingProject = mappingService.addMappingProject(projectName, hopMetaData.getId(), 3); String mappingTargetIdentifier = actualAddedMappingProject.getMappingTarget(hopMetaData.getId()).getIdentifier(); MappingTarget expectedMappingTarget = getManualMappingTarget(mappingTargetIdentifier, emptyList()); String mappingProjectIdentifier = actualAddedMappingProject.getIdentifier(); MappingProject expectedMappingProject = getManualMappingProject(mappingProjectIdentifier, projectName, 3, expectedMappingTarget); Entity mappingTargetEntity = mock(Entity.class); when(mappingTargetEntity.getString(MappingTargetMetadata.IDENTIFIER)) .thenReturn(mappingTargetIdentifier); when(mappingTargetEntity.getString(MappingTargetMetadata.TARGET)) .thenReturn(hopMetaData.getId()); when(mappingTargetEntity.getEntities(MappingTargetMetadata.ENTITY_MAPPINGS)).thenReturn(null); when(dataService.getEntityType(mappingTargetEntity.getString(MappingTargetMetadata.TARGET))) .thenReturn(hopMetaData); Entity mappingProjectEntity = mock(Entity.class); when(mappingProjectEntity.get(IDENTIFIER)).thenReturn(mappingProjectIdentifier); when(mappingProjectEntity.get(NAME)).thenReturn(projectName); when(mappingProjectEntity.get(DEPTH)).thenReturn(3); when(mappingProjectEntity.getEntities(MAPPING_TARGETS)) .thenReturn(singletonList(mappingTargetEntity)); when(mappingProjectEntity.get(MAPPING_TARGETS)) .thenReturn(singletonList(expectedMappingTarget)); when(dataService.findOneById(MAPPING_PROJECT, mappingProjectIdentifier)) .thenReturn(mappingProjectEntity); when(mappingProjectRepo.getMappingProject(mappingProjectIdentifier)) .thenReturn(actualAddedMappingProject); MappingProject retrievedMappingProject = mappingService.getMappingProject(mappingProjectIdentifier); assertEquals(expectedMappingProject, retrievedMappingProject); }
@Override public MappingProject getMappingProject(String identifier) { return mappingProjectRepository.getMappingProject(identifier); }
MappingServiceImpl implements MappingService { @Override public MappingProject getMappingProject(String identifier) { return mappingProjectRepository.getMappingProject(identifier); } }
MappingServiceImpl implements MappingService { @Override public MappingProject getMappingProject(String identifier) { return mappingProjectRepository.getMappingProject(identifier); } MappingServiceImpl(
      DataService dataService,
      AlgorithmService algorithmService,
      MappingProjectRepository mappingProjectRepository,
      PermissionSystemService permissionSystemService,
      AttributeFactory attrMetaFactory,
      EntityManager entityManager); }
MappingServiceImpl implements MappingService { @Override public MappingProject getMappingProject(String identifier) { return mappingProjectRepository.getMappingProject(identifier); } MappingServiceImpl(
      DataService dataService,
      AlgorithmService algorithmService,
      MappingProjectRepository mappingProjectRepository,
      PermissionSystemService permissionSystemService,
      AttributeFactory attrMetaFactory,
      EntityManager entityManager); @Override @Transactional MappingProject addMappingProject(String projectName, String target, int depth); @Override @Transactional void deleteMappingProject(String mappingProjectId); @Override @Transactional MappingProject cloneMappingProject(String mappingProjectId); @Override @Transactional MappingProject cloneMappingProject(
      String mappingProjectId, String clonedMappingProjectName); @Override List<MappingProject> getAllMappingProjects(); @Override @Transactional void updateMappingProject(MappingProject mappingProject); @Override MappingProject getMappingProject(String identifier); @Override @Transactional long applyMappings(
      String mappingProjectId,
      String entityTypeId,
      Boolean addSourceAttribute,
      String packageId,
      String label,
      Progress progress); Stream<EntityType> getCompatibleEntityTypes(EntityType target); }
MappingServiceImpl implements MappingService { @Override public MappingProject getMappingProject(String identifier) { return mappingProjectRepository.getMappingProject(identifier); } MappingServiceImpl(
      DataService dataService,
      AlgorithmService algorithmService,
      MappingProjectRepository mappingProjectRepository,
      PermissionSystemService permissionSystemService,
      AttributeFactory attrMetaFactory,
      EntityManager entityManager); @Override @Transactional MappingProject addMappingProject(String projectName, String target, int depth); @Override @Transactional void deleteMappingProject(String mappingProjectId); @Override @Transactional MappingProject cloneMappingProject(String mappingProjectId); @Override @Transactional MappingProject cloneMappingProject(
      String mappingProjectId, String clonedMappingProjectName); @Override List<MappingProject> getAllMappingProjects(); @Override @Transactional void updateMappingProject(MappingProject mappingProject); @Override MappingProject getMappingProject(String identifier); @Override @Transactional long applyMappings(
      String mappingProjectId,
      String entityTypeId,
      Boolean addSourceAttribute,
      String packageId,
      String label,
      Progress progress); Stream<EntityType> getCompatibleEntityTypes(EntityType target); static final int MAPPING_BATCH_SIZE; }