CloudStore { boolean parseIamRoleInfo(String iamRole) { Struct iamRoleStruct = JSON.fromString(iamRole, Struct.class); if (iamRoleStruct == null) { LOGGER.error("CloudStore: unable to parse iam role data: {}", iamRole); return false; } String profileArn = iamRoleStruct.getString("InstanceProfileArn"); if (profileArn == null || profileArn.isEmpty()) { LOGGER.error("CloudStore: unable to extract InstanceProfileArn from iam role data: {}", iamRole); return false; } return parseInstanceProfileArn(profileArn); } CloudStore(); void close(); void setHttpClient(HttpClient client); boolean isAwsEnabled(); AmazonS3 getS3Client(); AWSTemporaryCredentials assumeAWSRole(String account, String roleName, String principal,
                                                 Integer durationSeconds, String externalId); String getCloudAccount(String domainName);  }
@Test public void testParseIamRoleInfo() { CloudStore store = new CloudStore(); assertTrue(store.parseIamRoleInfo(AWS_IAM_ROLE_INFO)); assertEquals(store.awsRole, "athenz.zts"); store.close(); }