Skip to content

Commit 73cdc8a

Browse files
authored
Merge pull request #2484 from adobe/2481-islatest-true-by-default
Always return "isLatest=true" if versioning is disabled
2 parents 6fd38c4 + 84fa031 commit 73cdc8a

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Whenever a 3rd party library is updated, S3Mock will update it's MINOR version.
99
* [Planned changes](#planned-changes)
1010
* [CURRENT - 4.x - THIS VERSION IS UNDER ACTIVE DEVELOPMENT](#current---4x---this-version-is-under-active-development)
1111
* [4.6.0 - PLANNED](#460---planned)
12+
* [4.5.1](#451)
1213
* [4.5.0](#450)
1314
* [4.4.0](#440)
1415
* [4.3.0](#430)
@@ -157,6 +158,19 @@ Version 4.x is JDK17 LTS bytecode compatible, with Docker and JUnit / direct Jav
157158
* Version updates (build dependencies)
158159
* TBD
159160

161+
## 4.5.1
162+
Version 4.x is JDK17 LTS bytecode compatible, with Docker and JUnit / direct Java integration.
163+
164+
* Features and fixes
165+
* ListObjectVersions API returns "isLatest=true" if versioning is not enabled. (fixes #2481)
166+
* Refactorings
167+
* TBD
168+
* Version updates (deliverable dependencies)
169+
* None
170+
* Version updates (build dependencies)
171+
* Bump kotlin.version from 2.1.21 to 2.2.0
172+
* Bump com.puppycrawl.tools:checkstyle from 10.25.0 to 10.26.0
173+
160174
## 4.5.0
161175
Version 4.x is JDK17 LTS bytecode compatible, with Docker and JUnit / direct Java integration.
162176

integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/ListObjectVersionsIT.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ internal class ListObjectVersionsIT : S3TestBase() {
127127
}.also {
128128
assertThat(it.versions())
129129
.hasSize(2)
130-
.extracting("versionId")
131-
.containsExactlyInAnyOrder("null", "null")
130+
.extracting("versionId", "isLatest")
131+
.containsExactly(Tuple("null", true), Tuple("null", true))
132132
}
133133
}
134134

server/src/main/java/com/adobe/testing/s3mock/dto/ObjectVersion.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ public record ObjectVersion(
4747
public static ObjectVersion from(S3ObjectMetadata s3ObjectMetadata, boolean isLatest) {
4848
return new ObjectVersion(s3ObjectMetadata.checksumAlgorithm(),
4949
s3ObjectMetadata.checksumType(),
50-
s3ObjectMetadata.etag(), isLatest,
50+
s3ObjectMetadata.etag(),
51+
isLatest,
5152
s3ObjectMetadata.key(),
5253
s3ObjectMetadata.modificationDate(),
5354
s3ObjectMetadata.owner(),
@@ -57,11 +58,14 @@ public static ObjectVersion from(S3ObjectMetadata s3ObjectMetadata, boolean isLa
5758
s3ObjectMetadata.versionId());
5859
}
5960

61+
/**
62+
* Use if versioning is not enabled.
63+
*/
6064
public static ObjectVersion from(S3Object s3Object) {
6165
return new ObjectVersion(s3Object.checksumAlgorithm(),
6266
s3Object.checksumType(),
6367
s3Object.etag(),
64-
false,
68+
true,
6569
s3Object.key(),
6670
s3Object.lastModified(),
6771
s3Object.owner(),

0 commit comments

Comments
 (0)