@Test public void testHasStartedWithError2() throws Exception { when(managementClient.testConnection()).thenReturn(METHOD_EXECUTION_OK); when(managementClient.getDataSources()).thenThrow(new Exception(METHOD_EXECUTION_FAILED)); expectedException.expectMessage(METHOD_EXECUTION_FAILED); dataSourceProvider.hasStarted(); verify(managementClient, times(1)).testConnection(); verify(managementClient, times(1)).getDataSources(); }
@Override public void hasStarted() throws Exception { dataSourceMgmtClient.testConnection(); dataSourceMgmtClient.getDataSources(); }
WildflyDataSourceProvider implements DataSourceProvider { @Override public void hasStarted() throws Exception { dataSourceMgmtClient.testConnection(); dataSourceMgmtClient.getDataSources(); } }
WildflyDataSourceProvider implements DataSourceProvider { @Override public void hasStarted() throws Exception { dataSourceMgmtClient.testConnection(); dataSourceMgmtClient.getDataSources(); } WildflyDataSourceProvider(); @Inject  WildflyDataSourceProvider(WildflyDriverProvider driverProvider); }
WildflyDataSourceProvider implements DataSourceProvider { @Override public void hasStarted() throws Exception { dataSourceMgmtClient.testConnection(); dataSourceMgmtClient.getDataSources(); } WildflyDataSourceProvider(); @Inject  WildflyDataSourceProvider(WildflyDriverProvider driverProvider); @Override List< DataSourceDef > getDeployments(); @Override DataSourceDeploymentInfo deploy(DataSourceDef dataSourceDef); DataSourceDeploymentInfo resync(DataSourceDef dataSourceDef,
                                           DataSourceDeploymentInfo deploymentInfo); @Override void undeploy(final DataSourceDeploymentInfo deploymentInfo); DataSourceDeploymentInfo getDeploymentInfo(final String uuid); List< DataSourceDeploymentInfo > getDeploymentsInfo(); @Override DataSource lookupDataSource(DataSourceDeploymentInfo deploymentInfo); @Override void loadConfig(Properties properties); @Override void hasStarted(); void setDataSourceMgmtClient(WildflyDataSourceManagementClient dataSourceMgmtClient); }
WildflyDataSourceProvider implements DataSourceProvider { @Override public void hasStarted() throws Exception { dataSourceMgmtClient.testConnection(); dataSourceMgmtClient.getDataSources(); } WildflyDataSourceProvider(); @Inject  WildflyDataSourceProvider(WildflyDriverProvider driverProvider); @Override List< DataSourceDef > getDeployments(); @Override DataSourceDeploymentInfo deploy(DataSourceDef dataSourceDef); DataSourceDeploymentInfo resync(DataSourceDef dataSourceDef,
                                           DataSourceDeploymentInfo deploymentInfo); @Override void undeploy(final DataSourceDeploymentInfo deploymentInfo); DataSourceDeploymentInfo getDeploymentInfo(final String uuid); List< DataSourceDeploymentInfo > getDeploymentsInfo(); @Override DataSource lookupDataSource(DataSourceDeploymentInfo deploymentInfo); @Override void loadConfig(Properties properties); @Override void hasStarted(); void setDataSourceMgmtClient(WildflyDataSourceManagementClient dataSourceMgmtClient);  }