Skip to content

Commit

Permalink
fixing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sydney-munro committed Mar 15, 2024
1 parent b177e9a commit 9bdf885
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,8 @@ public abstract static class PartMetadataFieldDecorator implements Serializable
* <p>When provided with a duration, a time in the future will be calculated for each part file
* upon upload, this new value can be used in OLM rules to cleanup abandoned part files.
*
* @see {@link https://cloud.google.com/storage/docs/lifecycle#dayssincecustomtime}
* See [CustomTime OLM documentation](https://cloud.google.com/storage/docs/lifecycle#dayssincecustomtime)
*
* @see #withPartMetadataFieldDecorator(PartMetadataFieldDecorator)
* @since 2.35.1 This new api is in preview and is subject to breaking changes.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ public void partMetadataFieldDecorator_customTime() {
BlobInfo.Builder testBlob = BlobInfo.newBuilder("testBlob", "testBucket");
Duration duration = Duration.ofSeconds(30);
TestClock clock = TestClock.tickBy(Instant.EPOCH, Duration.ofSeconds(1));
OffsetDateTime expected = OffsetDateTime.from(Instant.EPOCH.plus(duration).atZone(ZoneId.of("Z")));
OffsetDateTime expected =
OffsetDateTime.from(Instant.EPOCH.plus(duration).atZone(ZoneId.of("Z")));
PartMetadataFieldDecorator.setCustomTimeInFuture(duration).newInstance(clock).apply(testBlob);

assertThat(expected).isEqualTo(testBlob.build().getCustomTimeOffsetDateTime());
Expand Down

0 comments on commit 9bdf885

Please sign in to comment.