Search in sources :

Example 1 with DataSourceDefEditorHelper

use of org.kie.workbench.common.screens.datasource.management.client.editor.datasource.DataSourceDefEditorHelper in project kie-wb-common by kiegroup.

the class DataSourceWizardTestBase method setup.

/**
 * Initializes the services, the wizard pages, and drivers information.
 */
protected void setup() {
    // initialize the services
    editorServiceCaller = new CallerMock<>(editorService);
    queryServiceCaller = new CallerMock<>(queryService);
    // initialize the wizard page
    mainPanel = new DataSourceDefMainPanel(mainPanelView);
    dataSourceDef = new DataSourceDef();
    editorHelper = new DataSourceDefEditorHelper(translationService, editorServiceCaller, queryServiceCaller, new ClientValidationServiceMock(), popupsUtil);
    defPage = new DataSourceDefPage(view, mainPanel, editorHelper, statusChangeEvent);
    defPage.setDataSourceDef(dataSourceDef);
    // prepare the drivers info
    drivers = new ArrayList<>();
    drivers.add(driver1);
    drivers.add(driver2);
    options = new ArrayList<>();
    options.add(new Pair("Driver1.name", DRIVER_UUID));
    options.add(new Pair("Driver2.name", DRIVER_UUID_2));
    when(driver1.getName()).thenReturn("Driver1.name");
    when(driver1.getUuid()).thenReturn(DRIVER_UUID);
    when(driver2.getName()).thenReturn("Driver2.name");
    when(driver2.getUuid()).thenReturn(DRIVER_UUID_2);
    // emulates the service returning the requested drivers.
    when(queryService.findModuleDrivers(path)).thenReturn(drivers);
    when(queryService.findGlobalDrivers()).thenReturn(drivers);
}
Also used : DataSourceDef(org.kie.workbench.common.screens.datasource.management.model.DataSourceDef) DataSourceDefMainPanel(org.kie.workbench.common.screens.datasource.management.client.editor.datasource.DataSourceDefMainPanel) DataSourceDefEditorHelper(org.kie.workbench.common.screens.datasource.management.client.editor.datasource.DataSourceDefEditorHelper) ClientValidationServiceMock(org.kie.workbench.common.screens.datasource.management.client.util.ClientValidationServiceMock) Pair(org.uberfire.commons.data.Pair)

Aggregations

DataSourceDefEditorHelper (org.kie.workbench.common.screens.datasource.management.client.editor.datasource.DataSourceDefEditorHelper)1 DataSourceDefMainPanel (org.kie.workbench.common.screens.datasource.management.client.editor.datasource.DataSourceDefMainPanel)1 ClientValidationServiceMock (org.kie.workbench.common.screens.datasource.management.client.util.ClientValidationServiceMock)1 DataSourceDef (org.kie.workbench.common.screens.datasource.management.model.DataSourceDef)1 Pair (org.uberfire.commons.data.Pair)1