From 51be23565519dabfd99186181db4629bb3bf8add Mon Sep 17 00:00:00 2001 From: Arne Franken Date: Fri, 4 Jul 2025 17:30:18 +0200 Subject: [PATCH 01/14] Remove unused imports --- .../src/main/java/com/adobe/testing/s3mock/S3MockProperties.java | 1 - .../src/main/java/com/adobe/testing/s3mock/util/DigestUtil.java | 1 - .../adobe/testing/s3mock/testsupport/common/S3MockStarter.java | 1 - 3 files changed, 3 deletions(-) diff --git a/server/src/main/java/com/adobe/testing/s3mock/S3MockProperties.java b/server/src/main/java/com/adobe/testing/s3mock/S3MockProperties.java index d3b58ff3a..25e896a7f 100644 --- a/server/src/main/java/com/adobe/testing/s3mock/S3MockProperties.java +++ b/server/src/main/java/com/adobe/testing/s3mock/S3MockProperties.java @@ -16,7 +16,6 @@ package com.adobe.testing.s3mock; -import com.adobe.testing.s3mock.dto.Region; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.bind.DefaultValue; diff --git a/server/src/main/java/com/adobe/testing/s3mock/util/DigestUtil.java b/server/src/main/java/com/adobe/testing/s3mock/util/DigestUtil.java index 667d6f7d6..10f75de26 100644 --- a/server/src/main/java/com/adobe/testing/s3mock/util/DigestUtil.java +++ b/server/src/main/java/com/adobe/testing/s3mock/util/DigestUtil.java @@ -38,7 +38,6 @@ import org.apache.commons.codec.binary.Hex; import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.lang3.ArrayUtils; -import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; import software.amazon.awssdk.checksums.SdkChecksum; import software.amazon.awssdk.checksums.spi.ChecksumAlgorithm; diff --git a/testsupport/common/src/main/java/com/adobe/testing/s3mock/testsupport/common/S3MockStarter.java b/testsupport/common/src/main/java/com/adobe/testing/s3mock/testsupport/common/S3MockStarter.java index 67ea7c0a2..e5beedc5f 100644 --- a/testsupport/common/src/main/java/com/adobe/testing/s3mock/testsupport/common/S3MockStarter.java +++ b/testsupport/common/src/main/java/com/adobe/testing/s3mock/testsupport/common/S3MockStarter.java @@ -39,7 +39,6 @@ import javax.net.ssl.X509ExtendedTrustManager; import org.apache.http.conn.ssl.NoopHostnameVerifier; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; -import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; From ea4ccd2b8b4434cab42216db646772bd78cac996 Mon Sep 17 00:00:00 2001 From: Arne Franken Date: Fri, 4 Jul 2025 17:30:58 +0200 Subject: [PATCH 02/14] Use normalized region Overlooked the potential NPE here... --- .../java/com/adobe/testing/s3mock/store/StoreConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/com/adobe/testing/s3mock/store/StoreConfiguration.java b/server/src/main/java/com/adobe/testing/s3mock/store/StoreConfiguration.java index 91cb5f555..15a8dab53 100644 --- a/server/src/main/java/com/adobe/testing/s3mock/store/StoreConfiguration.java +++ b/server/src/main/java/com/adobe/testing/s3mock/store/StoreConfiguration.java @@ -97,7 +97,7 @@ BucketStore bucketStore( bucketStore.createBucket(name, false, ObjectOwnership.BUCKET_OWNER_ENFORCED, - region.id(), + mockRegion.id(), null, null ); From 4f7909dd804bccef0c203b0d9efdb04eb607c413 Mon Sep 17 00:00:00 2001 From: Arne Franken Date: Fri, 4 Jul 2025 17:35:09 +0200 Subject: [PATCH 03/14] Clarify conditions Make them a bit easier to read. --- .../testing/s3mock/service/ObjectService.java | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/server/src/main/java/com/adobe/testing/s3mock/service/ObjectService.java b/server/src/main/java/com/adobe/testing/s3mock/service/ObjectService.java index 615891e13..af97c19dc 100644 --- a/server/src/main/java/com/adobe/testing/s3mock/service/ObjectService.java +++ b/server/src/main/java/com/adobe/testing/s3mock/service/ObjectService.java @@ -354,9 +354,11 @@ public void verifyObjectMatching( var lastModified = Instant.ofEpochMilli(s3ObjectMetadata.lastModified()); var setModifiedSince = ifModifiedSince != null && !ifModifiedSince.isEmpty(); - if (setModifiedSince && ifModifiedSince.get(0).isAfter(lastModified)) { - LOG.debug("Object {} not modified since {}", s3ObjectMetadata.key(), ifModifiedSince.get(0)); - throw NOT_MODIFIED; + if (setModifiedSince) { + if (ifModifiedSince.get(0).isAfter(lastModified)) { + LOG.debug("Object {} not modified since {}", s3ObjectMetadata.key(), ifModifiedSince.get(0)); + throw NOT_MODIFIED; + } } var setMatch = match != null && !match.isEmpty(); @@ -372,18 +374,20 @@ public void verifyObjectMatching( } var setUnmodifiedSince = ifUnmodifiedSince != null && !ifUnmodifiedSince.isEmpty(); - if (setUnmodifiedSince && ifUnmodifiedSince.get(0).isBefore(lastModified)) { - LOG.debug("Object {} modified since {}", s3ObjectMetadata.key(), ifUnmodifiedSince.get(0)); - throw PRECONDITION_FAILED; + if (setUnmodifiedSince) { + if (ifUnmodifiedSince.get(0).isBefore(lastModified)) { + LOG.debug("Object {} modified since {}", s3ObjectMetadata.key(), ifUnmodifiedSince.get(0)); + throw PRECONDITION_FAILED; + } } var setNoneMatch = noneMatch != null && !noneMatch.isEmpty(); - if (setNoneMatch - && (noneMatch.contains(WILDCARD_ETAG) || noneMatch.contains(WILDCARD) || noneMatch.contains(etag)) - ) { - //request cares only that the object etag does not match. - LOG.debug("Object {} does not exist", s3ObjectMetadata.key()); - throw NOT_MODIFIED; + if (setNoneMatch) { + if (noneMatch.contains(WILDCARD_ETAG) || noneMatch.contains(WILDCARD) || noneMatch.contains(etag)) { + // request cares only that the object etag does not match. + LOG.debug("Object {} does not exist", s3ObjectMetadata.key()); + throw NOT_MODIFIED; + } } } From fb80465ebcea91bee1402c04e4f2ca0bc1c50c38 Mon Sep 17 00:00:00 2001 From: Arne Franken Date: Fri, 4 Jul 2025 17:35:32 +0200 Subject: [PATCH 04/14] Changelog 4.6.0 --- CHANGELOG.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index afdafc35d..b391ade42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,8 @@ Whenever a 3rd party library is updated, S3Mock will update it's MINOR version. * [PLANNED - 5.x - RELEASE TBD](#planned---5x---release-tbd) * [Planned changes](#planned-changes) * [CURRENT - 4.x - THIS VERSION IS UNDER ACTIVE DEVELOPMENT](#current---4x---this-version-is-under-active-development) - * [4.6.0 - PLANNED](#460---planned) + * [4.7.0 - PLANNED](#470---planned) + * [4.6.0](#460) * [4.5.1](#451) * [4.5.0](#450) * [4.4.0](#440) @@ -146,7 +147,7 @@ Version 4.x is JDK17 LTS bytecode compatible, with Docker and JUnit / direct Jav **The current major version 4 will receive new features, dependency updates and bug fixes on a continuous basis.** -## 4.6.0 - PLANNED +## 4.7.0 - PLANNED Version 4.x is JDK17 LTS bytecode compatible, with Docker and JUnit / direct Java integration. * Features and fixes @@ -158,6 +159,28 @@ Version 4.x is JDK17 LTS bytecode compatible, with Docker and JUnit / direct Jav * Version updates (build dependencies) * TBD +## 4.6.0 +Version 4.x is JDK17 LTS bytecode compatible, with Docker and JUnit / direct Java integration. + +* Features and fixes + * Fail PUT object with match on non-existent keys (fixes #2502) +* Refactorings + * Remove unused imports + * Fix Kotlin 2.2 usage + * Ignore .vscode and .cursor configurations + * Minor refactorings for clarity. + * Use fixed list of StorageClass values in tests. New values added by AWS sometimes break tests. We want to make sure to test a few different storage classes, no need to test every one. +* Version updates (deliverable dependencies) + * Bump aws-v2.version from 2.31.67 to 2.31.77 + * Bump testcontainers.version from 1.21.2 to 1.21.3 +* Version updates (build dependencies) + * Bump aws.sdk.kotlin:s3-jvm from 1.4.109 to 1.4.119 + * Bump org.apache.maven.plugins:maven-gpg-plugin from 3.2.7 to 3.2.8 + * Bump org.apache.maven.plugins:maven-enforcer-plugin from 3.5.0 to 3.6.0 + * Bump com.puppycrawl.tools:checkstyle from 10.26.0 to 10.26.1 + * Bump github/codeql-action from 3.29.1 to 3.29.2 + * Bump step-security/harden-runner from 2.12.1 to 2.12.2 + ## 4.5.1 Version 4.x is JDK17 LTS bytecode compatible, with Docker and JUnit / direct Java integration. From 8666347094cc2d94643e2ee29caeba1080ccaa7e Mon Sep 17 00:00:00 2001 From: Arne Franken Date: Fri, 4 Jul 2025 17:36:15 +0200 Subject: [PATCH 05/14] Ignore files in .vscode/ --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 37dcf7516..fdceb376f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ target/ .settings/ *.springBeans .mvn/wrapper/maven-wrapper.jar +.vscode From 72ce0ec3b05ac02928cc531fe4deac068d1c1d19 Mon Sep 17 00:00:00 2001 From: Arne Franken Date: Sun, 6 Jul 2025 15:48:37 +0200 Subject: [PATCH 06/14] Rename .java to .kt --- .../s3mock/its/{S3VerifiedFailure.java => S3VerifiedFailure.kt} | 0 .../s3mock/its/{S3VerifiedSuccess.java => S3VerifiedSuccess.kt} | 0 .../testing/s3mock/its/{S3VerifiedTodo.java => S3VerifiedTodo.kt} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/{S3VerifiedFailure.java => S3VerifiedFailure.kt} (100%) rename integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/{S3VerifiedSuccess.java => S3VerifiedSuccess.kt} (100%) rename integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/{S3VerifiedTodo.java => S3VerifiedTodo.kt} (100%) diff --git a/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedFailure.java b/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedFailure.kt similarity index 100% rename from integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedFailure.java rename to integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedFailure.kt diff --git a/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedSuccess.java b/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedSuccess.kt similarity index 100% rename from integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedSuccess.java rename to integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedSuccess.kt diff --git a/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedTodo.java b/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedTodo.kt similarity index 100% rename from integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedTodo.java rename to integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedTodo.kt From 6782b747834b94fa74319ad4bae8334ebd29d3c9 Mon Sep 17 00:00:00 2001 From: Arne Franken Date: Sun, 6 Jul 2025 15:48:37 +0200 Subject: [PATCH 07/14] Convert S3Verified annotations to Kotlin --- .../testing/s3mock/its/S3VerifiedFailure.kt | 19 ++++++------------- .../testing/s3mock/its/S3VerifiedSuccess.kt | 19 ++++++------------- .../testing/s3mock/its/S3VerifiedTodo.kt | 9 +++------ 3 files changed, 15 insertions(+), 32 deletions(-) diff --git a/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedFailure.kt b/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedFailure.kt index 8c60d5f89..f42538531 100644 --- a/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedFailure.kt +++ b/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedFailure.kt @@ -1,5 +1,5 @@ /* - * Copyright 2017-2023 Adobe. + * Copyright 2017-2025 Adobe. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,22 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +package com.adobe.testing.s3mock.its -package com.adobe.testing.s3mock.its; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.extension.ExtendWith /** * A test has been verified as failing against S3 APIs. * Some tests can't ever run successfully against the S3 API. * The reason will tell us why. */ -@Retention(RetentionPolicy.RUNTIME) -@ExtendWith(RealS3BackendUsedCondition.class) -public @interface S3VerifiedFailure { - String reason(); - - int year(); -} +@Retention(AnnotationRetention.RUNTIME) +@ExtendWith(RealS3BackendUsedCondition::class) +annotation class S3VerifiedFailure(val reason: String, val year: Int) diff --git a/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedSuccess.kt b/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedSuccess.kt index 5dc75c82f..87ca2fdc0 100644 --- a/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedSuccess.kt +++ b/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedSuccess.kt @@ -1,5 +1,5 @@ /* - * Copyright 2017-2023 Adobe. + * Copyright 2017-2025 Adobe. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,20 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +package com.adobe.testing.s3mock.its -package com.adobe.testing.s3mock.its; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.extension.ExtendWith /** * A test has been verified successfully against S3 APIs. */ -@Retention(RetentionPolicy.RUNTIME) -@ExtendWith(RealS3BackendUsedCondition.class) -public @interface S3VerifiedSuccess { - - int year(); - -} +@Retention(AnnotationRetention.RUNTIME) +@ExtendWith(RealS3BackendUsedCondition::class) +annotation class S3VerifiedSuccess(val year: Int) diff --git a/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedTodo.kt b/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedTodo.kt index 47ff567a0..3ca1305b6 100644 --- a/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedTodo.kt +++ b/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3VerifiedTodo.kt @@ -1,5 +1,5 @@ /* - * Copyright 2017-2023 Adobe. + * Copyright 2017-2025 Adobe. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,12 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -package com.adobe.testing.s3mock.its; +package com.adobe.testing.s3mock.its /** * A test is new and needs verification against S3 APIs. */ -public @interface S3VerifiedTodo { - -} +annotation class S3VerifiedTodo From 8ac160bd8d838e8225d36e58c24c9c4008d58726 Mon Sep 17 00:00:00 2001 From: Arne Franken Date: Sun, 6 Jul 2025 16:24:41 +0200 Subject: [PATCH 08/14] Use Kotlin 2.2 API/Language --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 3235f5f0b..e10241867 100644 --- a/pom.xml +++ b/pom.xml @@ -80,8 +80,8 @@ 17 2.2.0 ${java.version} - 2.1 - 2.1 + 2.2 + 2.2 2.31.67 From 9a32c242b76123fffa9e061b149e1f792589674b Mon Sep 17 00:00:00 2001 From: Arne Franken Date: Sun, 6 Jul 2025 16:24:56 +0200 Subject: [PATCH 09/14] Ignore .cursor configs --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index fdceb376f..3768e73d8 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ target/ *.springBeans .mvn/wrapper/maven-wrapper.jar .vscode +.cursor From c6c847c57c3f59889e0e6a4907e8430e7b0947ad Mon Sep 17 00:00:00 2001 From: Arne Franken Date: Sun, 6 Jul 2025 16:25:28 +0200 Subject: [PATCH 10/14] Add Makefile for easier mvnw execution --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..a89f1f0d3 --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +.PHONY: build verify install +.DEFAULT_GOAL := build + +build: verify + +verify: + ./mvnw -B -V -Dstyle.color=always clean verify + +install: + ./mvnw -B -V -Dstyle.color=always clean install From e147f3ca79ba6cf4a16e694325a289469f8272c4 Mon Sep 17 00:00:00 2001 From: Arne Franken Date: Sun, 6 Jul 2025 16:28:35 +0200 Subject: [PATCH 11/14] Fail PUT object with match on non-existent keys Fixes #2502 --- .../s3mock/its/GetPutDeleteObjectIT.kt | 34 ++++++++++++++++++- .../testing/s3mock/service/ObjectService.java | 7 +++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/GetPutDeleteObjectIT.kt b/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/GetPutDeleteObjectIT.kt index 8ac9fc42e..72919b222 100644 --- a/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/GetPutDeleteObjectIT.kt +++ b/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/GetPutDeleteObjectIT.kt @@ -16,7 +16,6 @@ package com.adobe.testing.s3mock.its -import com.adobe.testing.s3mock.its.S3TestBase.Companion.UPLOAD_FILE import com.adobe.testing.s3mock.util.DigestUtil import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatThrownBy @@ -912,6 +911,21 @@ internal class GetPutDeleteObjectIT : S3TestBase() { .hasMessageContaining("Service: S3, Status Code: 412") } + @Test + @S3VerifiedSuccess(year = 2025) + fun `PUT object succeeds with if-none-match on non-existing object`(testInfo: TestInfo) { + val nonMatchingEtag = WILDCARD + val bucketName = givenBucket(testInfo) + + s3Client.putObject( + { + it.bucket(bucketName) + it.key(UPLOAD_FILE_NAME) + it.ifNoneMatch(nonMatchingEtag) + }, RequestBody.fromFile(UPLOAD_FILE) + ) + } + @Test @S3VerifiedSuccess(year = 2025) fun `PUT object fails with if-match=false`(testInfo: TestInfo) { @@ -930,6 +944,24 @@ internal class GetPutDeleteObjectIT : S3TestBase() { .hasMessageContaining("Service: S3, Status Code: 412") } + @Test + @S3VerifiedSuccess(year = 2025) + fun `PUT object fails with if-match on non-existing object`(testInfo: TestInfo) { + val nonMatchingEtag = "\"$randomName\"" + val bucketName = givenBucket(testInfo) + + assertThatThrownBy { + s3Client.putObject( + { + it.bucket(bucketName) + it.key(UPLOAD_FILE_NAME) + it.ifMatch(nonMatchingEtag) + }, RequestBody.fromFile(UPLOAD_FILE) + ) + }.isInstanceOf(S3Exception::class.java) + .hasMessageContaining("Service: S3, Status Code: 404") + } + @Test @S3VerifiedFailure(year = 2025, reason = "Supported only on directory buckets. S3 returns: A header you provided implies functionality that is not implemented.") diff --git a/server/src/main/java/com/adobe/testing/s3mock/service/ObjectService.java b/server/src/main/java/com/adobe/testing/s3mock/service/ObjectService.java index af97c19dc..4af5b9094 100644 --- a/server/src/main/java/com/adobe/testing/s3mock/service/ObjectService.java +++ b/server/src/main/java/com/adobe/testing/s3mock/service/ObjectService.java @@ -346,7 +346,12 @@ public void verifyObjectMatching( @Nullable List ifUnmodifiedSince, @Nullable S3ObjectMetadata s3ObjectMetadata) { if (s3ObjectMetadata == null) { - // object does not exist, so we can skip the rest of the checks. + // object does not exist, + if (match != null && !match.isEmpty()) { + // client expects an existing object to match a value, but it could not be found. + throw NO_SUCH_KEY; + } + // no client expectations, skip the rest of the checks. return; } From 83f706cc43d97b7755a50748ccae51f0e61a7836 Mon Sep 17 00:00:00 2001 From: Arne Franken Date: Sun, 6 Jul 2025 16:39:37 +0200 Subject: [PATCH 12/14] Use fixed list of StorageClass values in tests Exclusion is brittle as new StorageClass values may break tests. --- .../com/adobe/testing/s3mock/its/S3TestBase.kt | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3TestBase.kt b/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3TestBase.kt index 22cf130a3..dd36a85c9 100644 --- a/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3TestBase.kt +++ b/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3TestBase.kt @@ -627,16 +627,14 @@ internal abstract class S3TestBase { @JvmStatic protected fun storageClasses(): Stream { - return StorageClass - .entries - .filter { it != StorageClass.UNKNOWN_TO_SDK_VERSION } - .filter { it != StorageClass.SNOW } - .filter { it != StorageClass.EXPRESS_ONEZONE } - .filter { it != StorageClass.GLACIER } - .filter { it != StorageClass.DEEP_ARCHIVE } - .filter { it != StorageClass.OUTPOSTS } - .map { it } - .stream() + return listOf( + StorageClass.STANDARD, + StorageClass.REDUCED_REDUNDANCY, + StorageClass.STANDARD_IA, + StorageClass.ONEZONE_IA, + StorageClass.INTELLIGENT_TIERING, + StorageClass.GLACIER, + ).stream() } @JvmStatic From 2ba51daf47ec17b882ed4cb5a0a6da1b9daea208 Mon Sep 17 00:00:00 2001 From: Arne Franken Date: Sun, 6 Jul 2025 16:47:24 +0200 Subject: [PATCH 13/14] Prepare 4.6.0 --- build-config/pom.xml | 2 +- docker/pom.xml | 2 +- integration-tests/pom.xml | 2 +- pom.xml | 2 +- server/pom.xml | 2 +- testsupport/common/pom.xml | 2 +- testsupport/junit4/pom.xml | 2 +- testsupport/junit5/pom.xml | 2 +- testsupport/pom.xml | 2 +- testsupport/testcontainers/pom.xml | 2 +- testsupport/testng/pom.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/build-config/pom.xml b/build-config/pom.xml index 059711688..110408aec 100644 --- a/build-config/pom.xml +++ b/build-config/pom.xml @@ -21,7 +21,7 @@ com.adobe.testing s3mock-parent - 4.5.2-SNAPSHOT + 4.6.0-SNAPSHOT s3mock-build-config diff --git a/docker/pom.xml b/docker/pom.xml index cd1f760ca..0a6d8387d 100644 --- a/docker/pom.xml +++ b/docker/pom.xml @@ -22,7 +22,7 @@ com.adobe.testing s3mock-parent - 4.5.2-SNAPSHOT + 4.6.0-SNAPSHOT s3mock-docker diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index f6bec25bc..78ac6d6bb 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -22,7 +22,7 @@ com.adobe.testing s3mock-parent - 4.5.2-SNAPSHOT + 4.6.0-SNAPSHOT s3mock-integration-tests diff --git a/pom.xml b/pom.xml index e10241867..3a4bfd940 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.adobe.testing s3mock-parent - 4.5.2-SNAPSHOT + 4.6.0-SNAPSHOT pom S3Mock - Parent diff --git a/server/pom.xml b/server/pom.xml index 07b60f15a..97e4200b8 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -22,7 +22,7 @@ com.adobe.testing s3mock-parent - 4.5.2-SNAPSHOT + 4.6.0-SNAPSHOT s3mock diff --git a/testsupport/common/pom.xml b/testsupport/common/pom.xml index 47aac43fe..0c7f9252a 100644 --- a/testsupport/common/pom.xml +++ b/testsupport/common/pom.xml @@ -22,7 +22,7 @@ com.adobe.testing s3mock-testsupport-reactor - 4.5.2-SNAPSHOT + 4.6.0-SNAPSHOT s3mock-testsupport-common diff --git a/testsupport/junit4/pom.xml b/testsupport/junit4/pom.xml index 3082e1a2a..3c1a75a8d 100644 --- a/testsupport/junit4/pom.xml +++ b/testsupport/junit4/pom.xml @@ -22,7 +22,7 @@ com.adobe.testing s3mock-testsupport-reactor - 4.5.2-SNAPSHOT + 4.6.0-SNAPSHOT s3mock-junit4 diff --git a/testsupport/junit5/pom.xml b/testsupport/junit5/pom.xml index 68af3f1c6..1b9765a15 100644 --- a/testsupport/junit5/pom.xml +++ b/testsupport/junit5/pom.xml @@ -22,7 +22,7 @@ com.adobe.testing s3mock-testsupport-reactor - 4.5.2-SNAPSHOT + 4.6.0-SNAPSHOT s3mock-junit5 diff --git a/testsupport/pom.xml b/testsupport/pom.xml index f439673c4..f3b2e911e 100644 --- a/testsupport/pom.xml +++ b/testsupport/pom.xml @@ -22,7 +22,7 @@ com.adobe.testing s3mock-parent - 4.5.2-SNAPSHOT + 4.6.0-SNAPSHOT s3mock-testsupport-reactor diff --git a/testsupport/testcontainers/pom.xml b/testsupport/testcontainers/pom.xml index 1fba1f1a1..3f597c8e1 100644 --- a/testsupport/testcontainers/pom.xml +++ b/testsupport/testcontainers/pom.xml @@ -22,7 +22,7 @@ com.adobe.testing s3mock-testsupport-reactor - 4.5.2-SNAPSHOT + 4.6.0-SNAPSHOT s3mock-testcontainers diff --git a/testsupport/testng/pom.xml b/testsupport/testng/pom.xml index 1ca2ae312..deb30bebf 100644 --- a/testsupport/testng/pom.xml +++ b/testsupport/testng/pom.xml @@ -22,7 +22,7 @@ com.adobe.testing s3mock-testsupport-reactor - 4.5.2-SNAPSHOT + 4.6.0-SNAPSHOT s3mock-testng From 6fea3e03655fbe706d530c618fd93ca50b4ad749 Mon Sep 17 00:00:00 2001 From: Arne Franken Date: Sun, 6 Jul 2025 16:52:32 +0200 Subject: [PATCH 14/14] Fix log message on "noneMatch" Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../java/com/adobe/testing/s3mock/service/ObjectService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/com/adobe/testing/s3mock/service/ObjectService.java b/server/src/main/java/com/adobe/testing/s3mock/service/ObjectService.java index 4af5b9094..c2a08953d 100644 --- a/server/src/main/java/com/adobe/testing/s3mock/service/ObjectService.java +++ b/server/src/main/java/com/adobe/testing/s3mock/service/ObjectService.java @@ -390,7 +390,7 @@ public void verifyObjectMatching( if (setNoneMatch) { if (noneMatch.contains(WILDCARD_ETAG) || noneMatch.contains(WILDCARD) || noneMatch.contains(etag)) { // request cares only that the object etag does not match. - LOG.debug("Object {} does not exist", s3ObjectMetadata.key()); + LOG.debug("Object {} has an ETag {} that matches one of the 'noneMatch' values", s3ObjectMetadata.key(), etag); throw NOT_MODIFIED; } }