Class S3ClassExtension

  • All Implemented Interfaces:
    org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.Extension

    public class S3ClassExtension
    extends S3Mock
    implements org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.AfterAllCallback
    JUnit 5 extension for running a AWS S3-compatible object storage alongside the (integration) tests. Use S3Mock.getEndpoint() to retrieve the endpoint URL to connect to.

    Example usage:

       @RegisterExtension
       static final S3ClassExtension S3_EXTENSION = S3ClassExtension.builder().build();
     
    • Constructor Detail

      • S3ClassExtension

        public S3ClassExtension​(java.util.List<java.lang.String> buckets,
                                java.util.List<MockObject> mockObjects)
    • Method Detail

      • beforeAll

        public void beforeAll​(org.junit.jupiter.api.extension.ExtensionContext context)
        Specified by:
        beforeAll in interface org.junit.jupiter.api.extension.BeforeAllCallback
      • afterAll

        public void afterAll​(org.junit.jupiter.api.extension.ExtensionContext context)
        Specified by:
        afterAll in interface org.junit.jupiter.api.extension.AfterAllCallback
      • start

        public void start()
        Overrides:
        start in class S3Mock
      • stop

        public void stop()
        Overrides:
        stop in class S3Mock