Search in sources :

Example 1 with DMNDeleteElementsGraphCommand

use of org.kie.workbench.common.dmn.client.commands.factory.graph.DMNDeleteElementsGraphCommand in project kie-wb-common by kiegroup.

the class DMNDeleteElementsCommandTest method testNewGraphCommand.

@Test
public void testNewGraphCommand() {
    final DMNGraphsProvider selectedDiagramProvider = mock(DMNGraphsProvider.class);
    final ArrayList<Element> elements = new ArrayList<>();
    final Element element = mock(Element.class);
    when(element.getUUID()).thenReturn("uuid");
    elements.add(element);
    final DMNDeleteElementsCommand cmd = new DMNDeleteElementsCommand(elements, selectedDiagramProvider);
    final Command<GraphCommandExecutionContext, RuleViolation> actual = cmd.newGraphCommand(null);
    assertTrue(actual instanceof DMNDeleteElementsGraphCommand);
    assertEquals(cmd.getGraphsProvider(), ((DMNDeleteElementsGraphCommand) actual).getGraphsProvider());
}
Also used : Element(org.kie.workbench.common.stunner.core.graph.Element) ArrayList(java.util.ArrayList) GraphCommandExecutionContext(org.kie.workbench.common.stunner.core.graph.command.GraphCommandExecutionContext) RuleViolation(org.kie.workbench.common.stunner.core.rule.RuleViolation) DMNDeleteElementsGraphCommand(org.kie.workbench.common.dmn.client.commands.factory.graph.DMNDeleteElementsGraphCommand) DMNGraphsProvider(org.kie.workbench.common.dmn.client.docks.navigator.drds.DMNGraphsProvider) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1 DMNDeleteElementsGraphCommand (org.kie.workbench.common.dmn.client.commands.factory.graph.DMNDeleteElementsGraphCommand)1 DMNGraphsProvider (org.kie.workbench.common.dmn.client.docks.navigator.drds.DMNGraphsProvider)1 Element (org.kie.workbench.common.stunner.core.graph.Element)1 GraphCommandExecutionContext (org.kie.workbench.common.stunner.core.graph.command.GraphCommandExecutionContext)1 RuleViolation (org.kie.workbench.common.stunner.core.rule.RuleViolation)1