Package com.adobe.testing.s3mock.junit4
Class S3MockRule
- java.lang.Object
-
- com.adobe.testing.s3mock.testsupport.common.S3MockStarter
-
- com.adobe.testing.s3mock.junit4.S3MockRule
-
- All Implemented Interfaces:
org.junit.rules.TestRule
public class S3MockRule extends S3MockStarter implements org.junit.rules.TestRule
JUnit rule to start and stop the S3Mock Application. After the tests, the S3Mock is stopped. It should be used asClassRule
:@ClassRule public static S3MockRule S3_MOCK_RULE = S3MockRule.builder().build(); private final AmazonS3 s3Client = S3_MOCK_RULE.createS3Client(); @Test public void doSomethingWithS3() { s3Client.createBucket("myBucket"); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
S3MockRule.Builder
-
Nested classes/interfaces inherited from class com.adobe.testing.s3mock.testsupport.common.S3MockStarter
S3MockStarter.BaseBuilder<T extends S3MockStarter>
-
-
Field Summary
-
Fields inherited from class com.adobe.testing.s3mock.testsupport.common.S3MockStarter
properties, s3MockFileStore
-
-
Constructor Summary
Constructors Constructor Description S3MockRule()
Creates an instance with the default configuration.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.junit.runners.model.Statement
apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
static S3MockRule.Builder
builder()
-
Methods inherited from class com.adobe.testing.s3mock.testsupport.common.S3MockStarter
configureClientToIgnoreInvalidSslCertificates, createS3Client, createS3Client, createS3ClientV2, defaultProps, getEndpointConfiguration, getHttpPort, getPort, getServiceEndpoint, registerKMSKeyRef, start, stop
-
-
-
-
Method Detail
-
builder
public static S3MockRule.Builder builder()
-
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
- Specified by:
apply
in interfaceorg.junit.rules.TestRule
-
-