Class S3MockRule

All Implemented Interfaces:
org.junit.rules.TestRule

@Deprecated(since="3.0.0", forRemoval=true) public class S3MockRule extends S3MockStarter implements org.junit.rules.TestRule
Deprecated, for removal: This API element is subject to removal in a future version.
JUnit 5 was released years ago. Please migrate your JUnit 4 tests to JUnit 5. This TestRule will be removed in S3Mock 4.x
JUnit rule to start and stop the S3Mock Application. After the tests, the S3Mock is stopped. It should be used as ClassRule:
 @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");
 }
 
  • Constructor Details

    • S3MockRule

      public S3MockRule()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates an instance with the default configuration.
  • Method Details

    • builder

      public static S3MockRule.Builder builder()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • apply

      public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      apply in interface org.junit.rules.TestRule