use of com.sequenceiq.cloudbreak.domain.RDSConfig in project cloudbreak by hortonworks.
the class RDSConfigRequestToRDSConfigConverterTest method testConverterWhenNameIsNullThenShouldReturnGeneratedName.
@Test
public void testConverterWhenNameIsNullThenShouldReturnGeneratedName() {
RDSConfigRequest rdsConfigRequest = rdsConfigRequest();
rdsConfigRequest.setName(null);
RDSConfig rdsConfig = underTest.convert(rdsConfigRequest);
Assert.assertEquals(rdsConfigRequest.getConnectionPassword(), rdsConfig.getConnectionPassword());
Assert.assertEquals(rdsConfigRequest.getConnectionUserName(), rdsConfig.getConnectionUserName());
Assert.assertEquals(rdsConfigRequest.getConnectionURL(), rdsConfig.getConnectionURL());
Assert.assertEquals(rdsConfigRequest.getType(), rdsConfig.getType());
Assert.assertEquals(NAME, rdsConfig.getName());
Assert.assertEquals(DatabaseVendor.POSTGRES.connectionDriver(), rdsConfig.getConnectionDriver());
Assert.assertEquals(DatabaseVendor.POSTGRES.name(), rdsConfig.getDatabaseEngine());
verify(missingResourceNameGenerator, times(1)).generateName(any(APIResourceType.class));
}
use of com.sequenceiq.cloudbreak.domain.RDSConfig in project cloudbreak by hortonworks.
the class RDSConfigRequestToRDSConfigConverterTest method postgresJdbcConverterTestWhenDatabaseCanBeDetectedThenShouldReturnPostgresVendorProperties.
@Test
public void postgresJdbcConverterTestWhenDatabaseCanBeDetectedThenShouldReturnPostgresVendorProperties() {
RDSConfigRequest rdsConfigRequest = rdsConfigRequest();
rdsConfigRequest.setConnectionURL("jdbc:postgresql://test.eu-west-1.rds.amazonaws.com:5432/test");
RDSConfig rdsConfig = underTest.convert(rdsConfigRequest);
Assert.assertEquals(rdsConfigRequest.getConnectionPassword(), rdsConfig.getConnectionPassword());
Assert.assertEquals(rdsConfigRequest.getConnectionUserName(), rdsConfig.getConnectionUserName());
Assert.assertEquals(rdsConfigRequest.getConnectionURL(), rdsConfig.getConnectionURL());
Assert.assertEquals(rdsConfigRequest.getType(), rdsConfig.getType());
Assert.assertEquals(rdsConfigRequest.getName(), rdsConfig.getName());
Assert.assertEquals(DatabaseVendor.POSTGRES.connectionDriver(), rdsConfig.getConnectionDriver());
Assert.assertEquals(DatabaseVendor.POSTGRES.name(), rdsConfig.getDatabaseEngine());
verify(missingResourceNameGenerator, times(0)).generateName(any(APIResourceType.class));
}
Aggregations