@Override
  public String getURL( String hostname, String port, String databaseName ) {
    if ( Arrays.asList( PROFILE_CREDENTIALS, IAM_CREDENTIALS ).contains( getAttribute( JDBC_AUTH_METHOD, "" ) ) ) {
      return "jdbc:redshift:iam://" + hostname + ":" + port + "/" + databaseName;
    } else {
      return "jdbc:redshift://" + hostname + ":" + port + "/" + databaseName;
    }
  }
@Test
  public void testGetURL() throws Exception {
    assertEquals( "jdbc:redshift://:/", dbMeta.getURL( "", "", "" ) );
    assertEquals( "jdbc:redshift://rs.pentaho.com:4444/myDB",
      dbMeta.getURL( "rs.pentaho.com", "4444", "myDB" ) );
    dbMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_NATIVE );
    dbMeta.addAttribute( JDBC_AUTH_METHOD, IAM_CREDENTIALS );
    dbMeta.addAttribute( IAM_ACCESS_KEY_ID, Encr.encryptPassword( "myid" ) );
    dbMeta.addAttribute( IAM_SECRET_ACCESS_KEY, Encr.encryptPassword( "mysecretkey" ) );
    dbMeta.addAttribute( IAM_SESSION_TOKEN, Encr.encryptPassword( "mytoken" ) );
    assertEquals(
      "jdbc:redshift:iam://amazonhost:12345/foodmart",
      dbMeta.getURL( "amazonhost", "12345", "foodmart" ) );
    HashMap<String, String> optionalOptions = new HashMap<>();
    dbMeta.putOptionalOptions( optionalOptions );
    assertEquals( "myid", optionalOptions.get( "REDSHIFT.AccessKeyID" ) );
    assertEquals( "mysecretkey", optionalOptions.get( "REDSHIFT.SecretAccessKey" ) );
    assertEquals( "mytoken", optionalOptions.get( "REDSHIFT.SessionToken" ) );
    dbMeta.addAttribute( JDBC_AUTH_METHOD, PROFILE_CREDENTIALS );
    dbMeta.addAttribute( IAM_PROFILE_NAME, "super" );
    optionalOptions.clear();
    dbMeta.putOptionalOptions( optionalOptions );
    assertEquals( "super", optionalOptions.get( "REDSHIFT.Profile" ) );
  }