use of org.hisp.dhis.dxf2.metadata.merge.SimpleCollection in project dhis2-core by dhis2.
the class MergeServiceTest method simpleCollection.
@Test
public void simpleCollection() {
Date date = new Date();
SimpleCollection source = new SimpleCollection("name");
source.getSimples().add(new Simple("simple", 10, date, false, 123, 2.5f));
source.getSimples().add(new Simple("simple", 20, date, false, 123, 2.5f));
source.getSimples().add(new Simple("simple", 30, date, false, 123, 2.5f));
SimpleCollection target = new SimpleCollection("target");
mergeService.merge(new MergeParams<>(source, target).setMergeMode(MergeMode.MERGE));
assertEquals("name", target.getName());
assertEquals(3, target.getSimples().size());
assertTrue(target.getSimples().contains(source.getSimples().get(0)));
assertTrue(target.getSimples().contains(source.getSimples().get(1)));
assertTrue(target.getSimples().contains(source.getSimples().get(2)));
}
Aggregations