Skip to content

Commit 2fa1a2a

Browse files
committed
Update the objectLock tests
1 parent da7580c commit 2fa1a2a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

blob/blob-client/src/test/java/com/salesforce/multicloudj/blob/client/AbstractBlobStoreIT.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2067,14 +2067,20 @@ public TestConfig(
20672067
}
20682068
}
20692069

2070+
/** Fixed retainUntil for object lock tests so WireMock replay matches recorded request body. */
2071+
private static final Instant OBJECT_LOCK_RETAIN_UNTIL_GOVERNANCE =
2072+
Instant.parse("2026-03-11T15:47:28.252Z");
2073+
private static final Instant OBJECT_LOCK_RETAIN_UNTIL_COMPLIANCE =
2074+
Instant.parse("2026-03-11T15:47:25.512Z");
2075+
20702076
@Test
20712077
public void testGetObjectLock_afterUploadWithRetentionGovernance() throws IOException {
20722078
Assumptions.assumeTrue(
20732079
harness.isObjectLockSupported(), "Object lock not supported by this provider");
20742080

20752081
String key = "conformance-tests/objectlock/retention-governance";
20762082
byte[] content = "Object lock retention governance test".getBytes(StandardCharsets.UTF_8);
2077-
Instant retainUntil = Instant.now().plusSeconds(86400); // 1 day
2083+
Instant retainUntil = OBJECT_LOCK_RETAIN_UNTIL_GOVERNANCE;
20782084

20792085
AbstractBlobStore blobStore = harness.createBlobStore(true, true, true, true);
20802086
BucketClient bucketClient = new BucketClient(blobStore);
@@ -2114,7 +2120,7 @@ public void testGetObjectLock_afterUploadWithRetentionCompliance() throws IOExce
21142120

21152121
String key = "conformance-tests/objectlock/retention-compliance";
21162122
byte[] content = "Object lock retention compliance test".getBytes(StandardCharsets.UTF_8);
2117-
Instant retainUntil = Instant.now().plusSeconds(86400);
2123+
Instant retainUntil = OBJECT_LOCK_RETAIN_UNTIL_COMPLIANCE;
21182124

21192125
AbstractBlobStore blobStore = harness.createBlobStore(true, true, true, true);
21202126
BucketClient bucketClient = new BucketClient(blobStore);

0 commit comments

Comments
 (0)