use of com.sequenceiq.redbeams.domain.stack.SslConfig in project cloudbreak by hortonworks.
the class DatabaseServerSslCertificatePrescriptionServiceTest method createSslConfig.
private SslConfig createSslConfig(SslCertificateType sslCertificateType, String sslCertificateActiveCloudProviderIdentifier) {
SslConfig sslConfig = new SslConfig();
sslConfig.setSslCertificateType(sslCertificateType);
sslConfig.setSslCertificateActiveCloudProviderIdentifier(sslCertificateActiveCloudProviderIdentifier);
return sslConfig;
}
use of com.sequenceiq.redbeams.domain.stack.SslConfig in project cloudbreak by hortonworks.
the class DatabaseServerSslCertificateSyncServiceTest method createSslConfig.
private SslConfig createSslConfig(SslCertificateType sslCertificateType, String sslCertificateActiveCloudProviderIdentifier) {
SslConfig sslConfig = new SslConfig();
sslConfig.setSslCertificateType(sslCertificateType);
sslConfig.setSslCertificateActiveCloudProviderIdentifier(sslCertificateActiveCloudProviderIdentifier);
return sslConfig;
}
use of com.sequenceiq.redbeams.domain.stack.SslConfig in project cloudbreak by hortonworks.
the class DBStackToDatabaseStackConverterTest method testConversionWithSslCertificateCloudProviderOwned.
@Test
void testConversionWithSslCertificateCloudProviderOwned() {
DatabaseServer server = new DatabaseServer();
server.setDatabaseVendor(DatabaseVendor.POSTGRES);
dbStack.setDatabaseServer(server);
SslConfig sslConfig = new SslConfig();
sslConfig.setSslCertificateType(SslCertificateType.CLOUD_PROVIDER_OWNED);
dbStack.setSslConfig(sslConfig);
DatabaseStack convertedStack = underTest.convert(dbStack);
assertThat(convertedStack.getDatabaseServer().isUseSslEnforcement()).isTrue();
}
use of com.sequenceiq.redbeams.domain.stack.SslConfig in project cloudbreak by hortonworks.
the class AllocateDatabaseServerV4RequestToDBStackConverterTest method conversionTestWhenSslDisabled.
@ParameterizedTest(name = "{0}")
@MethodSource("conversionTestWhenSslDisabledDataProvider")
void conversionTestWhenSslDisabled(String testCaseName, boolean fieldSslEnabled, SslConfigV4Request sslConfigV4Request) {
setupMinimalValid(sslConfigV4Request, AWS_CLOUD_PLATFORM);
ReflectionTestUtils.setField(underTest, FIELD_SSL_ENABLED, fieldSslEnabled);
DBStack dbStack = underTest.convert(allocateRequest, OWNER_CRN);
SslConfig sslConfig = dbStack.getSslConfig();
assertThat(sslConfig).isNotNull();
Set<String> sslCertificates = sslConfig.getSslCertificates();
assertThat(sslCertificates).isNotNull();
assertThat(sslCertificates).isEmpty();
assertThat(sslConfig.getSslCertificateType()).isEqualTo(SslCertificateType.NONE);
}
use of com.sequenceiq.redbeams.domain.stack.SslConfig in project cloudbreak by hortonworks.
the class AllocateDatabaseServerV4RequestToDBStackConverterTest method verifySsl.
private void verifySsl(DBStack dbStack, Set<String> sslCertificatesExpected, String cloudProviderIdentifierExpected) {
SslConfig sslConfig = dbStack.getSslConfig();
assertThat(sslConfig).isNotNull();
Set<String> sslCertificates = sslConfig.getSslCertificates();
assertThat(sslCertificates).isNotNull();
assertThat(sslCertificates).isEqualTo(sslCertificatesExpected);
assertThat(sslConfig.getSslCertificateType()).isEqualTo(SslCertificateType.CLOUD_PROVIDER_OWNED);
assertThat(sslConfig.getSslCertificateActiveVersion()).isEqualTo(MAX_VERSION);
assertThat(sslConfig.getSslCertificateActiveCloudProviderIdentifier()).isEqualTo(cloudProviderIdentifierExpected);
}
Aggregations