@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);
    }
@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 {
       
        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);
       
       
        CloudbreakClient client = getClient();
        client.postCluster(clusterName, ambariUser, ambariPassword, blueprintId, "Cluster for integration test", Integer.valueOf(stackId), map,
                enableSecurity, kerberosMasterKey, kerberosAdmin, kerberosPassword);
       
        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 { 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); cloudbreakclient client = getclient(); client.postcluster(clustername, ambariuser, ambaripassword, blueprintid, "cluster for integration test", integer.valueof(stackid), map, enablesecurity, kerberosmasterkey, kerberosadmin, kerberospassword); cloudbreakutil.waitandcheckstackstatus(itcontext, stackidstr, "available"); cloudbreakutil.checkclusteravailability(client, stackidstr, ambariuser, ambaripassword); }