@Test public void testInit() { final Graph graph = mock(Graph.class); final Node node = mock(Node.class); final Definition definition = mock(Definition.class); final HasContentDefinitionId hasContentDefinitionId = mock(HasContentDefinitionId.class); final String definitionId = "definition id"; final String dmnDiagramId = "dmn diagram id"; when(node.getContent()).thenReturn(definition); when(definition.getDefinition()).thenReturn(hasContentDefinitionId); when(hasContentDefinitionId.getContentDefinitionId()).thenReturn(definitionId); when(hasContentDefinitionId.getDiagramId()).thenReturn(dmnDiagramId); this.tested = new SafeDeleteNodeProcessor(new ChildrenTraverseProcessorImpl(new TreeWalkTraverseProcessorImpl()), graph, node); tested.init(); final String candidateContentDefinitionId = tested.getCandidateContentDefinitionId(); final String candidateDmnDiagramId = tested.getCandidateDiagramId(); assertEquals(definitionId, candidateContentDefinitionId); assertEquals(dmnDiagramId, candidateDmnDiagramId); }
void init() { this.candidateContentDefinitionId = getContentDefinitionId(candidate); this.candidateDiagramId = getDiagramId(candidate); }
SafeDeleteNodeProcessor { void init() { this.candidateContentDefinitionId = getContentDefinitionId(candidate); this.candidateDiagramId = getDiagramId(candidate); } }
SafeDeleteNodeProcessor { void init() { this.candidateContentDefinitionId = getContentDefinitionId(candidate); this.candidateDiagramId = getDiagramId(candidate); } SafeDeleteNodeProcessor(final ChildrenTraverseProcessor childrenTraverseProcessor,
                                   final Graph graph,
                                   final Node<Definition<?>, Edge> candidate);  SafeDeleteNodeProcessor(final ChildrenTraverseProcessor childrenTraverseProcessor,
                                   final Graph graph,
                                   final Node<Definition<?>, Edge> candidate,
                                   final boolean keepChildren,
                                   final TreeWalkTraverseProcessor treeWalkTraverseProcessor,
                                   final GraphsProvider graphsProvider); }
SafeDeleteNodeProcessor { void init() { this.candidateContentDefinitionId = getContentDefinitionId(candidate); this.candidateDiagramId = getDiagramId(candidate); } SafeDeleteNodeProcessor(final ChildrenTraverseProcessor childrenTraverseProcessor,
                                   final Graph graph,
                                   final Node<Definition<?>, Edge> candidate);  SafeDeleteNodeProcessor(final ChildrenTraverseProcessor childrenTraverseProcessor,
                                   final Graph graph,
                                   final Node<Definition<?>, Edge> candidate,
                                   final boolean keepChildren,
                                   final TreeWalkTraverseProcessor treeWalkTraverseProcessor,
                                   final GraphsProvider graphsProvider); @SuppressWarnings("unchecked") void run(final Callback callback); String getCandidateDiagramId(); String getCandidateContentDefinitionId(); }
SafeDeleteNodeProcessor { void init() { this.candidateContentDefinitionId = getContentDefinitionId(candidate); this.candidateDiagramId = getDiagramId(candidate); } SafeDeleteNodeProcessor(final ChildrenTraverseProcessor childrenTraverseProcessor,
                                   final Graph graph,
                                   final Node<Definition<?>, Edge> candidate);  SafeDeleteNodeProcessor(final ChildrenTraverseProcessor childrenTraverseProcessor,
                                   final Graph graph,
                                   final Node<Definition<?>, Edge> candidate,
                                   final boolean keepChildren,
                                   final TreeWalkTraverseProcessor treeWalkTraverseProcessor,
                                   final GraphsProvider graphsProvider); @SuppressWarnings("unchecked") void run(final Callback callback); String getCandidateDiagramId(); String getCandidateContentDefinitionId();  }