use of io.stackgres.common.crd.postgres.service.StackGresPostgresService in project stackgres by ongres.
the class DistributedLogsPostgresServicesConverterTest method shouldPgServicePrimaryBeConvertedSuccessfully_fromSgDistributedLogsPgServicePrimary.
@Test
void shouldPgServicePrimaryBeConvertedSuccessfully_fromSgDistributedLogsPgServicePrimary() {
StackGresDistributedLogsPostgresServices sgPostgresServices = new StackGresDistributedLogsPostgresServicesFixture().withPrimary().build();
DistributedLogsPostgresServices pgServicesConverted = converter.from(sgPostgresServices);
StackGresPostgresService sgPgPrimary = sgPostgresServices.getPrimary();
PostgresService dlPgPrimary = pgServicesConverted.getPrimary();
assertEquals(sgPgPrimary.getEnabled(), dlPgPrimary.getEnabled());
assertEquals(sgPgPrimary.getType(), dlPgPrimary.getType());
assertNull(pgServicesConverted.getReplicas());
}
use of io.stackgres.common.crd.postgres.service.StackGresPostgresService in project stackgres by ongres.
the class DistributedLogsPostgresServicesConverterTest method shouldPgServiceReplicasBeConvertedSuccessfully_fromSgDistributedLogsPgServiceReplicas.
@Test
void shouldPgServiceReplicasBeConvertedSuccessfully_fromSgDistributedLogsPgServiceReplicas() {
StackGresDistributedLogsPostgresServices sgPostgresServices = new StackGresDistributedLogsPostgresServicesFixture().withReplicas().build();
DistributedLogsPostgresServices pgServicesConverted = converter.from(sgPostgresServices);
StackGresPostgresService sgPgReplicas = sgPostgresServices.getReplicas();
PostgresService dlPgReplicas = pgServicesConverted.getReplicas();
assertEquals(sgPgReplicas.getEnabled(), dlPgReplicas.getEnabled());
assertEquals(sgPgReplicas.getType(), dlPgReplicas.getType());
assertNull(pgServicesConverted.getPrimary());
}
use of io.stackgres.common.crd.postgres.service.StackGresPostgresService in project stackgres by ongres.
the class StackGresDistributedLogsPostgresServicesFixture method withPrimary.
public StackGresDistributedLogsPostgresServicesFixture withPrimary() {
StackGresPostgresService primary = new StackGresPostgresService();
primary.setEnabled(true);
primary.setType(StackGresPostgresServiceType.CLUSTER_IP.name());
postgresServices.setPrimary(primary);
return this;
}
use of io.stackgres.common.crd.postgres.service.StackGresPostgresService in project stackgres by ongres.
the class StackGresDistributedLogsPostgresServicesFixture method withReplicas.
public StackGresDistributedLogsPostgresServicesFixture withReplicas() {
StackGresPostgresService replicas = new StackGresPostgresService();
replicas.setEnabled(true);
replicas.setType(StackGresPostgresServiceType.CLUSTER_IP.name());
this.postgresServices.setReplicas(replicas);
return this;
}
use of io.stackgres.common.crd.postgres.service.StackGresPostgresService in project stackgres by ongres.
the class PatroniServicesTest method enablePrimaryService.
private void enablePrimaryService(StackGresPostgresServiceType type) {
enablePrimaryService(true);
final StackGresPostgresService primary = defaultCluster.getSpec().getPostgresServices().getPrimary();
primary.setType(type.toString());
}
Aggregations