Class S3FileServiceProviderTest

java.lang.Object
org.broadleafcommerce.vendor.amazon.s3.AbstractS3Test
org.broadleafcommerce.vendor.amazon.s3.S3FileServiceProviderTest

public class S3FileServiceProviderTest extends AbstractS3Test
This test will connect to S3Client, create a bucket, create a file, delete the file, and delete the bucket. This test requires an S3 keys and S3 accessId which can be passed in as -D arguments or stored in a property file in your classpath named. "/config/bc/override/common.properties."
Author:
bpolster
  • Constructor Details

    • S3FileServiceProviderTest

      public S3FileServiceProviderTest()
  • Method Details

    • setupProvider

      public static void setupProvider()
    • testFileProcesses

      public void testFileProcesses() throws IOException
      Throws:
      IOException
    • testSubDirectory

      public void testSubDirectory() throws IOException
      Throws:
      IOException
    • testSubDirectoryWithSlashes

      public void testSubDirectoryWithSlashes() throws IOException
      Throws:
      IOException
    • testSiteSpecificFile

      public void testSiteSpecificFile() throws IOException
      Throws:
      IOException
    • testRemoveAddedResourceByName

      public void testRemoveAddedResourceByName()
    • testNotFoundReturnsNonExistentFile

      public void testNotFoundReturnsNonExistentFile()
    • testSubDirectoryTree

      public void testSubDirectoryTree() throws IOException
      Throws:
      IOException
    • verifyFileUploadRaw

      protected void verifyFileUploadRaw(String filename, String directoryName) throws IOException
      Differs from checkTestFileExists(String) in that this uses the S3 client directly and does not go through the Broadleaf file service API. This will create a test file, upload it to S3 via the Broadleaf file service API, verify that the file exists via the raw S3 client, and then delete the file from the bucket via the file service API again
      Parameters:
      filename - the name of the file to upload
      directoryName - directory that the file should be stored in on S3
      Throws:
      IOException
    • deleteTestFile

      protected boolean deleteTestFile(String filename)
    • checkTestFileExists

      protected boolean checkTestFileExists(String filename)
    • uploadTestFileTestOk

      protected boolean uploadTestFileTestOk(String filename)
    • uploadTestFileWithResult

      protected List<String> uploadTestFileWithResult(String filename)