use of org.finos.waltz.model.logical_flow.LogicalFlow in project waltz by khartec.
the class LogicalFlowTest method bySelector.
@Test
public void bySelector() {
EntityReference a = appHelper.createNewApp("a", ouIds.a);
EntityReference b = appHelper.createNewApp("b", ouIds.a1);
EntityReference c = appHelper.createNewApp("c", ouIds.b);
// a -> b
// a -> c
// c
LogicalFlow ab = helper.createLogicalFlow(a, b);
LogicalFlow ac = helper.createLogicalFlow(a, c);
assertEquals(asSet(ab.id(), ac.id()), map(lfDao.findBySelector(logicalFlowIdSelectorFactory.apply(mkOpts(mkRef(EntityKind.ORG_UNIT, ouIds.root), CHILDREN))), IdProvider::id), "find by root ou gives all");
assertEquals(asSet(ac.id()), map(lfDao.findBySelector(logicalFlowIdSelectorFactory.apply(mkOpts(mkRef(EntityKind.ORG_UNIT, ouIds.b), CHILDREN))), IdProvider::id), "find by ou 'b' gives only one flow");
}
use of org.finos.waltz.model.logical_flow.LogicalFlow in project waltz by khartec.
the class LogicalFlowTest method basicDirectAssociations.
@Test
public void basicDirectAssociations() {
EntityReference a = appHelper.createNewApp("a", ouIds.a);
EntityReference b = appHelper.createNewApp("b", ouIds.a1);
EntityReference c = appHelper.createNewApp("c", ouIds.b);
EntityReference d = appHelper.createNewApp("c", ouIds.b);
// a -> b
// a -> d
// c
LogicalFlow ab = helper.createLogicalFlow(a, b);
LogicalFlow ad = helper.createLogicalFlow(a, d);
assertEquals(asSet(ab.id(), ad.id()), map(lfDao.findByEntityReference(a), IdProvider::id), "Can see flow associated to 'a'");
assertEquals(asSet(ab.id()), map(lfDao.findByEntityReference(b), IdProvider::id), "Can sees flows associated to 'b'");
assertEquals(asSet(ad.id()), map(lfDao.findByEntityReference(d), IdProvider::id), "Can sees flows associated to 'd'");
assertTrue(isEmpty(lfDao.findByEntityReference(c)), "Can sees nothing associated to 'c'");
}
Aggregations