diff --git a/tests/general/BigBucket.cfc b/tests/general/BigBucket.cfc index 6e7ad12..a52dbc5 100644 --- a/tests/general/BigBucket.cfc +++ b/tests/general/BigBucket.cfc @@ -1,12 +1,10 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="s3" { function run( testResults , testBox ) { - describe( title="Test suite for big buckets",skip=isNotSupported(), body=function() { - cred=getCredentials(); + describe( title="Test suite for big buckets",skip=Util::isAWSNotSupported(), body=function() { + var cred=Util::getAWSCredentials() var bucketName=cred.PREFIX&"-big"&listFirst(replace(server.lucee.version,".","","all"),"-"); - - // does the bucket exists? if(!S3Exists( bucketName:bucketName, @@ -34,9 +32,9 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="s3" { } } - it(title="checking with S3ListBucket", skip=isNotSupported(), body = function( currentSpec ) { - var cred=getCredentials(); - + it(title="checking with S3ListBucket", skip=Util::isAWSNotSupported(), body = function( currentSpec ) { + var cred=Util::getAWSCredentials() + if(records==0){ var executionTime=getTickCount(); var qry=S3ListBucket( @@ -50,16 +48,5 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="s3" { }); } - private boolean function isNotSupported() { - res= getCredentials(); - return isNull(res) || len(res)==0; - } - private struct function getCredentials() { - var ACCESS_KEY_ID=server.system.environment.S3_ACCESS_ID_TEST?:nullValue(); - if(isNull(ACCESS_KEY_ID) || isEmpty(ACCESS_KEY_ID)) return {}; - var SECRET_KEY=server.system.environment.S3_SECRET_KEY_TEST?:nullValue(); - if(isNull(SECRET_KEY) || isEmpty(SECRET_KEY)) return {}; - return {ACCESS_KEY_ID:ACCESS_KEY_ID,SECRET_KEY:SECRET_KEY}; - } } \ No newline at end of file