@Test @SuppressWarnings("unchecked") public void testBind() throws Exception { tested.bind(mock(ClientSession.class)); final ArgumentCaptor<Predicate> elementAcceptorCaptor = ArgumentCaptor.forClass(Predicate.class); verify(generateSelectedFormsSessionCommand, times(1)).setElementAcceptor(elementAcceptorCaptor.capture()); final Predicate<Element> elemementAcceptor = elementAcceptorCaptor.getValue(); assertNotNull(elemementAcceptor); final Element element = mock(Element.class); final Node node = mock(Node.class); final View view = mock(View.class); when(element.asNode()).thenReturn(node); when(element.getContent()).thenReturn(view); when(view.getDefinition()).thenReturn(mock(BaseUserTask.class)); assertTrue(elemementAcceptor.test(element)); when(view.getDefinition()).thenReturn(mock(BaseTask.class)); assertFalse(elemementAcceptor.test(element)); }
@Override public EditorSessionCommands bind(final ClientSession session) { super.bind(session); getGenerateSelectedFormsSessionCommand() .setElementAcceptor(BPMNFormsContextUtils::isFormGenerationSupported); return this; }
AbstractProcessEditorSessionCommands extends EditorSessionCommands { @Override public EditorSessionCommands bind(final ClientSession session) { super.bind(session); getGenerateSelectedFormsSessionCommand() .setElementAcceptor(BPMNFormsContextUtils::isFormGenerationSupported); return this; } }
AbstractProcessEditorSessionCommands extends EditorSessionCommands { @Override public EditorSessionCommands bind(final ClientSession session) { super.bind(session); getGenerateSelectedFormsSessionCommand() .setElementAcceptor(BPMNFormsContextUtils::isFormGenerationSupported); return this; } AbstractProcessEditorSessionCommands(ManagedClientSessionCommands commands); }
AbstractProcessEditorSessionCommands extends EditorSessionCommands { @Override public EditorSessionCommands bind(final ClientSession session) { super.bind(session); getGenerateSelectedFormsSessionCommand() .setElementAcceptor(BPMNFormsContextUtils::isFormGenerationSupported); return this; } AbstractProcessEditorSessionCommands(ManagedClientSessionCommands commands); @Override EditorSessionCommands bind(final ClientSession session); GenerateProcessFormsSessionCommand getGenerateProcessFormsSessionCommand(); GenerateDiagramFormsSessionCommand getGenerateDiagramFormsSessionCommand(); GenerateSelectedFormsSessionCommand getGenerateSelectedFormsSessionCommand(); }
AbstractProcessEditorSessionCommands extends EditorSessionCommands { @Override public EditorSessionCommands bind(final ClientSession session) { super.bind(session); getGenerateSelectedFormsSessionCommand() .setElementAcceptor(BPMNFormsContextUtils::isFormGenerationSupported); return this; } AbstractProcessEditorSessionCommands(ManagedClientSessionCommands commands); @Override EditorSessionCommands bind(final ClientSession session); GenerateProcessFormsSessionCommand getGenerateProcessFormsSessionCommand(); GenerateDiagramFormsSessionCommand getGenerateDiagramFormsSessionCommand(); GenerateSelectedFormsSessionCommand getGenerateSelectedFormsSessionCommand();  }