Search in sources :

Example 1 with StackGresBackupList

use of io.stackgres.common.crd.sgbackup.StackGresBackupList in project stackgres by ongres.

the class RestoreConfigValidatorTest method givenAValidCreation_shouldPass.

@Test
void givenAValidCreation_shouldPass() throws ValidationFailed {
    final StackGresClusterReview review = getCreationReview();
    review.getRequest().getObject().getSpec().getPostgres().setVersion(firstPgMajorVersion);
    StackGresBackupList backupList = JsonUtil.readFromJson("backup/list.json", StackGresBackupList.class);
    backupList.getItems().get(0).getStatus().getBackupInformation().setPostgresVersion(firstPgMajorVersionNumber);
    when(scanner.findResources()).thenReturn(Optional.of(backupList.getItems()));
    validator.validate(review);
    verify(scanner).findResources();
}
Also used : StackGresClusterReview(io.stackgres.operator.common.StackGresClusterReview) StackGresBackupList(io.stackgres.common.crd.sgbackup.StackGresBackupList) Test(org.junit.jupiter.api.Test)

Aggregations

StackGresBackupList (io.stackgres.common.crd.sgbackup.StackGresBackupList)1 StackGresClusterReview (io.stackgres.operator.common.StackGresClusterReview)1 Test (org.junit.jupiter.api.Test)1