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
-
Field Summary
Fields inherited from class com.robothy.s3.jupiter.extensions.LocalS3Extension
LOCAL_S3_PORT_STORE_SUFFIX
-
Method Summary
Modifier and TypeMethodDescriptionvoid
beforeAll
(org.junit.jupiter.api.extension.ExtensionContext context) void
beforeEach
(org.junit.jupiter.api.extension.ExtensionContext context) static S3ClassExtension.Builder
builder()
software.amazon.awssdk.services.s3.S3Client
Deprecated, for removal: This API element is subject to removal in a future version.software.amazon.awssdk.services.s3.S3Client
void
resetAll()
Methods inherited from class com.robothy.s3.jupiter.extensions.LocalS3Extension
afterAll, afterEach
-
Method Details
-
beforeEach
public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context) - Specified by:
beforeEach
in interfaceorg.junit.jupiter.api.extension.BeforeEachCallback
- Overrides:
beforeEach
in classcom.robothy.s3.jupiter.extensions.LocalS3Extension
-
beforeAll
- Specified by:
beforeAll
in interfaceorg.junit.jupiter.api.extension.BeforeAllCallback
- Overrides:
beforeAll
in classcom.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.UsenewClient()
instead.- Returns:
- a new S3 client
-
newClient
public software.amazon.awssdk.services.s3.S3Client newClient()- Returns:
- a new S3 client
-
getEndpoint
-
builder
-
newClient()
instead.