use of io.stackgres.apiweb.transformer.distributedlogs.converter.fixture.StackGresDistributedLogsPostgresServicesFixture 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.apiweb.transformer.distributedlogs.converter.fixture.StackGresDistributedLogsPostgresServicesFixture 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.apiweb.transformer.distributedlogs.converter.fixture.StackGresDistributedLogsPostgresServicesFixture in project stackgres by ongres.
the class DistributedLogsPostgresServicesConverterTest method shouldPgServicesPrimaryAndReplicasBeNull_onceThereIsNoSgDistributedLogsPgServices.
@Test
void shouldPgServicesPrimaryAndReplicasBeNull_onceThereIsNoSgDistributedLogsPgServices() {
StackGresDistributedLogsPostgresServices sgPostgresServices = new StackGresDistributedLogsPostgresServicesFixture().build();
DistributedLogsPostgresServices pgServicesConverted = converter.from(sgPostgresServices);
assertNull(pgServicesConverted.getReplicas());
assertNull(pgServicesConverted.getPrimary());
}
Aggregations