Search in sources :

Example 46 with RDSConfig

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));
}
Also used : RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig) APIResourceType(com.sequenceiq.cloudbreak.common.type.APIResourceType) RDSConfigRequest(com.sequenceiq.cloudbreak.api.model.rds.RDSConfigRequest) Test(org.junit.Test)

Example 47 with RDSConfig

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));
}
Also used : RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig) APIResourceType(com.sequenceiq.cloudbreak.common.type.APIResourceType) RDSConfigRequest(com.sequenceiq.cloudbreak.api.model.rds.RDSConfigRequest) Test(org.junit.Test)

Aggregations

RDSConfig (com.sequenceiq.cloudbreak.domain.RDSConfig)47 Test (org.junit.Test)16 Cluster (com.sequenceiq.cloudbreak.domain.Cluster)7 IdentityUser (com.sequenceiq.cloudbreak.common.model.user.IdentityUser)6 RDSConfigRequest (com.sequenceiq.cloudbreak.api.model.rds.RDSConfigRequest)5 Date (java.util.Date)5 HashSet (java.util.HashSet)5 NotFoundException (com.sequenceiq.cloudbreak.controller.NotFoundException)4 Json (com.sequenceiq.cloudbreak.domain.json.Json)4 IOException (java.io.IOException)4 APIResourceType (com.sequenceiq.cloudbreak.common.type.APIResourceType)3 BadRequestException (com.sequenceiq.cloudbreak.controller.BadRequestException)3 Blueprint (com.sequenceiq.cloudbreak.domain.Blueprint)3 Stack (com.sequenceiq.cloudbreak.domain.Stack)3 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)2 BlueprintInputJson (com.sequenceiq.cloudbreak.api.model.BlueprintInputJson)2 BlueprintParameterJson (com.sequenceiq.cloudbreak.api.model.BlueprintParameterJson)2 ConfigsResponse (com.sequenceiq.cloudbreak.api.model.ConfigsResponse)2 RdsView (com.sequenceiq.cloudbreak.blueprint.template.views.RdsView)2 StackRepoDetails (com.sequenceiq.cloudbreak.cloud.model.component.StackRepoDetails)2