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());
}
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());
}
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;
}
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);
}
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);
}
Aggregations