Search in sources :

Example 1 with DatabaseV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.database.requests.DatabaseV4Request in project cloudbreak by hortonworks.

the class DatabaseV4RequestToRDSConfigConverterTest method rdsConfigConverterTestWhenValidMySQLJdbcUrl.

@Test
public void rdsConfigConverterTestWhenValidMySQLJdbcUrl() {
    DatabaseV4Request rdsConfigRequest = rdsConfigRequest();
    rdsConfigRequest.setConnectionURL("jdbc:mysql://test.eu-west-1.rds.amazonaws.com:5432/test");
    RDSConfig rdsConfig = underTest.convert(rdsConfigRequest);
    assertResult(rdsConfigRequest, rdsConfig, DatabaseVendor.MYSQL);
}
Also used : RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig) DatabaseV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.database.requests.DatabaseV4Request) Test(org.junit.Test)

Example 2 with DatabaseV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.database.requests.DatabaseV4Request in project cloudbreak by hortonworks.

the class DatabaseV4RequestToRDSConfigConverterTest method postgresJdbcConverterTestWhenDatabaseCanBeDetectedThenShouldReturnPostgresVendorProperties.

@Test
public void postgresJdbcConverterTestWhenDatabaseCanBeDetectedThenShouldReturnPostgresVendorProperties() {
    DatabaseV4Request rdsConfigRequest = rdsConfigRequest();
    rdsConfigRequest.setConnectionURL("jdbc:postgresql://test.eu-west-1.rds.amazonaws.com:5432/test");
    RDSConfig rdsConfig = underTest.convert(rdsConfigRequest);
    assertResult(rdsConfigRequest, rdsConfig, DatabaseVendor.POSTGRES);
}
Also used : RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig) DatabaseV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.database.requests.DatabaseV4Request) Test(org.junit.Test)

Example 3 with DatabaseV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.database.requests.DatabaseV4Request in project cloudbreak by hortonworks.

the class DatabaseV4RequestToRDSConfigConverterTest method rdsConfigConverterTestWhenValidPostgresJdbcUrl.

@Test
public void rdsConfigConverterTestWhenValidPostgresJdbcUrl() {
    DatabaseV4Request rdsConfigRequest = rdsConfigRequest();
    rdsConfigRequest.setConnectionURL("jdbc:postgresql://test.eu-west-1.rds.amazonaws.com:5432/test");
    RDSConfig rdsConfig = underTest.convert(rdsConfigRequest);
    assertResult(rdsConfigRequest, rdsConfig, DatabaseVendor.POSTGRES);
}
Also used : RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig) DatabaseV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.database.requests.DatabaseV4Request) Test(org.junit.Test)

Example 4 with DatabaseV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.database.requests.DatabaseV4Request in project cloudbreak by hortonworks.

the class DatabaseV4RequestToRDSConfigConverterTest method rdsConfigRequest.

private DatabaseV4Request rdsConfigRequest() {
    DatabaseV4Request rdsConfigRequest = new DatabaseV4Request();
    rdsConfigRequest.setConnectionPassword("password");
    rdsConfigRequest.setConnectionUserName("username");
    rdsConfigRequest.setConnectionURL("jdbc:postgresql://test.eu-west-1.rds.amazonaws.com:5432/test");
    rdsConfigRequest.setName("testname");
    rdsConfigRequest.setType("HIVE");
    return rdsConfigRequest;
}
Also used : DatabaseV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.database.requests.DatabaseV4Request)

Example 5 with DatabaseV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.database.requests.DatabaseV4Request in project cloudbreak by hortonworks.

the class DatabaseVendorTest method rdsConfigRequest.

public static DatabaseV4Request rdsConfigRequest(String jdbcUrl, Optional<OracleParameters> oracleParameters) {
    DatabaseV4Request rdsConfigRequest = new DatabaseV4Request();
    rdsConfigRequest.setConnectionURL(jdbcUrl);
    rdsConfigRequest.setOracle(oracleParameters.orElse(null));
    return rdsConfigRequest;
}
Also used : DatabaseV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.database.requests.DatabaseV4Request)

Aggregations

DatabaseV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.database.requests.DatabaseV4Request)10 RDSConfig (com.sequenceiq.cloudbreak.domain.RDSConfig)8 Test (org.junit.Test)7 DatabaseVendor (com.sequenceiq.cloudbreak.api.endpoint.v4.common.DatabaseVendor)3 APIResourceType (com.sequenceiq.cloudbreak.common.type.APIResourceType)1 DatabaseConfig (com.sequenceiq.redbeams.domain.DatabaseConfig)1 Date (java.util.Date)1