Search in sources :

Example 1 with CollapsedPaletteDefinitionBuilder

use of org.kie.workbench.common.stunner.core.client.components.palette.CollapsedPaletteDefinitionBuilder in project kie-wb-common by kiegroup.

the class DMNPaletteDefinitionBuilderTest method setup.

@Before
@SuppressWarnings("unchecked")
public void setup() {
    collapsedPaletteBuilder = spy(new CollapsedPaletteDefinitionBuilder(definitionUtils, clientFactoryServices, translationService));
    doAnswer(new Answer() {

        @Override
        public Object answer(InvocationOnMock invocationOnMock) throws Throwable {
            Consumer<DefaultPaletteDefinition> c = (Consumer<DefaultPaletteDefinition>) invocationOnMock.getArguments()[1];
            c.accept(paletteDefinition);
            return null;
        }
    }).when(collapsedPaletteBuilder).build(eq(canvasHandler), any(Consumer.class));
    tested = new DMNPaletteDefinitionBuilder(collapsedPaletteBuilder);
    tested.init();
}
Also used : CollapsedPaletteDefinitionBuilder(org.kie.workbench.common.stunner.core.client.components.palette.CollapsedPaletteDefinitionBuilder) Answer(org.mockito.stubbing.Answer) Mockito.doAnswer(org.mockito.Mockito.doAnswer) Consumer(java.util.function.Consumer) InvocationOnMock(org.mockito.invocation.InvocationOnMock) DefaultPaletteDefinition(org.kie.workbench.common.stunner.core.client.components.palette.DefaultPaletteDefinition) Before(org.junit.Before)

Aggregations

Consumer (java.util.function.Consumer)1 Before (org.junit.Before)1 CollapsedPaletteDefinitionBuilder (org.kie.workbench.common.stunner.core.client.components.palette.CollapsedPaletteDefinitionBuilder)1 DefaultPaletteDefinition (org.kie.workbench.common.stunner.core.client.components.palette.DefaultPaletteDefinition)1 Mockito.doAnswer (org.mockito.Mockito.doAnswer)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1 Answer (org.mockito.stubbing.Answer)1