Search in sources :

Example 1 with ParameterItem

use of org.kie.workbench.common.dmn.client.widgets.decisionservice.parameters.parametergroup.ParameterGroup.ParameterItem in project kie-wb-common by kiegroup.

the class ParameterGroupTest method testAddParameter.

@Test
public void testAddParameter() {
    final String name = "name";
    final String type = "type";
    final HTMLElement htmlElement = mock(HTMLElement.class);
    final ParameterItem parameterItem = mock(ParameterItem.class);
    final elemental2.dom.HTMLElement element = mock(elemental2.dom.HTMLElement.class);
    doReturn(parameterItem).when(parameterGroup).createParameterItem();
    when(parameterItem.getElement()).thenReturn(htmlElement);
    when(util.asHTMLElement(htmlElement)).thenReturn(element);
    parameterGroup.addParameter(name, type);
    verify(util).asHTMLElement(htmlElement);
    verify(parameters).appendChild(element);
    verify(parameterGroup).refreshNone();
    assertFalse(parameterGroup.isEmpty());
}
Also used : ParameterItem(org.kie.workbench.common.dmn.client.widgets.decisionservice.parameters.parametergroup.ParameterGroup.ParameterItem) HTMLElement(org.jboss.errai.common.client.dom.HTMLElement) Test(org.junit.Test)

Aggregations

HTMLElement (org.jboss.errai.common.client.dom.HTMLElement)1 Test (org.junit.Test)1 ParameterItem (org.kie.workbench.common.dmn.client.widgets.decisionservice.parameters.parametergroup.ParameterGroup.ParameterItem)1