Search in sources :

Example 1 with ScalablePanel

use of com.ait.lienzo.client.widget.panel.impl.ScalablePanel in project kie-wb-common by kiegroup.

the class ScalableLienzoPanelTest method testInit.

@Test
@SuppressWarnings("unchecked")
public void testInit() {
    tested.init();
    ArgumentCaptor<BiFunction> builderCaptor = ArgumentCaptor.forClass(BiFunction.class);
    verify(panel, times(1)).setPanelBuilder(builderCaptor.capture());
    BiFunction<OptionalInt, OptionalInt, LienzoBoundsPanel> builder = builderCaptor.getValue();
    LienzoBoundsPanel result = builder.apply(OptionalInt.of(300), OptionalInt.of(450));
    assertTrue(result instanceof ScalablePanel);
    assertEquals(300, result.getWidthPx());
    assertEquals(450, result.getHeightPx());
}
Also used : BiFunction(java.util.function.BiFunction) LienzoBoundsPanel(com.ait.lienzo.client.widget.panel.LienzoBoundsPanel) OptionalInt(java.util.OptionalInt) ScalablePanel(com.ait.lienzo.client.widget.panel.impl.ScalablePanel) Test(org.junit.Test)

Aggregations

LienzoBoundsPanel (com.ait.lienzo.client.widget.panel.LienzoBoundsPanel)1 ScalablePanel (com.ait.lienzo.client.widget.panel.impl.ScalablePanel)1 OptionalInt (java.util.OptionalInt)1 BiFunction (java.util.function.BiFunction)1 Test (org.junit.Test)1