Search in sources :

Example 6 with RDSConfig

use of com.sequenceiq.cloudbreak.domain.RDSConfig in project cloudbreak by hortonworks.

the class RdsViewTest method testCreateRdsViewWhenRDSConfigContainsDoublePortInUrl.

@Test
public void testCreateRdsViewWhenRDSConfigContainsDoublePortInUrl() {
    String connectionUrl = "some-rds.1d3nt1f13r.eu-west-1.rds.amazonaws.com:5432:5432/ranger";
    RDSConfig rdsConfig = createRdsConfig(connectionUrl);
    RdsView underTest = new RdsView(rdsConfig);
    Assert.assertEquals(ASSERT_ERROR_MSG, "some-rds.1d3nt1f13r.eu-west-1.rds.amazonaws.com:5432:5432", underTest.getHostWithPort());
}
Also used : RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig) Test(org.junit.Test)

Example 7 with RDSConfig

use of com.sequenceiq.cloudbreak.domain.RDSConfig in project cloudbreak by hortonworks.

the class RdsViewTest method testCreateRdsViewWhenRDSConfigContainsConnectionUrlWithoutPort.

@Test
public void testCreateRdsViewWhenRDSConfigContainsConnectionUrlWithoutPort() {
    String connectionUrl = "jdbc:postgresql://some-rds.1d3nt1f13r.eu-west-1.rds.amazonaws.com/ranger";
    RDSConfig rdsConfig = createRdsConfig(connectionUrl);
    RdsView underTest = new RdsView(rdsConfig);
    Assert.assertEquals(ASSERT_ERROR_MSG, "some-rds.1d3nt1f13r.eu-west-1.rds.amazonaws.com", underTest.getHostWithPort());
}
Also used : RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig) Test(org.junit.Test)

Example 8 with RDSConfig

use of com.sequenceiq.cloudbreak.domain.RDSConfig in project cloudbreak by hortonworks.

the class RdsViewTest method createRdsConfig.

private RDSConfig createRdsConfig(String connectionUrl) {
    RDSConfig rdsConfig = new RDSConfig();
    rdsConfig.setConnectionURL(connectionUrl);
    rdsConfig.setConnectionPassword("admin");
    rdsConfig.setConnectionUserName("admin");
    return rdsConfig;
}
Also used : RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig)

Example 9 with RDSConfig

use of com.sequenceiq.cloudbreak.domain.RDSConfig in project cloudbreak by hortonworks.

the class AmbariClusterServiceTest method testRecreateFailNotEmbeddedDb.

@Test(expected = BadRequestException.class)
public void testRecreateFailNotEmbeddedDb() {
    RDSConfig rdsConfig = new RDSConfig();
    rdsConfig.setDatabaseEngine(DatabaseVendor.POSTGRES.name());
    when(rdsConfigService.findByClusterIdAndType(anyString(), anyString(), any(Long.class), eq(RdsType.AMBARI))).thenReturn(rdsConfig);
    ambariClusterService.recreate(1L, 1L, new HashSet<>(), false, new StackRepoDetails(), null, null);
}
Also used : StackRepoDetails(com.sequenceiq.cloudbreak.cloud.model.component.StackRepoDetails) RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig) Test(org.junit.Test)

Example 10 with RDSConfig

use of com.sequenceiq.cloudbreak.domain.RDSConfig in project cloudbreak by hortonworks.

the class AmbariClusterServiceTest method testRecreateSuccess.

@Test
public void testRecreateSuccess() {
    RDSConfig rdsConfig = new RDSConfig();
    rdsConfig.setDatabaseEngine(DatabaseVendor.EMBEDDED.name());
    when(rdsConfigService.findByClusterIdAndType(anyString(), anyString(), any(Long.class), eq(RdsType.AMBARI))).thenReturn(rdsConfig);
    ambariClusterService.recreate(1L, 1L, new HashSet<>(), false, new StackRepoDetails(), null, null);
}
Also used : StackRepoDetails(com.sequenceiq.cloudbreak.cloud.model.component.StackRepoDetails) RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig) 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