Search in sources :

Example 1 with StackGresDistributedLogsSpecFixture

use of io.stackgres.common.fixture.StackGresDistributedLogsSpecFixture in project stackgres by ongres.

the class StackGresDistributedLogsUtilTest method shouldBuildSgDistributedLogsPostgresServices_withOnlyReplicas.

@Test
void shouldBuildSgDistributedLogsPostgresServices_withOnlyReplicas() {
    StackGresDistributedLogsSpec spec = new StackGresDistributedLogsSpecFixture().withReplicasPostgresServices(replicas).build();
    StackGresClusterPostgresServices postgresServices = StackGresDistributedLogsUtil.buildPostgresServices(spec);
    assertNull(postgresServices.getPrimary());
    assertNotNull(postgresServices.getReplicas());
    assertTrue(replicas.equals(postgresServices.getReplicas()));
}
Also used : StackGresDistributedLogsSpec(io.stackgres.common.crd.sgdistributedlogs.StackGresDistributedLogsSpec) StackGresDistributedLogsSpecFixture(io.stackgres.common.fixture.StackGresDistributedLogsSpecFixture) StackGresClusterPostgresServices(io.stackgres.common.crd.sgcluster.StackGresClusterPostgresServices) Test(org.junit.jupiter.api.Test)

Example 2 with StackGresDistributedLogsSpecFixture

use of io.stackgres.common.fixture.StackGresDistributedLogsSpecFixture in project stackgres by ongres.

the class StackGresDistributedLogsUtilTest method shouldBuildSgDistributedLogsPostgresServices_withOnlyPrimary.

@Test
void shouldBuildSgDistributedLogsPostgresServices_withOnlyPrimary() {
    StackGresDistributedLogsSpec spec = new StackGresDistributedLogsSpecFixture().withPrimaryPostgresServices(primary).build();
    StackGresClusterPostgresServices postgresServices = StackGresDistributedLogsUtil.buildPostgresServices(spec);
    assertNotNull(postgresServices.getPrimary());
    assertNull(postgresServices.getReplicas());
    assertTrue(primary.equals(postgresServices.getPrimary()));
}
Also used : StackGresDistributedLogsSpec(io.stackgres.common.crd.sgdistributedlogs.StackGresDistributedLogsSpec) StackGresDistributedLogsSpecFixture(io.stackgres.common.fixture.StackGresDistributedLogsSpecFixture) StackGresClusterPostgresServices(io.stackgres.common.crd.sgcluster.StackGresClusterPostgresServices) Test(org.junit.jupiter.api.Test)

Aggregations

StackGresClusterPostgresServices (io.stackgres.common.crd.sgcluster.StackGresClusterPostgresServices)2 StackGresDistributedLogsSpec (io.stackgres.common.crd.sgdistributedlogs.StackGresDistributedLogsSpec)2 StackGresDistributedLogsSpecFixture (io.stackgres.common.fixture.StackGresDistributedLogsSpecFixture)2 Test (org.junit.jupiter.api.Test)2