use of com.sequenceiq.cloudbreak.cloud.model.DatabaseServer in project cloudbreak by hortonworks.
the class AwsRdsDbParameterGroupViewTest method getDBParameterGroupFamilyTestWhenPgSqlAndMissingMinorVersion.
@Test
void getDBParameterGroupFamilyTestWhenPgSqlAndMissingMinorVersion() {
DatabaseServer databaseServer = DatabaseServer.builder().engine(DatabaseEngine.POSTGRESQL).build();
databaseServer.putParameter(ENGINE_VERSION, "10");
AwsRdsDbParameterGroupView underTest = new AwsRdsDbParameterGroupView(databaseServer);
assertThat(underTest.getDBParameterGroupFamily()).isEqualTo("postgres10");
}
use of com.sequenceiq.cloudbreak.cloud.model.DatabaseServer in project cloudbreak by hortonworks.
the class AwsRdsDbParameterGroupViewTest method getDBParameterGroupFamilyTestWhenPgSqlAndMajorVersionNumericOverflow.
@Test
void getDBParameterGroupFamilyTestWhenPgSqlAndMajorVersionNumericOverflow() {
DatabaseServer databaseServer = DatabaseServer.builder().engine(DatabaseEngine.POSTGRESQL).build();
databaseServer.putParameter(ENGINE_VERSION, "12345678901234567890.1");
AwsRdsDbParameterGroupView underTest = new AwsRdsDbParameterGroupView(databaseServer);
assertThatCode(underTest::getDBParameterGroupFamily).isInstanceOf(NumberFormatException.class);
}
use of com.sequenceiq.cloudbreak.cloud.model.DatabaseServer in project cloudbreak by hortonworks.
the class AwsRdsDbParameterGroupViewTest method getDBParameterGroupFamilyTestWhenPgSqlAndValidVersion.
@ParameterizedTest(name = "{0}")
@MethodSource("validVersionDataProvider")
void getDBParameterGroupFamilyTestWhenPgSqlAndValidVersion(String testCaseName, String version, String familyExpected) {
DatabaseServer databaseServer = DatabaseServer.builder().engine(DatabaseEngine.POSTGRESQL).build();
databaseServer.putParameter(ENGINE_VERSION, version);
AwsRdsDbParameterGroupView underTest = new AwsRdsDbParameterGroupView(databaseServer);
assertThat(underTest.getDBParameterGroupFamily()).isEqualTo(familyExpected);
}
use of com.sequenceiq.cloudbreak.cloud.model.DatabaseServer in project cloudbreak by hortonworks.
the class AwsRdsDbParameterGroupViewTest method getDBParameterGroupFamilyTestWhenNullEngine.
@Test
void getDBParameterGroupFamilyTestWhenNullEngine() {
DatabaseServer databaseServer = DatabaseServer.builder().build();
AwsRdsDbParameterGroupView underTest = new AwsRdsDbParameterGroupView(databaseServer);
assertThat(underTest.getDBParameterGroupFamily()).isNull();
}
use of com.sequenceiq.cloudbreak.cloud.model.DatabaseServer in project cloudbreak by hortonworks.
the class AwsRdsDbParameterGroupViewTest method getDBParameterGroupFamilyTestWhenPgSqlAndUnsupportedMajorVersion.
@ParameterizedTest(name = "{0}")
@MethodSource("unsupportedMajorVersionDataProvider")
void getDBParameterGroupFamilyTestWhenPgSqlAndUnsupportedMajorVersion(String testCaseName, String version) {
DatabaseServer databaseServer = DatabaseServer.builder().engine(DatabaseEngine.POSTGRESQL).build();
databaseServer.putParameter(ENGINE_VERSION, version);
AwsRdsDbParameterGroupView underTest = new AwsRdsDbParameterGroupView(databaseServer);
assertThatCode(underTest::getDBParameterGroupFamily).isInstanceOf(IllegalStateException.class);
}
Aggregations