Search in sources :

Example 1 with DistributedLogsPostgresServices

use of io.stackgres.apiweb.dto.distributedlogs.DistributedLogsPostgresServices in project stackgres by ongres.

the class DistributedLogsPostgresServicesConverterTest method shouldPostgresServicesNull_onceSgDistributedLogsPostgresServicesWasInvalid.

@Test
void shouldPostgresServicesNull_onceSgDistributedLogsPostgresServicesWasInvalid() {
    DistributedLogsPostgresServices pgServicesConverted = converter.from(null);
    assertNull(pgServicesConverted);
}
Also used : StackGresDistributedLogsPostgresServices(io.stackgres.common.crd.sgdistributedlogs.StackGresDistributedLogsPostgresServices) DistributedLogsPostgresServices(io.stackgres.apiweb.dto.distributedlogs.DistributedLogsPostgresServices) Test(org.junit.jupiter.api.Test)

Example 2 with DistributedLogsPostgresServices

use of io.stackgres.apiweb.dto.distributedlogs.DistributedLogsPostgresServices 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());
}
Also used : StackGresDistributedLogsPostgresServices(io.stackgres.common.crd.sgdistributedlogs.StackGresDistributedLogsPostgresServices) DistributedLogsPostgresServices(io.stackgres.apiweb.dto.distributedlogs.DistributedLogsPostgresServices) StackGresDistributedLogsPostgresServices(io.stackgres.common.crd.sgdistributedlogs.StackGresDistributedLogsPostgresServices) StackGresDistributedLogsPostgresServicesFixture(io.stackgres.apiweb.transformer.distributedlogs.converter.fixture.StackGresDistributedLogsPostgresServicesFixture) StackGresPostgresService(io.stackgres.common.crd.postgres.service.StackGresPostgresService) PostgresService(io.stackgres.apiweb.app.postgres.service.PostgresService) StackGresPostgresService(io.stackgres.common.crd.postgres.service.StackGresPostgresService) Test(org.junit.jupiter.api.Test)

Example 3 with DistributedLogsPostgresServices

use of io.stackgres.apiweb.dto.distributedlogs.DistributedLogsPostgresServices 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());
}
Also used : StackGresDistributedLogsPostgresServices(io.stackgres.common.crd.sgdistributedlogs.StackGresDistributedLogsPostgresServices) DistributedLogsPostgresServices(io.stackgres.apiweb.dto.distributedlogs.DistributedLogsPostgresServices) StackGresDistributedLogsPostgresServices(io.stackgres.common.crd.sgdistributedlogs.StackGresDistributedLogsPostgresServices) StackGresDistributedLogsPostgresServicesFixture(io.stackgres.apiweb.transformer.distributedlogs.converter.fixture.StackGresDistributedLogsPostgresServicesFixture) StackGresPostgresService(io.stackgres.common.crd.postgres.service.StackGresPostgresService) PostgresService(io.stackgres.apiweb.app.postgres.service.PostgresService) StackGresPostgresService(io.stackgres.common.crd.postgres.service.StackGresPostgresService) Test(org.junit.jupiter.api.Test)

Example 4 with DistributedLogsPostgresServices

use of io.stackgres.apiweb.dto.distributedlogs.DistributedLogsPostgresServices 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());
}
Also used : StackGresDistributedLogsPostgresServices(io.stackgres.common.crd.sgdistributedlogs.StackGresDistributedLogsPostgresServices) DistributedLogsPostgresServices(io.stackgres.apiweb.dto.distributedlogs.DistributedLogsPostgresServices) StackGresDistributedLogsPostgresServices(io.stackgres.common.crd.sgdistributedlogs.StackGresDistributedLogsPostgresServices) StackGresDistributedLogsPostgresServicesFixture(io.stackgres.apiweb.transformer.distributedlogs.converter.fixture.StackGresDistributedLogsPostgresServicesFixture) Test(org.junit.jupiter.api.Test)

Aggregations

DistributedLogsPostgresServices (io.stackgres.apiweb.dto.distributedlogs.DistributedLogsPostgresServices)4 StackGresDistributedLogsPostgresServices (io.stackgres.common.crd.sgdistributedlogs.StackGresDistributedLogsPostgresServices)4 Test (org.junit.jupiter.api.Test)4 StackGresDistributedLogsPostgresServicesFixture (io.stackgres.apiweb.transformer.distributedlogs.converter.fixture.StackGresDistributedLogsPostgresServicesFixture)3 PostgresService (io.stackgres.apiweb.app.postgres.service.PostgresService)2 StackGresPostgresService (io.stackgres.common.crd.postgres.service.StackGresPostgresService)2