public static AWSCloudCredential buildGlueCloudCredential(HiveConf hiveConf) {
        for (CloudConfigurationProvider factory : cloudConfigurationFactoryChain) {
            if (factory instanceof AWSCloudConfigurationProvider) {
                AWSCloudConfigurationProvider provider = ((AWSCloudConfigurationProvider) factory);
                return provider.buildGlueCloudCredential(hiveConf);
            }
        }
        // Should never reach here.
        return null;
    }
@Test
    public void testGlueCredential() {
        HiveConf conf = new HiveConf();
        conf.set(CloudConfigurationConstants.AWS_GLUE_USE_AWS_SDK_DEFAULT_BEHAVIOR, "true");
        AWSCloudCredential cred = CloudConfigurationFactory.buildGlueCloudCredential(conf);
        Assert.assertNotNull(cred);
        Assert.assertEquals("AWSCloudCredential{useAWSSDKDefaultBehavior=true, useInstanceProfile=false, " +
                        "accessKey='', secretKey='', sessionToken='', iamRoleArn='', stsRegion='', " +
                        "stsEndpoint='', externalId='', region='us-east-1', endpoint=''}", cred.toCredString());
    }