Search in sources :

Example 1 with DbOpsScanner

use of io.stackgres.common.resource.DbOpsScanner in project stackgres by ongres.

the class ClusterEventResourceTest method setup.

@BeforeAll
public static void setup() {
    StackGresDbOps dbOps = new StackGresDbOps();
    dbOps.setMetadata(new ObjectMeta());
    dbOps.getMetadata().setNamespace("test-namespace");
    dbOps.getMetadata().setName("test-operation");
    dbOps.getMetadata().setUid("1");
    dbOps.setSpec(new StackGresDbOpsSpec());
    dbOps.getSpec().setSgCluster("test");
    DbOpsScanner dbOpsScanner = Mockito.mock(DbOpsScanner.class);
    Mockito.when(dbOpsScanner.getResources(ArgumentMatchers.any())).thenReturn(ImmutableList.of(dbOps));
    QuarkusMock.installMockForType(dbOpsScanner, DbOpsScanner.class);
}
Also used : ObjectMeta(io.fabric8.kubernetes.api.model.ObjectMeta) StackGresDbOpsSpec(io.stackgres.common.crd.sgdbops.StackGresDbOpsSpec) DbOpsScanner(io.stackgres.common.resource.DbOpsScanner) StackGresDbOps(io.stackgres.common.crd.sgdbops.StackGresDbOps) BeforeAll(org.junit.jupiter.api.BeforeAll)

Aggregations

ObjectMeta (io.fabric8.kubernetes.api.model.ObjectMeta)1 StackGresDbOps (io.stackgres.common.crd.sgdbops.StackGresDbOps)1 StackGresDbOpsSpec (io.stackgres.common.crd.sgdbops.StackGresDbOpsSpec)1 DbOpsScanner (io.stackgres.common.resource.DbOpsScanner)1 BeforeAll (org.junit.jupiter.api.BeforeAll)1