doReturn( f ).when( repo ).getFile( databasesFolderPath + RepositoryFile.SEPARATOR + EXP_DBMETA_NAME + dotKdb );
// stub out update file which requires a file to be returned
doReturn( f ).when( repo )
.updateFile( any( RepositoryFile.class ), any( NodeRepositoryFileData.class ), anyString() );
IDatasourceMgmtService datasourceMgmtService =
new JcrBackedDatasourceMgmtService( repo, new DatabaseDialectService() );
IDatabaseConnection databaseConnection = createDatabaseConnection( EXP_DBMETA_NAME );
updateDatabaseConnection( databaseConnection );
datasourceMgmtService.updateDatasourceByName( EXP_DBMETA_NAME, databaseConnection );