springboot-testcontainer-awss3mock

AwsS3Mock test-container

License

License

Categories

Categories

IDE Development Tools AWS Container PaaS Providers
GroupId

GroupId

com.avides.springboot.testcontainer
ArtifactId

ArtifactId

springboot-testcontainer-awss3mock
Last Version

Last Version

1.0.0-RC3
Release Date

Release Date

Type

Type

jar
Description

Description

springboot-testcontainer-awss3mock
AwsS3Mock test-container
Project URL

Project URL

https://github.com/springboot-testcontainer/springboot-testcontainer-awss3mock
Project Organization

Project Organization

AVIDES Media AG
Source Code Management

Source Code Management

https://github.com/springboot-testcontainer/springboot-testcontainer-awss3mock

Download springboot-testcontainer-awss3mock

How to add to project

<!-- https://jarcasting.com/artifacts/com.avides.springboot.testcontainer/springboot-testcontainer-awss3mock/ -->
<dependency>
    <groupId>com.avides.springboot.testcontainer</groupId>
    <artifactId>springboot-testcontainer-awss3mock</artifactId>
    <version>1.0.0-RC3</version>
</dependency>
// https://jarcasting.com/artifacts/com.avides.springboot.testcontainer/springboot-testcontainer-awss3mock/
implementation 'com.avides.springboot.testcontainer:springboot-testcontainer-awss3mock:1.0.0-RC3'
// https://jarcasting.com/artifacts/com.avides.springboot.testcontainer/springboot-testcontainer-awss3mock/
implementation ("com.avides.springboot.testcontainer:springboot-testcontainer-awss3mock:1.0.0-RC3")
'com.avides.springboot.testcontainer:springboot-testcontainer-awss3mock:jar:1.0.0-RC3'
<dependency org="com.avides.springboot.testcontainer" name="springboot-testcontainer-awss3mock" rev="1.0.0-RC3">
  <artifact name="springboot-testcontainer-awss3mock" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.avides.springboot.testcontainer', module='springboot-testcontainer-awss3mock', version='1.0.0-RC3')
)
libraryDependencies += "com.avides.springboot.testcontainer" % "springboot-testcontainer-awss3mock" % "1.0.0-RC3"
[com.avides.springboot.testcontainer/springboot-testcontainer-awss3mock "1.0.0-RC3"]

Dependencies

compile (2)

Group / Artifact Type Version
com.avides.springboot.testcontainer : springboot-testcontainer-common jar 1.0.0-RC2
com.amazonaws : aws-java-sdk-s3 jar 1.11.683

provided (2)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.18.10
org.springframework.boot : spring-boot-autoconfigure jar 2.2.1.RELEASE

test (8)

Group / Artifact Type Version
org.assertj : assertj-core jar 3.14.0
org.easymock : easymock jar 4.1
org.powermock : powermock-module-junit4 jar 2.0.4
org.powermock : powermock-api-easymock jar 2.0.4
org.jacoco : org.jacoco.agent jar 0.8.5
org.springframework : spring-test jar 5.2.1.RELEASE
org.springframework.boot : spring-boot-test jar 2.2.1.RELEASE
ch.qos.logback : logback-classic jar 1.2.3

Project Modules

There are no modules declared in this project.

springtainer-awss3mock

Maven Central Build Nightly build Coverage report Quality Gate Technical dept

Dependency

<dependency>
	<groupId>com.avides.springboot.springtainer</groupId>
	<artifactId>springtainer-awss3mock</artifactId>
	<version>1.2.0</version>
	<scope>test</scope>
</dependency>

Configuration

Properties consumed (in bootstrap-it.properties):

  • embedded.container.awss3mock.enabled (default is true)
  • embedded.container.awss3mock.startup-timeout (default is 30)
  • embedded.container.awss3mock.docker-image (default is adobe/s3mock:2.1.21)
  • embedded.container.awss3mock.endpoint-http-port (default is 9090)
  • embedded.container.awss3mock.endpoint-https-port (default is 9191)

Properties provided (in application-it.properties):

  • embedded.container.awss3mock.endpoint.http.url
  • embedded.container.awss3mock.endpoint.https.url

Example for minimal configuration in application-it.properties:

any-s3-endpoint.url=${embedded.container.awss3mock.endpoint.http.url}

A properly configured AmazonS3 Object can be provided by the AmazonS3Helper.

Logging

To reduce logging insert this into the logback-configuration:

<!-- Springtainer -->
<logger name="com.github.dockerjava.jaxrs" level="WARN" />
<logger name="com.github.dockerjava.core.command" level="WARN" />
<logger name="org.apache.http" level="WARN" />

Labels

The container exports multiple labels to analyze running springtainers:

  • SPRINGTAINER_SERVICE=awss3mock
  • SPRINGTAINER_IMAGE=${embedded.container.awss3mock.docker-image}
  • SPRINGTAINER_STARTED=$currentTimestamp

Special Note

It's highly recommended to use BasicAWSCredentials with sample dates to avoid bad performance of the AWS-SDK.

Example: AmazonS3 amazonS3 = AmazonS3ClientBuilder.standard() .withCredentials(new AWSStaticCredentialsProvider(new BasicAWSCredentials("acesskey", "secretkey"))) .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(s3HttpEndpoint, Regions.EU_CENTRAL_1.getName())) .build();

The AmazonS3Helper class can be used to build AmazonS3 objects with sample credentials.

Versions

Version
1.0.0-RC3
1.0.0-RC2
1.0.0-RC1
0.1.0-RC5
0.1.0-RC4
0.1.0-RC3
0.1.0-RC2
0.1.0-RC1