Skip to content

Workspace.trim() is not correctly removing relationships when the destination of a relationship is removed from the workspace #306

@simonbrowndotje

Description

@simonbrowndotje

Description

When workspace.trim() removes an element, relationships to that element are left in the model.

Steps to reproduce

Test case:

    @Test
    void trim_WhenTheDestinationOfAnElementIsRemoved() {
        Workspace workspace = new Workspace("Name", "Description");
        SoftwareSystem a = workspace.getModel().addSoftwareSystem("A");
        SoftwareSystem b = workspace.getModel().addSoftwareSystem("B");
        a.uses(b, "Uses");

        SystemLandscapeView view = workspace.getViews().createSystemLandscapeView("key", "Description");
        view.add(a);

        workspace.trim();

        assertEquals(0, a.getRelationships().size());
    }

Screenshot

No response

Code sample

No response

Configuration

No response

Severity

Minor

Priority

I'm willing to fix this myself and raise a PR (please confirm approach first)

More information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions