@Test public void testDestroy() { final Decision drgElement1 = makeDecision("model1.tUUID", "string", true); final Decision drgElement2 = makeDecision("model1.imported person", "model1.tPerson", true); final InputData drgElement3 = makeInputData("local person", "model1.tPerson", false); final InputData drgElement4 = makeInputData("regular DRG Element", "boolean", false); final List<DRGElement> drgElements = asList(drgElement1, drgElement2, drgElement3, drgElement4); doNothing().when(handler).deleteDRGElement(any()); when(dmnGraphUtils.getModelDRGElements()).thenReturn(drgElements); handler.destroy("model1"); verify(handler).deleteDRGElement(drgElement1); verify(handler).deleteDRGElement(drgElement2); }
@Override public void destroy(final String oldModelName) { findDRGElementsByOldName(oldModelName).forEach(this::deleteDRGElement); }
DMNIncludedModelHandler implements DRGElementHandler { @Override public void destroy(final String oldModelName) { findDRGElementsByOldName(oldModelName).forEach(this::deleteDRGElement); } }
DMNIncludedModelHandler implements DRGElementHandler { @Override public void destroy(final String oldModelName) { findDRGElementsByOldName(oldModelName).forEach(this::deleteDRGElement); } @Inject  DMNIncludedModelHandler(final DMNGraphUtils dmnGraphUtils,
                                   final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
                                   final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
                                   final DefinitionUtils definitionUtils); }
DMNIncludedModelHandler implements DRGElementHandler { @Override public void destroy(final String oldModelName) { findDRGElementsByOldName(oldModelName).forEach(this::deleteDRGElement); } @Inject  DMNIncludedModelHandler(final DMNGraphUtils dmnGraphUtils,
                                   final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
                                   final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
                                   final DefinitionUtils definitionUtils); @Override void update(final String oldModelName,
                       final String newModelName); @Override void destroy(final String oldModelName); }
DMNIncludedModelHandler implements DRGElementHandler { @Override public void destroy(final String oldModelName) { findDRGElementsByOldName(oldModelName).forEach(this::deleteDRGElement); } @Inject  DMNIncludedModelHandler(final DMNGraphUtils dmnGraphUtils,
                                   final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
                                   final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
                                   final DefinitionUtils definitionUtils); @Override void update(final String oldModelName,
                       final String newModelName); @Override void destroy(final String oldModelName);  }