// WHEN
// TODO email needed
@Test
    @Parameters({ "clusterName", "ambariUser", "ambariPassword", "emailNeeded",
            "enableSecurity", "kerberosMasterKey", "kerberosAdmin", "kerberosPassword",
            "runRecipesOnHosts" })
    public void testClusterCreation(@Optional("it-cluster") String clusterName, @Optional("admin") String ambariUser,
            @Optional("admin123!@#") String ambariPassword, @Optional("false") boolean emailNeeded,
            @Optional("false") boolean enableSecurity, @Optional String kerberosMasterKey, @Optional String kerberosAdmin, @Optional String kerberosPassword,
            @Optional("") String runRecipesOnHosts) throws Exception {
        // GIVEN
        IntegrationTestContext itContext = getItContext();
        String stackIdStr = itContext.getContextParam(CloudbreakITContextConstants.STACK_ID);
        Integer stackId = Integer.valueOf(stackIdStr);
        Integer blueprintId = Integer.valueOf(itContext.getContextParam(CloudbreakITContextConstants.BLUEPRINT_ID));
        List<HostGroup> hostgroups = itContext.getContextParam(CloudbreakITContextConstants.HOSTGROUP_ID, List.class);
        List<Map<String, Object>> map = convertHostGroups(hostgroups, runRecipesOnHosts);
        itContext.putContextParam(CloudbreakITContextConstants.AMBARI_USER_ID, ambariUser);
        itContext.putContextParam(CloudbreakITContextConstants.AMBARI_PASSWORD_ID, ambariPassword);
        // WHEN
        // TODO email needed
        CloudbreakClient client = getClient();
        client.postCluster(clusterName, ambariUser, ambariPassword, blueprintId, "Cluster for integration test", Integer.valueOf(stackId), map,
                enableSecurity, kerberosMasterKey, kerberosAdmin, kerberosPassword);
        // THEN
        CloudbreakUtil.waitAndCheckStackStatus(itContext, stackIdStr, "AVAILABLE");
        CloudbreakUtil.checkClusterAvailability(client, stackIdStr, ambariUser, ambariPassword);
    }
itContext.putContextParam(CloudbreakITContextConstants.AMBARI_USER_ID, ambariUser);
itContext.putContextParam(CloudbreakITContextConstants.AMBARI_PASSWORD_ID, ambariPassword);
// WHEN
// TODO email needed
CloudbreakClient client = getClient();
client.postCluster(clusterName, ambariUser, ambariPassword, blueprintId, "Cluster for integration test", Integer.valueOf(stackId), map,
@Optional("") String runRecipesOnHosts) throws Exception {
// GIVEN
IntegrationTestContext itContext = getItContext();
String stackIdStr = itContext.getContextParam(CloudbreakITContextConstants.STACK_ID);
Integer stackId = Integer.valueOf(stackIdStr);
Integer blueprintId = Integer.valueOf(itContext.getContextParam(CloudbreakITContextConstants.BLUEPRINT_ID));
List<HostGroup> hostgroups = itContext.getContextParam(CloudbreakITContextConstants.HOSTGROUP_ID, List.class);
List<Map<String, Object>> map = convertHostGroups(hostgroups, runRecipesOnHosts);
itContext.putContextParam(CloudbreakITContextConstants.AMBARI_USER_ID, ambariUser);
itContext.putContextParam(CloudbreakITContextConstants.AMBARI_PASSWORD_ID, ambariPassword);
// WHEN
// TODO email needed
CloudbreakClient client = getClient();
client.postCluster(clusterName, ambariUser, ambariPassword, blueprintId, "Cluster for integration test", Integer.valueOf(stackId), map,
enableSecurity, kerberosMasterKey, kerberosAdmin, kerberosPassword);
// THEN
CloudbreakUtil.waitAndCheckStackStatus(itContext, stackIdStr, "AVAILABLE");
CloudbreakUtil.checkClusterAvailability(client, stackIdStr, ambariUser, ambariPassword);
}
@Test
@Parameters({ "clusterName", "ambariUser", "ambariPassword", "emailNeeded",
"enableSecurity", "kerberosMasterKey", "kerberosAdmin", "kerberosPassword",
"runRecipesOnHosts" })
public void testClusterCreation(@Optional("it-cluster") String clusterName, @Optional("admin") String ambariUser,
@Optional("admin123!@#") String ambariPassword, @Optional("false") boolean emailNeeded,
@Optional("false") boolean enableSecurity, @Optional String kerberosMasterKey, @Optional String kerberosAdmin, @Optional String kerberosPassword,
@Optional("") String runRecipesOnHosts) throws Exception {
// GIVEN
IntegrationTestContext itContext = getItContext();
String stackIdStr = itContext.getContextParam(CloudbreakITContextConstants.STACK_ID);
Integer stackId = Integer.valueOf(stackIdStr);
Integer blueprintId = Integer.valueOf(itContext.getContextParam(CloudbreakITContextConstants.BLUEPRINT_ID));
List<HostGroup> hostgroups = itContext.getContextParam(CloudbreakITContextConstants.HOSTGROUP_ID, List.class);
List<Map<String, Object>> map = convertHostGroups(hostgroups, runRecipesOnHosts);
itContext.putContextParam(CloudbreakITContextConstants.AMBARI_USER_ID, ambariUser);
itContext.putContextParam(CloudbreakITContextConstants.AMBARI_PASSWORD_ID, ambariPassword);
// WHEN
// TODO email needed
CloudbreakClient client = getClient();
client.postCluster(clusterName, ambariUser, ambariPassword, blueprintId, "Cluster for integration test", Integer.valueOf(stackId), map,
enableSecurity, kerberosMasterKey, kerberosAdmin, kerberosPassword);
// THEN
CloudbreakUtil.waitAndCheckStackStatus(itContext, stackIdStr, "AVAILABLE");
CloudbreakUtil.checkClusterAvailability(client, stackIdStr, ambariUser, ambariPassword);
}