Search in sources :

Example 21 with DataObject

use of org.kie.workbench.common.dmn.api.editors.types.DataObject in project kie-wb-common by kiegroup.

the class ImportDataObjectModalTest method testOnDataObjectSelectionChangedAndHasDuplicatedName.

@Test
public void testOnDataObjectSelectionChangedAndHasDuplicatedName() {
    final String name1 = "name1";
    final String name2 = "name2";
    final String name3 = "name3";
    final List<String> existingDataTypes = Arrays.asList(name1, name2, name3);
    final DataObject do1 = createDataObject(name1);
    final DataObject do2 = createDataObject(name2);
    final DataObject do3 = createDataObject(name3);
    final List<DataObject> dataObjects = Arrays.asList(do1, do2, do3);
    doReturn(existingDataTypes).when(modal).getExistingDataTypes();
    modal.onDataObjectSelectionChanged(dataObjects);
    verify(view).showDataTypeWithSameNameWarning();
    verify(view, never()).hideDataTypeWithSameNameWarning();
}
Also used : DataObject(org.kie.workbench.common.dmn.api.editors.types.DataObject) Test(org.junit.Test)

Aggregations

DataObject (org.kie.workbench.common.dmn.api.editors.types.DataObject)21 Test (org.junit.Test)13 TreeListItem (org.kie.workbench.common.dmn.client.editors.types.imported.treelist.TreeListItem)5 DataType (org.kie.workbench.common.dmn.client.editors.types.common.DataType)4 DataObjectProperty (org.kie.workbench.common.dmn.api.editors.types.DataObjectProperty)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Consumer (java.util.function.Consumer)1 ModuleDataModelOracle (org.kie.soup.project.datamodel.oracle.ModuleDataModelOracle)1 BuiltInType (org.kie.workbench.common.dmn.api.property.dmn.types.BuiltInType)1 KieModule (org.kie.workbench.common.services.shared.project.KieModule)1 ServiceCallback (org.kie.workbench.common.stunner.core.client.service.ServiceCallback)1