Search in sources :

Example 1 with Entry

use of alien4cloud.it.Entry in project alien4cloud by alien4cloud.

the class AuthenticationStepDefinitions method I_update_user_s_fields.

@When("^I update \"([^\"]*)\" user's fields:$")
public void I_update_user_s_fields(String username, List<Entry> fields) throws Throwable {
    Map<String, String> fieldsMap = Maps.newHashMap();
    for (Entry field : fields) {
        fieldsMap.put(field.getName(), field.getValue());
    }
    String resp = Context.getRestClientInstance().putJSon("/rest/v1/users/" + username, JsonUtil.toString(fieldsMap));
    System.out.println(resp);
    Context.getInstance().registerRestResponse(resp);
}
Also used : Entry(alien4cloud.it.Entry) When(cucumber.api.java.en.When)

Example 2 with Entry

use of alien4cloud.it.Entry in project alien4cloud by alien4cloud.

the class GroupsStepDefinitions method I_update_the_group_fields.

@When("^I update the \"([^\"]*)\" group fields:$")
public void I_update_the_group_fields(String name, List<Entry> fields) throws Throwable {
    Map<String, String> fieldsMap = Maps.newHashMap();
    for (Entry field : fields) {
        fieldsMap.put(field.getName(), field.getValue());
    }
    Context.getInstance().registerRestResponse(Context.getRestClientInstance().putJSon("/rest/v1/groups/" + Context.getInstance().getGroupId(name), JsonUtil.toString(fieldsMap)));
}
Also used : Entry(alien4cloud.it.Entry) When(cucumber.api.java.en.When)

Aggregations

Entry (alien4cloud.it.Entry)2 When (cucumber.api.java.en.When)2