use of org.molgenis.semanticmapper.mapping.model.MappingTarget in project molgenis by molgenis.
the class MappingServiceImplTest method testMaxProgressMultipleSources.
@Test
public void testMaxProgressMultipleSources() {
MappingTarget mappingTarget = Mockito.mock(MappingTarget.class);
EntityMapping mapping1 = getMockEntityMapping("a", MAPPING_BATCH_SIZE);
EntityMapping mapping2 = getMockEntityMapping("b", MAPPING_BATCH_SIZE + 1);
List<EntityMapping> mappings = newArrayList(mapping1, mapping2);
when(mappingTarget.getEntityMappings()).thenReturn(mappings);
assertEquals(mappingService.calculateMaxProgress(mappingTarget), 3);
}
use of org.molgenis.semanticmapper.mapping.model.MappingTarget in project molgenis by molgenis.
the class MappingServiceImplTest method testMaxProgressMultipleSourcesSelfReferencing.
@Test
public void testMaxProgressMultipleSourcesSelfReferencing() {
MappingTarget mappingTarget = Mockito.mock(MappingTarget.class);
EntityMapping mapping1 = getMockEntityMapping("a", MAPPING_BATCH_SIZE);
EntityMapping mapping2 = getMockEntityMapping("b", MAPPING_BATCH_SIZE + 1);
List<EntityMapping> mappings = newArrayList(mapping1, mapping2);
when(mappingTarget.hasSelfReferences()).thenReturn(true);
when(mappingTarget.getEntityMappings()).thenReturn(mappings);
assertEquals(mappingService.calculateMaxProgress(mappingTarget), 6);
}
Aggregations