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);
}
Aggregations