use of org.finos.waltz.model.EntityReference in project waltz by khartec.
the class AttestationPreCheckServiceTest method notAllowedToAttestAttestIfUnknownIncomingDataTypeFlows.
@Test
public void notAllowedToAttestAttestIfUnknownIncomingDataTypeFlows() {
EntityReference aRef = mkNewAppRef();
EntityReference bRef = mkNewAppRef();
// create flow with unknown datatype
long unkId = dataTypeHelper.createUnknownDatatype();
LogicalFlow flow = lfHelper.createLogicalFlow(aRef, bRef);
lfHelper.createLogicalFlowDecorators(flow.entityReference(), asSet(unkId));
List<String> aResult = aipcSvc.calcLogicalFlowPreCheckFailures(aRef);
assertTrue(aResult.isEmpty(), "ok as unknown is outgoing");
List<String> bResult = aipcSvc.calcLogicalFlowPreCheckFailures(bRef);
assertFalse(bResult.isEmpty(), "should fail as unknown is incoming");
}
use of org.finos.waltz.model.EntityReference in project waltz by khartec.
the class AttestationPreCheckServiceTest method allowedToAttestAttestIfInExemptionGroupAndUnknownIncomingDataTypeFlows.
@Test
public void allowedToAttestAttestIfInExemptionGroupAndUnknownIncomingDataTypeFlows() throws InsufficientPrivelegeException {
EntityReference aRef = mkNewAppRef();
EntityReference bRef = mkNewAppRef();
// create flow with unknown datatype
long unkId = dataTypeHelper.createUnknownDatatype();
LogicalFlow flow = lfHelper.createLogicalFlow(aRef, bRef);
lfHelper.createLogicalFlowDecorators(flow.entityReference(), asSet(unkId));
createGroupWithApps(AttestationPreCheckDao.GROUP_LOGICAL_FLOW_ATTESTATION_EXEMPT_FROM_UNKNOWN_DATA_TYPE_CHECK, bRef);
List<String> bResult = aipcSvc.calcLogicalFlowPreCheckFailures(bRef);
assertTrue(bResult.isEmpty(), "should pass as target app is in exemption from unknown flows group");
}
use of org.finos.waltz.model.EntityReference in project waltz by khartec.
the class AttestationPreCheckServiceTest method notAllowedToAttestAttestIfDeprecatedIncomingDataTypeFlows.
@Test
public void notAllowedToAttestAttestIfDeprecatedIncomingDataTypeFlows() {
EntityReference aRef = mkNewAppRef();
EntityReference bRef = mkNewAppRef();
// create flow with deprecated datatype
long deprecatedTypeId = createDeprecatedDataType();
LogicalFlow flow = lfHelper.createLogicalFlow(aRef, bRef);
lfHelper.createLogicalFlowDecorators(flow.entityReference(), asSet(deprecatedTypeId));
List<String> aResult = aipcSvc.calcLogicalFlowPreCheckFailures(aRef);
assertTrue(aResult.isEmpty(), "ok as deprecated is outgoing");
List<String> bResult = aipcSvc.calcLogicalFlowPreCheckFailures(bRef);
assertFalse(bResult.isEmpty(), "should fail as deprecated is incoming");
}
use of org.finos.waltz.model.EntityReference in project waltz by khartec.
the class BookmarkServiceTest method bookmarksCanBeCreated.
@Test
public void bookmarksCanBeCreated() {
EntityReference bookmarkedEntity = mkAppRef();
Bookmark bookmark1 = createBookmark(bookmarkedEntity, "test bookmark1");
Bookmark bookmark2 = createBookmark(bookmarkedEntity, "test bookmark2");
List<Bookmark> bookmarks = svc.findByReference(bookmarkedEntity);
assertEquals(2, bookmarks.size());
assertTrue(bookmarks.contains(bookmark1));
assertTrue(bookmarks.contains(bookmark2));
}
use of org.finos.waltz.model.EntityReference in project waltz by khartec.
the class BookmarkServiceTest method bookmarksCanBeFoundBySelector.
@Test
public void bookmarksCanBeFoundBySelector() {
EntityReference appRef1 = mkAppRef();
EntityReference appRef2 = mkAppRef();
createBookmark(appRef1, "a");
createBookmark(appRef1, "b");
createBookmark(appRef2, "c");
Set<Bookmark> matches = svc.findByBookmarkIdSelector(mkOpts(appRef1, HierarchyQueryScope.EXACT));
assertEquals(2, matches.size());
assertEquals(asSet("a", "b"), SetUtilities.map(matches, m -> m.title().get()));
}
Aggregations