Search in sources :

Example 1 with DefaultTextPropertyProviderImpl

use of org.kie.workbench.common.stunner.core.client.canvas.controls.actions.DefaultTextPropertyProviderImpl in project kie-wb-common by kiegroup.

the class TextEditorBoxImplTest method init.

@Before
@SuppressWarnings("unchecked")
public void init() {
    this.textPropertyProvider = new DefaultTextPropertyProviderImpl(definitionUtils, canvasCommandFactory);
    when(element.getContent()).thenReturn(definition);
    when(definition.getDefinition()).thenReturn(objectDefinition);
    when(definitionUtils.getName(objectDefinition)).thenReturn(NAME);
    when(definitionUtils.getNameIdentifier(objectDefinition)).thenReturn(ID);
    when(commandProvider.getCommandManager()).thenReturn(canvasCommandManager);
    when(canvasHandler.getTextPropertyProviderFactory()).thenReturn(textPropertyProviderFactory);
    when(textPropertyProviderFactory.getProvider(any(Element.class))).thenReturn(textPropertyProvider);
    presenter = new TextEditorBoxImpl(view);
    presenter.setup();
    verify(view).init(presenter);
    presenter.initialize(canvasHandler, closeCallback);
    presenter.setCommandManagerProvider(commandProvider);
    presenter.getElement();
    verify(view).getElement();
    presenter.show(element);
    verify(view).show(NAME);
}
Also used : Element(org.kie.workbench.common.stunner.core.graph.Element) DefaultTextPropertyProviderImpl(org.kie.workbench.common.stunner.core.client.canvas.controls.actions.DefaultTextPropertyProviderImpl) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 DefaultTextPropertyProviderImpl (org.kie.workbench.common.stunner.core.client.canvas.controls.actions.DefaultTextPropertyProviderImpl)1 Element (org.kie.workbench.common.stunner.core.graph.Element)1