use of org.kie.workbench.common.screens.datasource.management.backend.integration.wildfly.WildflyDataSourceDef in project kie-wb-common by kiegroup.
the class WildflyDataSourceProviderTest method testDeployDataSource.
@Override
public void testDeployDataSource() throws Exception {
super.testDeployDataSource();
// additional check
// expected WF data source definition that should be created in the WF server.
WildflyDataSourceDef wfDataSource = new WildflyDataSourceDef();
wfDataSource.setName(DeploymentIdGenerator.generateDeploymentId(dataSourceDef));
wfDataSource.setConnectionURL(dataSourceDef.getConnectionURL());
wfDataSource.setUser(dataSourceDef.getUser());
wfDataSource.setPassword(dataSourceDef.getPassword());
wfDataSource.setDriverName(DRIVER1_DEPLOYMENT_ID);
wfDataSource.setJndi(JndiNameGenerator.generateJNDIName(dataSourceDef));
// the expected WF data source definition should have been created in the WF server.
ArgumentCaptor<WildflyDataSourceDef> argumentCaptor = ArgumentCaptor.forClass(WildflyDataSourceDef.class);
verify(managementClient, times(1)).createDataSource(argumentCaptor.capture());
if (!areTheSame(wfDataSource, argumentCaptor.getValue())) {
fail("Data source definition wasn't properly created in the WF server: " + wfDataSource);
}
}
Aggregations