databasesFolderPath + RepositoryFile.SEPARATOR + EXP_DBMETA_NAME + dotKdb ).build();
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 );
verify( repo ).updateFile( argThat( isLikeFile( new RepositoryFile.Builder( EXP_DBMETA_NAME + ".kdb" ).build() ) ),
argThat( hasData( pathPropertyPair( "/databaseMeta/HOST_NAME", EXP_UPDATED_DBMETA_HOSTNAME ) ) ), anyString() );
}