Search in sources :

Example 6 with PgConfigReview

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

the class BlocklistValidatorTest method givenConfigurationDeletion_shouldNotFail.

@Test
void givenConfigurationDeletion_shouldNotFail() throws ValidationFailed {
    PgConfigReview review = JsonUtil.readFromJson("pgconfig_allow_request/pgconfig_delete.json", PgConfigReview.class);
    validator.validate(review);
}
Also used : PgConfigReview(io.stackgres.operator.common.PgConfigReview) Test(org.junit.jupiter.api.Test)

Example 7 with PgConfigReview

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

the class BlocklistValidatorTest method givenValidConfigurationCreation_shouldNotFail.

@Test
void givenValidConfigurationCreation_shouldNotFail() throws ValidationFailed {
    PgConfigReview review = JsonUtil.readFromJson("pgconfig_allow_request/valid_pgconfig.json", PgConfigReview.class);
    validator.validate(review);
}
Also used : PgConfigReview(io.stackgres.operator.common.PgConfigReview) Test(org.junit.jupiter.api.Test)

Example 8 with PgConfigReview

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

the class PgConfigConstraintValidatorTest method emptyPosgrestConf_shouldFail.

@Test
void emptyPosgrestConf_shouldFail() {
    PgConfigReview review = getValidReview();
    review.getRequest().getObject().getSpec().setPostgresqlConf(new HashMap<>());
    checkNotEmptyErrorCause(StackGresPostgresConfigSpec.class, "spec.postgresqlConf", review);
}
Also used : PgConfigReview(io.stackgres.operator.common.PgConfigReview) Test(org.junit.jupiter.api.Test) ConstraintValidationTest(io.stackgres.operator.validation.ConstraintValidationTest)

Example 9 with PgConfigReview

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

the class PgConfigConstraintValidatorTest method nullSpec_shouldFail.

@Test
void nullSpec_shouldFail() {
    PgConfigReview review = getInvalidReview();
    checkNotNullErrorCause(StackGresPostgresConfig.class, "spec", review);
}
Also used : PgConfigReview(io.stackgres.operator.common.PgConfigReview) Test(org.junit.jupiter.api.Test) ConstraintValidationTest(io.stackgres.operator.validation.ConstraintValidationTest)

Example 10 with PgConfigReview

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

the class PgConfigValidationPipelineTest method getConstraintViolatingReview.

@Override
public PgConfigReview getConstraintViolatingReview() {
    PgConfigReview review = getValidReview();
    review.getRequest().getObject().getSpec().setPostgresqlConf(new HashMap<>());
    return review;
}
Also used : PgConfigReview(io.stackgres.operator.common.PgConfigReview)

Aggregations

PgConfigReview (io.stackgres.operator.common.PgConfigReview)11 Test (org.junit.jupiter.api.Test)7 StackGresPostgresConfig (io.stackgres.common.crd.sgpgconfig.StackGresPostgresConfig)2 ConstraintValidationTest (io.stackgres.operator.validation.ConstraintValidationTest)2 ValidationFailed (io.stackgres.operatorframework.admissionwebhook.validating.ValidationFailed)2