Skip to content

Commit

Permalink
feat: change customTimeBefore type to date only
Browse files Browse the repository at this point in the history
  • Loading branch information
athakor committed Aug 27, 2020
1 parent 588e23a commit bd79392
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ Rule toPb() {
.setCustomTimeBefore(
lifecycleCondition.getCustomTimeBefore() == null
? null
: new DateTime(lifecycleCondition.getCustomTimeBefore().getValue()))
: new DateTime(true, lifecycleCondition.getCustomTimeBefore().getValue(), 0))
.setDaysSinceCustomTime(lifecycleCondition.getDaysSinceCustomTime());

rule.setCondition(condition);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2252,6 +2252,8 @@ public void testBucketLifecycleRules() {
.setMatchesStorageClass(ImmutableList.of(StorageClass.COLDLINE))
.setDaysSinceNoncurrentTime(30)
.setNoncurrentTimeBefore(new DateTime(System.currentTimeMillis()))
.setCustomTimeBefore(new DateTime(System.currentTimeMillis()))
.setDaysSinceCustomTime(30)
.build())))
.build();
EasyMock.expect(
Expand All @@ -2268,5 +2270,7 @@ public void testBucketLifecycleRules() {
assertEquals(1, lifecycleRule.getCondition().getMatchesStorageClass().size());
assertEquals(30, lifecycleRule.getCondition().getDaysSinceNoncurrentTime().intValue());
assertNotNull(lifecycleRule.getCondition().getNoncurrentTimeBefore());
assertEquals(30, lifecycleRule.getCondition().getDaysSinceCustomTime().intValue());
assertNotNull(lifecycleRule.getCondition().getCustomTimeBefore());
}
}

0 comments on commit bd79392

Please sign in to comment.