use of com.google.cloud.bigtable.admin.v2.models.GCRules.UnionRule in project java-bigtable by googleapis.
the class GCRulesTest method unionOfIntersections.
@Test
public void unionOfIntersections() {
UnionRule actual = GCRULES.union().rule(GCRULES.intersection().rule(GCRULES.maxVersions(1)).rule(GCRULES.maxAge(Duration.ofSeconds(1)))).rule(GCRULES.intersection().rule(GCRULES.maxVersions(1)).rule(GCRULES.maxAge(Duration.ofSeconds(1))));
GcRule expected = GcRule.newBuilder().setUnion(Union.newBuilder().addRules(GcRule.newBuilder().setIntersection(Intersection.newBuilder().addRules(buildVersionsRule(1)).addRules(buildAgeRule(1, 0)))).addRules(GcRule.newBuilder().setIntersection(Intersection.newBuilder().addRules(buildVersionsRule(1)).addRules(buildAgeRule(1, 0))))).build();
assertEquals(2, actual.getRulesList().size());
assertThat(actual.toProto()).isEqualTo(expected);
}
Aggregations