use of io.stackgres.operator.common.StackGresDbOpsReview in project stackgres by ongres.
the class DbOpsPgbenchConstraintValidatorTest method nullBenchmark_shouldFail.
@Test
void nullBenchmark_shouldFail() {
StackGresDbOpsReview review = getValidReview();
review.getRequest().getObject().getSpec().setBenchmark(null);
checkErrorCause(StackGresDbOpsSpec.class, "spec.benchmark", "spec.isBenchmarkSectionProvided", review, AssertTrue.class);
}
use of io.stackgres.operator.common.StackGresDbOpsReview in project stackgres by ongres.
the class DbOpsPgbenchConstraintValidatorTest method wrongBenchmarkType_shouldFail.
@Test
void wrongBenchmarkType_shouldFail() {
StackGresDbOpsReview review = getValidReview();
review.getRequest().getObject().getSpec().getBenchmark().setType("test");
checkErrorCause(StackGresDbOpsBenchmark.class, "spec.benchmark.type", "spec.isTypeValid", review, AssertTrue.class);
}
use of io.stackgres.operator.common.StackGresDbOpsReview in project stackgres by ongres.
the class DbOpsPgbenchConstraintValidatorTest method nullBenchmarkPgbench_shouldFail.
@Test
void nullBenchmarkPgbench_shouldFail() {
StackGresDbOpsReview review = getValidReview();
review.getRequest().getObject().getSpec().getBenchmark().setPgbench(null);
checkErrorCause(StackGresDbOpsBenchmark.class, "spec.benchmark.pgbench", "spec.benchmark.isPgbenchSectionProvided", review, AssertTrue.class);
}
use of io.stackgres.operator.common.StackGresDbOpsReview in project stackgres by ongres.
the class DbOpsPgbenchConstraintValidatorTest method wrongDuration_shouldFail.
@Test
void wrongDuration_shouldFail() {
StackGresDbOpsReview review = getValidReview();
review.getRequest().getObject().getSpec().getBenchmark().getPgbench().setDuration("10s");
checkErrorCause(StackGresDbOpsPgbench.class, "spec.benchmark.pgbench.duration", "spec.benchmark.pgbench.isDurationValid", review, AssertTrue.class);
}
use of io.stackgres.operator.common.StackGresDbOpsReview in project stackgres by ongres.
the class DbOpsPgbenchConstraintValidatorTest 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