@Test public void testGetNameWithNodeImpl() { final NodeImpl<View> node = new NodeImpl<>("uuid"); final TextPropertyProvider textPropertyProvider = mock(TextPropertyProvider.class); final String expectedNodeName = "Decision-1"; when(textPropertyProviderFactory.getProvider(node)).thenReturn(textPropertyProvider); when(textPropertyProvider.getText(node)).thenReturn(expectedNodeName); final String actualNodeName = utils.getName(node); assertEquals(expectedNodeName, actualNodeName); }
public Optional<String> getName(final AbstractCanvasHandlerElementEvent event) { final Element<?> element = event.getElement(); if (element instanceof NodeImpl) { return Optional.ofNullable(getName(element)); } return Optional.empty(); }
GuidedTourUtils { public Optional<String> getName(final AbstractCanvasHandlerElementEvent event) { final Element<?> element = event.getElement(); if (element instanceof NodeImpl) { return Optional.ofNullable(getName(element)); } return Optional.empty(); } }
GuidedTourUtils { public Optional<String> getName(final AbstractCanvasHandlerElementEvent event) { final Element<?> element = event.getElement(); if (element instanceof NodeImpl) { return Optional.ofNullable(getName(element)); } return Optional.empty(); } @Inject  GuidedTourUtils(final TextPropertyProviderFactory textPropertyProviderFactory); }
GuidedTourUtils { public Optional<String> getName(final AbstractCanvasHandlerElementEvent event) { final Element<?> element = event.getElement(); if (element instanceof NodeImpl) { return Optional.ofNullable(getName(element)); } return Optional.empty(); } @Inject  GuidedTourUtils(final TextPropertyProviderFactory textPropertyProviderFactory); Optional<String> getName(final AbstractCanvasHandlerElementEvent event); String getName(final Element<?> element); String getName(final NodeImpl<View> node); @SuppressWarnings("unchecked") NodeImpl<View> asNodeImpl(final Element<?> element); }
GuidedTourUtils { public Optional<String> getName(final AbstractCanvasHandlerElementEvent event) { final Element<?> element = event.getElement(); if (element instanceof NodeImpl) { return Optional.ofNullable(getName(element)); } return Optional.empty(); } @Inject  GuidedTourUtils(final TextPropertyProviderFactory textPropertyProviderFactory); Optional<String> getName(final AbstractCanvasHandlerElementEvent event); String getName(final Element<?> element); String getName(final NodeImpl<View> node); @SuppressWarnings("unchecked") NodeImpl<View> asNodeImpl(final Element<?> element);  }