use of io.stackgres.operator.common.StackGresDbOpsReview in project stackgres by ongres.
the class DbOpsConstraintValidatorTest method wrongRunAt_shouldFail.
@Test
void wrongRunAt_shouldFail() {
StackGresDbOpsReview review = getValidReview();
review.getRequest().getObject().getSpec().setRunAt("2018-01-01 01:02:03");
checkErrorCause(StackGresDbOpsSpec.class, "spec.runAt", "spec.isRunAtValid", review, AssertTrue.class);
}
use of io.stackgres.operator.common.StackGresDbOpsReview in project stackgres by ongres.
the class DbOpsConstraintValidatorTest method nullSgCluster_shouldFail.
@Test
void nullSgCluster_shouldFail() {
StackGresDbOpsReview review = getValidReview();
review.getRequest().getObject().getSpec().setSgCluster(null);
checkErrorCause(StackGresDbOpsSpec.class, "spec.sgCluster", review, NotNull.class);
}
use of io.stackgres.operator.common.StackGresDbOpsReview in project stackgres by ongres.
the class DbOpsConstraintValidatorTest method invalidDuration_shouldFailWithMessage.
@Test
void invalidDuration_shouldFailWithMessage() {
StackGresDbOpsReview review = getValidReview();
review.getRequest().getObject().getSpec().getBenchmark().getPgbench().setDuration("P5M");
ValidationFailed assertThrows = assertThrows(ValidationFailed.class, () -> validator.validate(review));
assertEquals("SGDbOps has invalid properties. " + "duration must be positive and in ISO 8601 duration format: `PnDTnHnMn.nS`.", assertThrows.getMessage());
}
use of io.stackgres.operator.common.StackGresDbOpsReview in project stackgres by ongres.
the class DbOpsConstraintValidatorTest method nullSpec_shouldFail.
@Test
void nullSpec_shouldFail() {
StackGresDbOpsReview review = getValidReview();
review.getRequest().getObject().setSpec(null);
checkNotNullErrorCause(StackGresDbOps.class, "spec", review);
}
use of io.stackgres.operator.common.StackGresDbOpsReview in project stackgres by ongres.
the class DbOpsConstraintValidatorTest method getInvalidReview.
@Override
protected StackGresDbOpsReview getInvalidReview() {
final StackGresDbOpsReview review = JsonUtil.readFromJson("dbops_allow_requests/valid_pgbench_creation.json", StackGresDbOpsReview.class);
review.getRequest().getObject().setSpec(null);
return review;
}
Aggregations