// Path: provider/src/main/java/com/cloudera/director/aws/STSAssumeNRolesSessionCredentialsProvider.java
// static public class RoleConfiguration {
//   private final String roleArn;
//   private final String roleSessionName;
//   private final String roleExternalId;
// 
//   /**
//    * Creates an instance of role configuration.
//    *
//    * @param roleArn         role Arn
//    * @param roleSessionName role session name
//    */
//   public RoleConfiguration(String roleArn, String roleSessionName) {
//     this(roleArn, roleSessionName, null);
//   }
// 
//   /**
//    * Creates an instance of role configuration.
//    *
//    * @param roleArn         role Arn
//    * @param roleSessionName role session name
//    * @param roleExternalId  role external Id
//    */
//   public RoleConfiguration(String roleArn, String roleSessionName, String roleExternalId) {
//     checkArgument(!isEmpty(roleArn), "roleArn is empty");
//     checkArgument(!isEmpty(roleSessionName), "roleSessionName is empty");
// 
//     this.roleArn = roleArn;
//     this.roleSessionName = roleSessionName;
//     this.roleExternalId = roleExternalId;
//   }
// 
//   /**
//    * Gets role session name.
//    *
//    * @return role session name
//    */
//   public String getRoleSessionName() {
//     return roleSessionName;
//   }
// 
//   /**
//    * Gets role external Id.
//    *
//    * @return role external Id
//    */
//   public String getRoleExternalId() {
//     return roleExternalId;
//   }
// 
//   /**
//    * Gets role Arn.
//    *
//    * @return role Arn
//    */
//   public String getRoleArn() {
//     return roleArn;
//   }
// 
//   @Override
//   public String toString() {
//     return "RoleConfiguration{" +
//         "roleArn='" + roleArn + '\'' +
//         ", roleSessionName='" + roleSessionName + '\'' +
//         ", roleExternalId='" + roleExternalId + '\'' +
//         '}';
//   }
// }


import static org.junit.Assert.fail;
import com.cloudera.director.aws.STSAssumeNRolesSessionCredentialsProvider.RoleConfiguration;
import com.google.common.collect.ImmutableList;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Properties;
  private static String getProperty(Properties properties, String key) {
    String value = properties.getProperty(key);
    if (value == null) {
      fail("Could not find " + key + " in properties file");
    }
    return value;
  }

  public static LiveTestProperties loadLiveTestProperties() {
    String liveTestPropertyFile = System.getProperty("test.aws.live.file");

    if (liveTestPropertyFile == null) {
      fail("live test file property is not set");
    }

    Properties prop = new Properties();

    LiveTestProperties liveTestProperties = null;
    try(InputStream input = new FileInputStream(liveTestPropertyFile)) {
      prop.load(input);

      String testRegion = getProperty(prop, "region");
      String testSubnet = getProperty(prop, "subnet_id");
      String testSecurityGroup = getProperty(prop, "security_group");
      String testKmsKeyArn = getProperty(prop, "kms_key_arn");
      String externalAccountRegion = getProperty(prop, "external_account_region");
      String externalAccountSubnetId = getProperty(prop, "external_account_subnet_id");
      String externalAccountSecurityGroup = getProperty(prop, "external_account_security_group");
      String externalAccountKmsKeyArn = getProperty(prop, "external_account_kms_key");

// Path: provider/src/main/java/com/cloudera/director/aws/STSAssumeNRolesSessionCredentialsProvider.java
// static public class RoleConfiguration {
//   private final String roleArn;
//   private final String roleSessionName;
//   private final String roleExternalId;
// 
//   /**
//    * Creates an instance of role configuration.
//    *
//    * @param roleArn         role Arn
//    * @param roleSessionName role session name
//    */
//   public RoleConfiguration(String roleArn, String roleSessionName) {
//     this(roleArn, roleSessionName, null);
//   }
// 
//   /**
//    * Creates an instance of role configuration.
//    *
//    * @param roleArn         role Arn
//    * @param roleSessionName role session name
//    * @param roleExternalId  role external Id
//    */
//   public RoleConfiguration(String roleArn, String roleSessionName, String roleExternalId) {
//     checkArgument(!isEmpty(roleArn), "roleArn is empty");
//     checkArgument(!isEmpty(roleSessionName), "roleSessionName is empty");
// 
//     this.roleArn = roleArn;
//     this.roleSessionName = roleSessionName;
//     this.roleExternalId = roleExternalId;
//   }
// 
//   /**
//    * Gets role session name.
//    *
//    * @return role session name
//    */
//   public String getRoleSessionName() {
//     return roleSessionName;
//   }
// 
//   /**
//    * Gets role external Id.
//    *
//    * @return role external Id
//    */
//   public String getRoleExternalId() {
//     return roleExternalId;
//   }
// 
//   /**
//    * Gets role Arn.
//    *
//    * @return role Arn
//    */
//   public String getRoleArn() {
//     return roleArn;
//   }
// 
//   @Override
//   public String toString() {
//     return "RoleConfiguration{" +
//         "roleArn='" + roleArn + '\'' +
//         ", roleSessionName='" + roleSessionName + '\'' +
//         ", roleExternalId='" + roleExternalId + '\'' +
//         '}';
//   }
// }


// Path: tests/src/test/java/com/cloudera/director/aws/test/LiveTestProperties.java
import static org.junit.Assert.fail;
import com.cloudera.director.aws.STSAssumeNRolesSessionCredentialsProvider.RoleConfiguration;
import com.google.common.collect.ImmutableList;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Properties;

  private static String getProperty(Properties properties, String key) {
    String value = properties.getProperty(key);
    if (value == null) {
      fail("Could not find " + key + " in properties file");
    }
    return value;
  }

  public static LiveTestProperties loadLiveTestProperties() {
    String liveTestPropertyFile = System.getProperty("test.aws.live.file");

    if (liveTestPropertyFile == null) {
      fail("live test file property is not set");
    }

    Properties prop = new Properties();

    LiveTestProperties liveTestProperties = null;
    try(InputStream input = new FileInputStream(liveTestPropertyFile)) {
      prop.load(input);

      String testRegion = getProperty(prop, "region");
      String testSubnet = getProperty(prop, "subnet_id");
      String testSecurityGroup = getProperty(prop, "security_group");
      String testKmsKeyArn = getProperty(prop, "kms_key_arn");
      String externalAccountRegion = getProperty(prop, "external_account_region");
      String externalAccountSubnetId = getProperty(prop, "external_account_subnet_id");
      String externalAccountSecurityGroup = getProperty(prop, "external_account_security_group");
      String externalAccountKmsKeyArn = getProperty(prop, "external_account_kms_key");

      ImmutableList.Builder<RoleConfiguration> roleConfigurationsBuilder = ImmutableList.builder();