Skip to content

Commit

Permalink
BucketInfo: add null check for rules in builder. Add test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
mziccard committed Sep 18, 2015
1 parent 34d5b7a commit 3a183e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ public Builder notFoundPage(String notFoundPage) {
}

public Builder deleteRules(Iterable<? extends DeleteRule> rules) {
this.deleteRules = ImmutableList.copyOf(rules);
this.deleteRules = rules != null ? ImmutableList.copyOf(rules) : null;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ public void testToBuilder() {
compareBuckets(BUCKET_INFO, bucketInfo);
}

@Test
public void testToBuilderIncomplete() {
BucketInfo incompleteBucketInfo = BucketInfo.builder("b").build();
assertEquals(incompleteBucketInfo.name(), incompleteBucketInfo.toBuilder().build().name());
}

@Test
public void testOf() {
BucketInfo bucketInfo = BucketInfo.of("bucket");
Expand Down

0 comments on commit 3a183e4

Please sign in to comment.