/** Tests the resync of a data source. */
  @Test
  public void testDataSourceResync() throws Exception {
    when(managementClient.getDataSources()).thenReturn(wfDataSources);
    when(dataSourceDeploymentInfo.getJndi()).thenReturn(DS1_JNID);
    when(dataSourceDeploymentInfo.getDeploymentId()).thenReturn(DS1_DEPLOYMENT_ID);

    DataSourceDeploymentInfo deploymentInfo = dataSourceProvider.getDeploymentInfo(DS1_UUID);

    // the data source deployment info should exist, but it's not managed.
    assertNotNull(deploymentInfo);
    assertFalse(deploymentInfo.isManaged());

    dataSourceProvider.resync(dataSourceDef, dataSourceDeploymentInfo);
    deploymentInfo = dataSourceProvider.getDeploymentInfo(DS1_UUID);
    // after the resync the data source should have been tagged as managed.
    assertNotNull(deploymentInfo);
    assertTrue(deploymentInfo.isManaged());
  }
 @Override
 protected void deployDataSource(DataSourceDef dataSourceDef) throws Exception {
   when(managementClient.getDataSources()).thenReturn(wfDataSources);
   dataSourceProvider.deploy(dataSourceDef);
 }