@Test public void testGetTitle() { final DefinitionManager definitionManager = mock(DefinitionManager.class); final AdapterManager adapters = mock(AdapterManager.class); final View content = mock(View.class); final Object definition = mock(Object.class); final String expectedTitle = "title"; when(definitionUtils.getDefinitionManager()).thenReturn(definitionManager); when(definitionManager.adapters()).thenReturn(adapters); when(adapters.forDefinition()).thenReturn(objectDefinitionAdapter); when(element.getContent()).thenReturn(content); when(content.getDefinition()).thenReturn(definition); when(objectDefinitionAdapter.getTitle(definition)).thenReturn(expectedTitle); final String actualTitle = factory.getTitle(element); assertEquals(expectedTitle, actualTitle); }
String getTitle(final Element<View> element) { final AdapterManager adapters = definitionUtils.getDefinitionManager().adapters(); final DefinitionAdapter<Object> objectDefinitionAdapter = adapters.forDefinition(); return objectDefinitionAdapter.getTitle(DefinitionUtils.getElementDefinition(element)); }
DecisionNavigatorBaseItemFactory { String getTitle(final Element<View> element) { final AdapterManager adapters = definitionUtils.getDefinitionManager().adapters(); final DefinitionAdapter<Object> objectDefinitionAdapter = adapters.forDefinition(); return objectDefinitionAdapter.getTitle(DefinitionUtils.getElementDefinition(element)); } }
DecisionNavigatorBaseItemFactory { String getTitle(final Element<View> element) { final AdapterManager adapters = definitionUtils.getDefinitionManager().adapters(); final DefinitionAdapter<Object> objectDefinitionAdapter = adapters.forDefinition(); return objectDefinitionAdapter.getTitle(DefinitionUtils.getElementDefinition(element)); } @Inject  DecisionNavigatorBaseItemFactory(final DecisionNavigatorNestedItemFactory nestedItemFactory,
                                            final TextPropertyProviderFactory textPropertyProviderFactory,
                                            final CanvasFocusUtils canvasFocusUtils,
                                            final DefinitionUtils definitionUtils,
                                            final TranslationService translationService,
                                            final DMNDiagramsSession dmnDiagramsSession,
                                            final LazyCanvasFocusUtils lazyCanvasFocusUtils,
                                            final Event<DMNDiagramSelected> selectedEvent); }
DecisionNavigatorBaseItemFactory { String getTitle(final Element<View> element) { final AdapterManager adapters = definitionUtils.getDefinitionManager().adapters(); final DefinitionAdapter<Object> objectDefinitionAdapter = adapters.forDefinition(); return objectDefinitionAdapter.getTitle(DefinitionUtils.getElementDefinition(element)); } @Inject  DecisionNavigatorBaseItemFactory(final DecisionNavigatorNestedItemFactory nestedItemFactory,
                                            final TextPropertyProviderFactory textPropertyProviderFactory,
                                            final CanvasFocusUtils canvasFocusUtils,
                                            final DefinitionUtils definitionUtils,
                                            final TranslationService translationService,
                                            final DMNDiagramsSession dmnDiagramsSession,
                                            final LazyCanvasFocusUtils lazyCanvasFocusUtils,
                                            final Event<DMNDiagramSelected> selectedEvent); DecisionNavigatorItem makeItem(final Node<View, Edge> node,
                                          final DecisionNavigatorItem.Type type); }
DecisionNavigatorBaseItemFactory { String getTitle(final Element<View> element) { final AdapterManager adapters = definitionUtils.getDefinitionManager().adapters(); final DefinitionAdapter<Object> objectDefinitionAdapter = adapters.forDefinition(); return objectDefinitionAdapter.getTitle(DefinitionUtils.getElementDefinition(element)); } @Inject  DecisionNavigatorBaseItemFactory(final DecisionNavigatorNestedItemFactory nestedItemFactory,
                                            final TextPropertyProviderFactory textPropertyProviderFactory,
                                            final CanvasFocusUtils canvasFocusUtils,
                                            final DefinitionUtils definitionUtils,
                                            final TranslationService translationService,
                                            final DMNDiagramsSession dmnDiagramsSession,
                                            final LazyCanvasFocusUtils lazyCanvasFocusUtils,
                                            final Event<DMNDiagramSelected> selectedEvent); DecisionNavigatorItem makeItem(final Node<View, Edge> node,
                                          final DecisionNavigatorItem.Type type);  }