Skip to content

Commit

Permalink
LDEV-3988 - add test case for content type
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Sep 9, 2024
1 parent bf1ad28 commit 23c3e54
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions tests/general/ContentType.cfc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
component extends="org.lucee.cfml.test.LuceeTestCase" labels="s3" {
function run( testResults , testBox ) {
describe( title="Test suite for content type", body=function() {
it(title="check with blackbaze",skip=Util::isBackBlazeNotSupported(), body = function( currentSpec ) {
testit(Util::getBackBlazeCredentials());
});

it(title="check with amazon",skip=Util::isAWSNotSupported(), body = function( currentSpec ) {
testit(Util::getAWSCredentials());
});

it(title="check with wasabi",skip=Util::isWasabiNotSupported(), body = function( currentSpec ) {
testit(Util::getWasabiCredentials());
});

it(title="check with google",skip=Util::isGoogleNotSupported(), body = function( currentSpec ) {
testit(Util::getGoogleCredentials());
});

});
}


private function testit(cred) {
try {
// create variables
var bucketName=Util::createBucketName("contenttype");
var objectName="content-type.xml";

fileWrite(objectName, '<?xml version="1.0" encoding="UTF-8"?>
<test/>');
fileMove(objectName, "s3:///#bucketName#/#objectName#");
assertTrue(s3getmetadata(bucketName,objectName)["contentType"]);
}
finally {
Util::deleteBucketEL(cred,bucketName);
}
}
}

0 comments on commit 23c3e54

Please sign in to comment.