use of com.sequenceiq.it.IntegrationTestContext in project cloudbreak by hortonworks.
the class RDSConfigTest method testRDSConfig.
@Test
@Parameters({ "rdsName", "rdsUser", "rdsPassword", "rdsConnectionUrl", "rdsDbType", "hdpVersion" })
public void testRDSConfig(String rdsName, @Optional("") String rdsUser, @Optional("") String rdsPassword, @Optional("") String rdsConnectionUrl, @Optional("POSTGRES") String rdsDbType, @Optional("2.5") String hdpVersion) {
// GIVEN
IntegrationTestContext itContext = getItContext();
rdsUser = StringUtils.hasLength(rdsUser) ? rdsUser : defaultRdsUser;
rdsPassword = StringUtils.hasLength(rdsPassword) ? rdsPassword : defaultRdsPassword;
rdsConnectionUrl = StringUtils.hasLength(rdsConnectionUrl) ? rdsConnectionUrl : defaultRdsConnectionUrl;
RDSConfigRequest rdsCreateRequest = new RDSConfigRequest();
rdsCreateRequest.setName(rdsName);
rdsCreateRequest.setConnectionUserName(rdsUser);
rdsCreateRequest.setConnectionPassword(rdsPassword);
rdsCreateRequest.setConnectionURL(rdsConnectionUrl);
RDSTestRequest testRequest = new RDSTestRequest();
testRequest.setRdsConfig(rdsCreateRequest);
// WHEN
String rdsConnectionResult = getCloudbreakClient().rdsConfigEndpoint().testRdsConnection(testRequest).getConnectionResult();
Assert.assertEquals(rdsConnectionResult, "connected", "RDS connection test failed. Set the RDS configuration parameters properly.");
String rdsConfigId = getCloudbreakClient().rdsConfigEndpoint().postPrivate(rdsCreateRequest).getId().toString();
itContext.putContextParam(CloudbreakITContextConstants.RDS_CONFIG_ID, rdsConfigId);
itContext.putCleanUpParam(CloudbreakITContextConstants.RDS_CONFIG_ID, rdsConfigId);
// THEN
String listedRDSByName = getCloudbreakClient().rdsConfigEndpoint().getPrivate(rdsName).getName();
Assert.assertEquals(listedRDSByName, rdsName);
}
use of com.sequenceiq.it.IntegrationTestContext in project cloudbreak by hortonworks.
the class IpPoolTests method setup.
@BeforeTest
public void setup() throws Exception {
given(CloudbreakClient.isCreated());
given(cloudProvider.aValidCredential());
IntegrationTestContext it = getItContext();
credentialId = Credential.getTestContextCredential().apply(it).getResponse().getId();
}
use of com.sequenceiq.it.IntegrationTestContext in project cloudbreak by hortonworks.
the class NetworksTest method setup.
@BeforeTest
public void setup() throws Exception {
given(CloudbreakClient.isCreated());
given(cloudProvider.aValidCredential());
IntegrationTestContext it = getItContext();
credentialId = Credential.getTestContextCredential().apply(it).getResponse().getId();
}
use of com.sequenceiq.it.IntegrationTestContext in project cloudbreak by hortonworks.
the class MockClusterCreationWithSaltFailTest method setContextParameters.
@BeforeMethod
public void setContextParameters() {
IntegrationTestContext itContext = getItContext();
Assert.assertNotNull(itContext.getContextParam(CloudbreakITContextConstants.BLUEPRINT_ID), "Blueprint id is mandatory.");
Assert.assertNotNull(itContext.getContextParam(CloudbreakITContextConstants.STACK_ID), "Stack id is mandatory.");
}
use of com.sequenceiq.it.IntegrationTestContext in project cloudbreak by hortonworks.
the class MockClusterCreationWithSaltSuccessTest method setContextParameters.
@BeforeMethod
public void setContextParameters() {
IntegrationTestContext itContext = getItContext();
Assert.assertNotNull(itContext.getContextParam(CloudbreakITContextConstants.BLUEPRINT_ID), "Blueprint id is mandatory.");
Assert.assertNotNull(itContext.getContextParam(CloudbreakITContextConstants.STACK_ID), "Stack id is mandatory.");
}
Aggregations