Class S3ClassExtension

java.lang.Object
com.robothy.s3.jupiter.extensions.LocalS3Extension
org.sdase.commons.server.s3.testing.S3ClassExtension
All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.AfterEachCallback, org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.Extension

public class S3ClassExtension extends com.robothy.s3.jupiter.extensions.LocalS3Extension
JUnit 5 extension for running an AWS S3-compatible object storage alongside the (integration) tests. Use getEndpoint() to retrieve the endpoint URL to connect to.

Example usage:

 @LocalS3
 class MyS3Test {

   @RegisterExtension
   @Order(0)
   static final S3ClassExtension S3 = S3ClassExtension.builder().createBucket("testbucket").build();

 }
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
     
  • Field Summary

    Fields inherited from class com.robothy.s3.jupiter.extensions.LocalS3Extension

    LOCAL_S3_PORT_STORE_SUFFIX
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    beforeAll(org.junit.jupiter.api.extension.ExtensionContext context)
     
    void
    beforeEach(org.junit.jupiter.api.extension.ExtensionContext context)
     
     
    software.amazon.awssdk.services.s3.S3Client
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use newClient() instead.
     
    software.amazon.awssdk.services.s3.S3Client
     
    void
     

    Methods inherited from class com.robothy.s3.jupiter.extensions.LocalS3Extension

    afterAll, afterEach

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • beforeEach

      public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context)
      Specified by:
      beforeEach in interface org.junit.jupiter.api.extension.BeforeEachCallback
      Overrides:
      beforeEach in class com.robothy.s3.jupiter.extensions.LocalS3Extension
    • beforeAll

      public void beforeAll(org.junit.jupiter.api.extension.ExtensionContext context) throws Exception
      Specified by:
      beforeAll in interface org.junit.jupiter.api.extension.BeforeAllCallback
      Overrides:
      beforeAll in class com.robothy.s3.jupiter.extensions.LocalS3Extension
      Throws:
      Exception
    • resetAll

      public void resetAll()
    • getClient

      @Deprecated(forRemoval=true, since="6.0.0") public software.amazon.awssdk.services.s3.S3Client getClient()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use newClient() instead.
      Returns:
      a new S3 client
    • newClient

      public software.amazon.awssdk.services.s3.S3Client newClient()
      Returns:
      a new S3 client
    • getEndpoint

      public String getEndpoint()
    • builder

      public static S3ClassExtension.Builder builder()