Search in sources :

Example 6 with StackGresDbOpsReview

use of io.stackgres.operator.common.StackGresDbOpsReview in project stackgres by ongres.

the class DbOpsPgbenchConstraintValidatorTest method invalidLowConcurrentClients_shouldFail.

@Test
void invalidLowConcurrentClients_shouldFail() {
    StackGresDbOpsReview review = getValidReview();
    review.getRequest().getObject().getSpec().getBenchmark().getPgbench().setConcurrentClients(0);
    checkErrorCause(StackGresDbOpsPgbench.class, "spec.benchmark.pgbench.concurrentClients", review, Min.class);
}
Also used : StackGresDbOpsReview(io.stackgres.operator.common.StackGresDbOpsReview) Test(org.junit.jupiter.api.Test) ConstraintValidationTest(io.stackgres.operator.validation.ConstraintValidationTest)

Example 7 with StackGresDbOpsReview

use of io.stackgres.operator.common.StackGresDbOpsReview in project stackgres by ongres.

the class DbOpsPgbenchConstraintValidatorTest method nullBenchmarkType_shouldFail.

@Test
void nullBenchmarkType_shouldFail() {
    StackGresDbOpsReview review = getValidReview();
    review.getRequest().getObject().getSpec().getBenchmark().setType(null);
    checkErrorCause(StackGresDbOpsBenchmark.class, "spec.benchmark.type", review, NotNull.class);
}
Also used : StackGresDbOpsReview(io.stackgres.operator.common.StackGresDbOpsReview) Test(org.junit.jupiter.api.Test) ConstraintValidationTest(io.stackgres.operator.validation.ConstraintValidationTest)

Example 8 with StackGresDbOpsReview

use of io.stackgres.operator.common.StackGresDbOpsReview in project stackgres by ongres.

the class DbOpsPgbenchConstraintValidatorTest method invalidLowThreads_shouldFail.

@Test
void invalidLowThreads_shouldFail() {
    StackGresDbOpsReview review = getValidReview();
    review.getRequest().getObject().getSpec().getBenchmark().getPgbench().setThreads(0);
    checkErrorCause(StackGresDbOpsPgbench.class, "spec.benchmark.pgbench.threads", review, Min.class);
}
Also used : StackGresDbOpsReview(io.stackgres.operator.common.StackGresDbOpsReview) Test(org.junit.jupiter.api.Test) ConstraintValidationTest(io.stackgres.operator.validation.ConstraintValidationTest)

Example 9 with StackGresDbOpsReview

use of io.stackgres.operator.common.StackGresDbOpsReview in project stackgres by ongres.

the class DbOpsRepackConstraintValidatorTest method wrongWaitTimeout_shouldFail.

@Test
void wrongWaitTimeout_shouldFail() {
    StackGresDbOpsReview review = getValidReview();
    review.getRequest().getObject().getSpec().getRepack().setWaitTimeout("10s");
    checkErrorCause(StackGresDbOpsRepack.class, "spec.repack.waitTimeout", "spec.repack.isWaitTimeoutValid", review, AssertTrue.class);
}
Also used : StackGresDbOpsReview(io.stackgres.operator.common.StackGresDbOpsReview) Test(org.junit.jupiter.api.Test) ConstraintValidationTest(io.stackgres.operator.validation.ConstraintValidationTest)

Example 10 with StackGresDbOpsReview

use of io.stackgres.operator.common.StackGresDbOpsReview in project stackgres by ongres.

the class DbOpsRepackConstraintValidatorTest method getInvalidReview.

@Override
protected StackGresDbOpsReview getInvalidReview() {
    final StackGresDbOpsReview review = JsonUtil.readFromJson("dbops_allow_requests/valid_repack_creation.json", StackGresDbOpsReview.class);
    review.getRequest().getObject().setSpec(null);
    return review;
}
Also used : StackGresDbOpsReview(io.stackgres.operator.common.StackGresDbOpsReview)

Aggregations

StackGresDbOpsReview (io.stackgres.operator.common.StackGresDbOpsReview)28 Test (org.junit.jupiter.api.Test)24 ConstraintValidationTest (io.stackgres.operator.validation.ConstraintValidationTest)22 ValidationFailed (io.stackgres.operatorframework.admissionwebhook.validating.ValidationFailed)2