@Test public void test_addAnimationStep_IgnoresElementsThatDoNotExistInTheView() { SoftwareSystem element1 = model.addSoftwareSystem("Software System 1", ""); SoftwareSystem element2 = model.addSoftwareSystem("Software System 2", ""); SystemLandscapeView view = workspace.getViews().createSystemLandscapeView("key", "Description"); view.add(element1); view.addAnimation(element1, element2); Animation step1 = view.getAnimations().stream().filter(step -> step.getOrder() == 1).findFirst().get(); assertEquals(1, step1.getElements().size()); assertTrue(step1.getElements().contains(element1.getId())); }
@Test public void test_addElement_ThrowsAnException_WhenTheSpecifiedElementDoesNotExistInTheModel() { try { Workspace workspace = new Workspace("1", ""); SoftwareSystem softwareSystem = workspace.getModel().addSoftwareSystem("Software System", "Description"); SystemLandscapeView view = new Workspace("", "").getViews().createSystemLandscapeView("key", "Description"); view.add(softwareSystem); fail(); } catch (IllegalArgumentException iae) { assertEquals("The element named Software System does not exist in the model associated with this view.", iae.getMessage()); } }