@VisibleForTesting
  static void configureDataSource( BasicDataSource ds, DatabaseMeta databaseMeta, String partitionId,
      int initialSize, int maximumSize ) throws KettleDatabaseException {
    // substitute variables and populate pool properties; add credentials
    Properties connectionPoolProperties = new Properties( databaseMeta.getConnectionPoolingProperties() );
    connectionPoolProperties = environmentSubstitute( connectionPoolProperties, databaseMeta );
    setPoolProperties( ds, connectionPoolProperties, initialSize, maximumSize );
    setCredentials( ds, databaseMeta, partitionId );

    // add url/driver class
    String url = databaseMeta.environmentSubstitute( databaseMeta.getURL( partitionId ) );
    ds.setUrl( url );
    String clazz = databaseMeta.getDriverClass();
    if ( databaseMeta.getDatabaseInterface() != null ) {
      ds.setDriverClassLoader( databaseMeta.getDatabaseInterface().getClass().getClassLoader() );
    }
    ds.setDriverClassName( clazz );
    dataSourcesAttributesMap.put( getDataSourceName( databaseMeta, partitionId ), databaseMeta.getAttributes() );
  }
@Test
  public void testConfigureDataSourceWhenNoDatabaseInterface() throws KettleDatabaseException {
    when( dbMeta.getDatabaseInterface() ).thenReturn( null );
    ConnectionPoolUtil.configureDataSource(
      dataSource, dbMeta, "partId", INITIAL_SIZE, MAX_SIZE );
    verify( dataSource, never() ).setDriverClassLoader( any( ClassLoader.class ) );
  }