Skip to content

Commit 96b0b36

Browse files
committed
Remove AWS SDK v1 and JUnit4
1 parent f480c5b commit 96b0b36

File tree

14 files changed

+7
-582
lines changed

14 files changed

+7
-582
lines changed

CHANGELOG.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Whenever a 3rd party library is updated, S3Mock will update it's MINOR version.
77
* [Changelog](#changelog)
88
* [PLANNED - 5.x - RELEASE TBD](#planned---5x---release-tbd)
99
* [Planned changes](#planned-changes)
10+
* [5.0.0 - PLANNED](#500---planned)
1011
* [CURRENT - 4.x - THIS VERSION IS UNDER ACTIVE DEVELOPMENT](#current---4x---this-version-is-under-active-development)
1112
* [4.6.0 - PLANNED](#460---planned)
1213
* [4.5.0](#450)
@@ -133,25 +134,23 @@ Running S3Mock in unit tests is still supported by using [TestContainers](https:
133134
* Removal of properties workarounds
134135
* Migration to `Kotlin` - the IntegrationTests and unit tests were migrated already.
135136
* Version updates
136-
* Bump Spring Boot version to 4.x
137-
* Bump Spring Framework version to 7.x
138-
* Bump java version from 17 to 25
139-
* S3Mock will use the baseline Spring chooses to support.
140-
* The Docker container will run Java 25 LTS.
137+
* TBD
141138

142139
## 5.0.0 - PLANNED
143140

144141
* Features and fixes
145142
* TBD
146143
* Refactorings
147144
* AWS has deprecated SDK for Java v1, and will remove support EOY 2025.
148-
* Remove Java v1.
145+
* Remove Java SDK v1.
149146
* JUnit 4.x deprecation
150147
* Remove JUnit 4.x support.
151148
* Version updates
152149
* Bump Spring Boot version to 4.x
153150
* Bump Spring Framework version to 7.x
154151
* Bump java version from 17 to 25
152+
* S3Mock will use the baseline Spring chooses to support.
153+
* The Docker container will run Java 25 LTS.
155154

156155
# CURRENT - 4.x - THIS VERSION IS UNDER ACTIVE DEVELOPMENT
157156
Version 4.x is JDK17 LTS bytecode compatible, with Docker and JUnit / direct Java integration.

README.md

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
![Maven Build](https://github.com/adobe/S3Mock/workflows/Maven%20Build/badge.svg)
33
[![Docker Hub](https://img.shields.io/badge/docker-latest-blue.svg)](https://hub.docker.com/r/adobe/s3mock/)
44
[![Docker Pulls](https://img.shields.io/docker/pulls/adobe/s3mock)](https://hub.docker.com/r/adobe/s3mock)
5-
[![Java17](https://img.shields.io/badge/MADE%20with-Java17-RED.svg)](#Java)
5+
[![Java](https://img.shields.io/badge/MADE%20with-Java17-RED.svg)](#Java)
66
[![Kotlin](https://img.shields.io/badge/MADE%20with-Kotlin-RED.svg)](#Kotlin)
77
[![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/7673/badge)](https://bestpractices.coreinfrastructure.org/projects/7673)
88
[![OpenSSF Scorecard](https://img.shields.io/ossf-scorecard/github.com/adobe/S3Mock?label=openssf%20scorecard&style=flat)](https://api.securityscorecards.dev/projects/github.com/adobe/S3Mock)
@@ -29,7 +29,6 @@
2929
* [Expanded example](#expanded-example)
3030
* [Start using self-signed SSL certificate](#start-using-self-signed-ssl-certificate)
3131
* [S3Mock Java](#s3mock-java)
32-
* [Start using the JUnit4 Rule](#start-using-the-junit4-rule)
3332
* [Start using the JUnit5 Extension](#start-using-the-junit5-extension)
3433
* [Start using the TestNG Listener](#start-using-the-testng-listener)
3534
* [Start programmatically](#start-programmatically)
@@ -52,7 +51,7 @@
5251
`S3Mock` is a lightweight server that implements parts of the [Amazon S3 API](https://docs.aws.amazon.com/AmazonS3/latest/API/Welcome.html).
5352
It has been created to support local integration testing by reducing infrastructure dependencies.
5453

55-
The `S3Mock` server can be started as a standalone *Docker* container, using *Testcontainers*, *JUnit4*, *JUnit5* and *TestNG* support, or programmatically.
54+
The `S3Mock` server can be started as a standalone *Docker* container, using *Testcontainers*, *JUnit5* and *TestNG* support, or programmatically.
5655

5756
## Changelog
5857

@@ -476,21 +475,6 @@ _This is the opposite of what software engineers are trying to achieve when thor
476475

477476
**See also [the Java section below](#Java)**
478477

479-
#### Start using the JUnit4 Rule
480-
481-
The example [`S3MockRuleTest`](testsupport/junit4/src/test/java/com/adobe/testing/s3mock/junit4/S3MockRuleTest.java) demonstrates the usage of the `S3MockRule`, which can be configured through a _builder_.
482-
483-
To use the JUnit4 Rule, use the following Maven artifact in `test` scope:
484-
485-
```xml
486-
<dependency>
487-
<groupId>com.adobe.testing</groupId>
488-
<artifactId>s3mock-junit4</artifactId>
489-
<version>...</version>
490-
<scope>test</scope>
491-
</dependency>
492-
```
493-
494478
#### Start using the JUnit5 Extension
495479

496480
The `S3MockExtension` can currently be used in two ways:

pom.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@
121121

122122
<aws-v2.version>2.31.50</aws-v2.version>
123123

124-
<aws.version>1.12.785</aws.version>
125-
126124
<aws-kotlin.version>1.4.91</aws-kotlin.version>
127125

128126
<commons-codec.version>1.15</commons-codec.version>
@@ -196,16 +194,6 @@
196194
<version>${project.version}</version>
197195
</dependency>
198196

199-
<dependency>
200-
<groupId>com.amazonaws</groupId>
201-
<artifactId>aws-java-sdk-core</artifactId>
202-
<version>${aws.version}</version>
203-
</dependency>
204-
<dependency>
205-
<groupId>com.amazonaws</groupId>
206-
<artifactId>aws-java-sdk-s3</artifactId>
207-
<version>${aws.version}</version>
208-
</dependency>
209197
<dependency>
210198
<groupId>commons-io</groupId>
211199
<artifactId>commons-io</artifactId>

testsupport/common/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@
3131
<name>S3Mock - Testsupport - Common</name>
3232

3333
<dependencies>
34-
<dependency>
35-
<groupId>com.amazonaws</groupId>
36-
<artifactId>aws-java-sdk-s3</artifactId>
37-
</dependency>
3834
<dependency>
3935
<groupId>com.adobe.testing</groupId>
4036
<artifactId>s3mock</artifactId>

testsupport/common/src/main/java/com/adobe/testing/s3mock/testsupport/common/S3MockStarter.java

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@
2020
import static software.amazon.awssdk.http.SdkHttpConfigurationOption.TRUST_ALL_CERTIFICATES;
2121

2222
import com.adobe.testing.s3mock.S3MockApplication;
23-
import com.amazonaws.ClientConfiguration;
24-
import com.amazonaws.auth.AWSStaticCredentialsProvider;
25-
import com.amazonaws.auth.BasicAWSCredentials;
26-
import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration;
27-
import com.amazonaws.services.s3.AmazonS3;
28-
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
2923
import java.net.Socket;
3024
import java.net.URI;
3125
import java.security.KeyManagementException;
@@ -37,9 +31,6 @@
3731
import javax.net.ssl.SSLEngine;
3832
import javax.net.ssl.TrustManager;
3933
import javax.net.ssl.X509ExtendedTrustManager;
40-
import org.apache.http.conn.ssl.NoopHostnameVerifier;
41-
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
42-
import org.jspecify.annotations.NonNull;
4334
import org.jspecify.annotations.Nullable;
4435
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
4536
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
@@ -90,40 +81,6 @@ public S3Client createS3ClientV2() {
9081
.build();
9182
}
9283

93-
/**
94-
* Creates an {@link AmazonS3} client instance that is configured to call the started S3Mock
95-
* server using HTTPS.
96-
*
97-
* @return The {@link AmazonS3} instance.
98-
* @deprecated The AWS SDK for Java 1.x entered maintenance mode starting July 31, 2024 and will reach end of support on December 31, 2025. For more information, see https://aws.amazon.com/blogs/developer/the-aws-sdk-for-java-1-x-is-in-maintenance-mode-effective-july-31-2024/
99-
*/
100-
@Deprecated(since = "4.0.0", forRemoval = true)
101-
public AmazonS3 createS3Client() {
102-
return createS3Client("us-east-1");
103-
}
104-
105-
/**
106-
* Creates an {@link AmazonS3} client instance that is configured to call the started S3Mock
107-
* server using HTTPS for a given region.
108-
*
109-
* @param region Region to define regional endpoint.
110-
*
111-
* @return The {@link AmazonS3} instance.
112-
* @deprecated The AWS SDK for Java 1.x entered maintenance mode starting July 31, 2024 and will reach end of support on December 31, 2025. For more information, see https://aws.amazon.com/blogs/developer/the-aws-sdk-for-java-1-x-is-in-maintenance-mode-effective-july-31-2024/
113-
*/
114-
@Deprecated(since = "4.0.0", forRemoval = true)
115-
public AmazonS3 createS3Client(final String region) {
116-
var credentials = new BasicAWSCredentials("foo", "bar");
117-
118-
return AmazonS3ClientBuilder.standard()
119-
.withCredentials(new AWSStaticCredentialsProvider(credentials))
120-
.withClientConfiguration(
121-
configureClientToIgnoreInvalidSslCertificates(new ClientConfiguration()))
122-
.withEndpointConfiguration(getEndpointConfiguration(region))
123-
.enablePathStyleAccess()
124-
.build();
125-
}
126-
12784
public int getPort() {
12885
return s3MockFileStore.getPort();
12986
}
@@ -141,29 +98,6 @@ public void registerKMSKeyRef(final String keyRef) {
14198
s3MockFileStore.registerKMSKeyRef(keyRef);
14299
}
143100

144-
/**
145-
* Adjusts the given client configuration to allow the communication with the mock server using
146-
* HTTPS, although that one uses a self-signed SSL certificate.
147-
*
148-
* @param clientConfiguration The {@link ClientConfiguration} to adjust.
149-
*
150-
* @return The adjusted instance.
151-
*/
152-
public ClientConfiguration configureClientToIgnoreInvalidSslCertificates(
153-
final ClientConfiguration clientConfiguration) {
154-
155-
clientConfiguration.getApacheHttpClientConfig()
156-
.withSslSocketFactory(new SSLConnectionSocketFactory(
157-
createBlindlyTrustingSslContext(),
158-
NoopHostnameVerifier.INSTANCE));
159-
160-
return clientConfiguration;
161-
}
162-
163-
protected EndpointConfiguration getEndpointConfiguration(final String region) {
164-
return new EndpointConfiguration(getServiceEndpoint(), region);
165-
}
166-
167101
/**
168102
* Returns endpoint URL for connecting to the mock server.
169103
* @return endpoint URL for connecting to the mock server.

testsupport/junit4/pom.xml

Lines changed: 0 additions & 58 deletions
This file was deleted.

testsupport/junit4/src/main/java/com/adobe/testing/s3mock/junit4/S3MockRule.java

Lines changed: 0 additions & 86 deletions
This file was deleted.

0 commit comments

Comments
 (0)