use of com.google.bigtable.admin.v2.GcRule in project java-bigtable by googleapis.
the class GCRulesTest method intersectionEmpty.
@Test
public void intersectionEmpty() {
GcRule actual = GCRULES.intersection().toProto();
GcRule expected = GcRule.newBuilder().build();
assertThat(actual).isEqualTo(expected);
}
use of com.google.bigtable.admin.v2.GcRule in project java-bigtable by googleapis.
the class GCRulesTest method intersectionThree.
@Test
public void intersectionThree() {
GcRule actual = GCRULES.intersection().rule(GCRULES.maxVersions(1)).rule(GCRULES.maxAge(Duration.ofSeconds(1))).rule(GCRULES.maxAge(Duration.ofNanos(1))).toProto();
GcRule expected = GcRule.newBuilder().setIntersection(Intersection.newBuilder().addRules(buildVersionsRule(1)).addRules(buildAgeRule(1, 0)).addRules(buildAgeRule(0, 1))).build();
assertThat(actual).isEqualTo(expected);
}
use of com.google.bigtable.admin.v2.GcRule in project java-bigtable by googleapis.
the class GCRulesTest method duration.
@Test
public void duration() {
DurationRule actual = GCRULES.maxAge(Duration.ofSeconds(61, 9));
GcRule expected = buildAgeRule(61, 9);
assertNotNull(actual.getMaxAge());
assertThat(actual.toProto()).isEqualTo(expected);
}
use of com.google.bigtable.admin.v2.GcRule in project java-bigtable by googleapis.
the class GCRulesTest method durationTimeUnitNanos.
@Test
public void durationTimeUnitNanos() {
GcRule actual = GCRULES.maxAge(1, TimeUnit.NANOSECONDS).toProto();
GcRule expected = buildAgeRule(0, 1);
assertThat(actual).isEqualTo(expected);
}
use of com.google.bigtable.admin.v2.GcRule in project java-bigtable by googleapis.
the class GCRulesTest method unionTwo.
@Test
public void unionTwo() {
GcRule actual = GCRULES.union().rule(GCRULES.maxVersions(1)).rule(GCRULES.maxAge(Duration.ofSeconds(1))).toProto();
GcRule expected = GcRule.newBuilder().setUnion(Union.newBuilder().addRules(buildVersionsRule(1)).addRules(buildAgeRule(1, 0))).build();
assertThat(actual).isEqualTo(expected);
}
Aggregations