use of io.stackgres.operator.common.StackGresDbOpsReview in project stackgres by ongres.
the class DbOpsRepackConstraintValidatorTest method nullVacuum_shouldPass.
@Test
void nullVacuum_shouldPass() throws ValidationFailed {
StackGresDbOpsReview review = getValidReview();
review.getRequest().getObject().getSpec().setBenchmark(null);
validator.validate(review);
}
use of io.stackgres.operator.common.StackGresDbOpsReview in project stackgres by ongres.
the class DbOpsSecurityUpgradeValidatorTest method givenValidStackGresVersionOnCreation_shouldNotFail.
@Test
void givenValidStackGresVersionOnCreation_shouldNotFail() throws ValidationFailed {
final StackGresDbOpsReview review = getCreationReview();
String sgcluster = review.getRequest().getObject().getSpec().getSgCluster();
String namespace = review.getRequest().getObject().getMetadata().getNamespace();
when(clusterFinder.findByNameAndNamespace(sgcluster, namespace)).thenReturn(Optional.of(cluster));
validator.validate(review);
verify(clusterFinder).findByNameAndNamespace(eq(sgcluster), eq(namespace));
}
use of io.stackgres.operator.common.StackGresDbOpsReview in project stackgres by ongres.
the class DbOpsConstraintValidatorTest method negativeTimeout_shouldFail.
@Test
void negativeTimeout_shouldFail() {
StackGresDbOpsReview review = getValidReview();
review.getRequest().getObject().getSpec().setTimeout("-PT1M");
checkErrorCause(StackGresDbOpsSpec.class, "spec.timeout", "spec.isTimeoutValid", review, AssertTrue.class);
}
use of io.stackgres.operator.common.StackGresDbOpsReview in project stackgres by ongres.
the class DbOpsConstraintValidatorTest method wrongTimeout_shouldFail.
@Test
void wrongTimeout_shouldFail() {
StackGresDbOpsReview review = getValidReview();
review.getRequest().getObject().getSpec().setTimeout("10s");
checkErrorCause(StackGresDbOpsSpec.class, "spec.timeout", "spec.isTimeoutValid", review, AssertTrue.class);
}
use of io.stackgres.operator.common.StackGresDbOpsReview in project stackgres by ongres.
the class DbOpsConstraintValidatorTest method wrongOp_shouldFail.
@Test
void wrongOp_shouldFail() {
StackGresDbOpsReview review = getValidReview();
review.getRequest().getObject().getSpec().setOp("test");
checkErrorCause(StackGresDbOpsSpec.class, "spec.op", "spec.isOpValid", review, AssertTrue.class);
}
Aggregations