use of io.stackgres.operator.common.BackupConfigReview in project stackgres by ongres.
the class BackupConfigConstraintValidationTest method givenStorageClass_shouldFail.
@ParameterizedTest
@ValueSource(strings = { "DEMO", "STANDARDIA", "reduced_redundancy" })
void givenStorageClass_shouldFail(String storageClass) {
BackupConfigReview review = JsonUtil.readFromJson("backupconfig_allow_request/update.json", BackupConfigReview.class);
review.getRequest().getObject().getSpec().getStorage().getS3Compatible().setStorageClass(storageClass);
ValidationFailed ex = assertThrows(ValidationFailed.class, () -> {
validator.validate(review);
});
String errorMessage = ex.getResult().getMessage();
assertEquals("SGBackupConfig has invalid properties. " + "storageClass must be one of STANDARD, STANDARD_IA or REDUCED_REDUNDANCY.", errorMessage);
}
Aggregations