use of com.google.gwt.dev.util.collect.HashMap in project drools-wb by kiegroup.
the class BaseEnumSingleSelectUiColumnTest method setupEnums.
@SuppressWarnings("unchecked")
private void setupEnums(final String cellValue, final String... values) {
final Map<String, String> enums = new HashMap<>();
for (String value : values) {
enums.put(value, value);
}
doAnswer((InvocationOnMock invocation) -> {
final Callback<Map<String, String>> callback = (Callback<Map<String, String>>) invocation.getArguments()[3];
callback.callback(enums);
return null;
}).when(presenter).getEnumLookups(anyString(), anyString(), any(DependentEnumsUtilities.Context.class), any(Callback.class));
when(multiValueFactory.convert(eq(cellValue))).thenReturn(cellValue);
}
use of com.google.gwt.dev.util.collect.HashMap in project drools-wb by kiegroup.
the class ColumnsPagePresenterTest method testRefreshConditionsWidgetWhenConditionColumnsIsNotEmpty.
@Test
public void testRefreshConditionsWidgetWhenConditionColumnsIsNotEmpty() {
final ColumnManagementView columnManagementView = mock(ColumnManagementView.class);
final GuidedDecisionTableAccordionItem item = mock(GuidedDecisionTableAccordionItem.class);
final Label blankSlate = mock(Label.class);
final List<CompositeColumn<? extends BaseColumn>> conditions1 = new ArrayList<CompositeColumn<? extends BaseColumn>>() {
{
add(compositeColumn1);
}
};
final Map<String, List<BaseColumn>> conditions2 = new HashMap<String, List<BaseColumn>>() {
{
put("title", new ArrayList<>());
}
};
doReturn(verticalPanel).when(presenter).getConditionsWidget();
doReturn(columnManagementView).when(presenter).getConditionsPanel();
doReturn(blankSlate).when(presenter).blankSlate();
doReturn(item).when(accordion).getItem(CONDITION);
doReturn(conditions2).when(presenter).groupByTitle(conditions1);
presenter.refreshConditionsWidget(conditions1);
verify(item, never()).setOpen(false);
verify(verticalPanel, never()).add(blankSlate);
verify(verticalPanel).add(columnManagementView);
verify(columnManagementView).renderColumns(conditions2);
}
use of com.google.gwt.dev.util.collect.HashMap in project drools-wb by kiegroup.
the class ColumnsPagePresenterTest method testRefreshActionsWidgetWhenActionColumnsIsNotEmpty.
@Test
public void testRefreshActionsWidgetWhenActionColumnsIsNotEmpty() {
final ColumnManagementView columnManagementView = mock(ColumnManagementView.class);
final GuidedDecisionTableAccordionItem item = mock(GuidedDecisionTableAccordionItem.class);
final Label blankSlate = mock(Label.class);
final ActionCol52 actionCol52 = mock(ActionCol52.class);
final List<ActionCol52> actionColumns1 = new ArrayList<ActionCol52>() {
{
add(actionCol52);
}
};
final Map<String, List<BaseColumn>> actionColumns2 = new HashMap<String, List<BaseColumn>>() {
{
put("title", new ArrayList<>());
}
};
doReturn(verticalPanel).when(presenter).getActionsWidget();
doReturn(columnManagementView).when(presenter).getActionsPanel();
doReturn(blankSlate).when(presenter).blankSlate();
doReturn(item).when(accordion).getItem(ACTION);
doReturn(actionColumns2).when(presenter).groupByTitle(actionColumns1);
presenter.refreshActionsWidget(actionColumns1);
verify(item, never()).setOpen(false);
verify(verticalPanel, never()).add(blankSlate);
verify(verticalPanel).add(columnManagementView);
verify(columnManagementView).renderColumns(actionColumns2);
}
Aggregations