public final void addDependentSoftwareSystems() { getModel().getSoftwareSystems().stream() .filter(softwareSystem -> softwareSystem.hasEfferentRelationshipWith(this.getSoftwareSystem())) .forEach(this::add); }
/** * <p>Adds all {@link com.structurizr.model.Container}s of the given {@link ContainerView} as well as all external influencers, that is all * persons and all other software systems with incoming or outgoing dependencies.</p> * <p>Additionally, all relationships of external dependencies are omitted to keep the diagram clean</p> */ public final void addAllInfluencers() { // add all software systems with incoming or outgoing dependencies getModel().getSoftwareSystems() .stream() .filter(softwareSystem -> softwareSystem.hasEfferentRelationshipWith(getSoftwareSystem()) || getSoftwareSystem().hasEfferentRelationshipWith(softwareSystem)) .forEach(this::add); // then add all people with incoming or outgoing dependencies getModel().getPeople() .stream() .filter(person -> person.hasEfferentRelationshipWith(getSoftwareSystem()) || getSoftwareSystem().hasEfferentRelationshipWith(person)) .forEach(this::add); // then remove all relationships of external elements to keep the container view clean getRelationships() .stream() .map(view -> view.getRelationship()) .filter(relationship -> !isPartOf(relationship.getDestination(), getSoftwareSystem()) && !isPartOf(relationship.getSource(), getSoftwareSystem())) .forEach(this::remove); }
@Test public void test_construction() { assertEquals("The System - Containers", view.getName()); assertEquals("Description", view.getDescription()); assertEquals(0, view.getElements().size()); assertSame(softwareSystem, view.getSoftwareSystem()); assertEquals(softwareSystem.getId(), view.getSoftwareSystemId()); assertSame(model, view.getModel()); }
assertSame(softwareSystem, systemContextView.getElementView(softwareSystem).getElement()); assertSame(model, containerView.getModel()); assertSame(views, containerView.getViewSet()); assertSame(softwareSystem, containerView.getSoftwareSystem());