use of alien4cloud.security.groups.rest.CreateGroupRequest in project alien4cloud by alien4cloud.
the class GroupsStepDefinitions method I_create_a_new_group_with_name_in_the_system.
@When("^I create a new group with name \"([^\"]*)\" in the system$")
public void I_create_a_new_group_with_name_in_the_system(String name) throws Throwable {
CreateGroupRequest request = new CreateGroupRequest();
request.setName(name);
Context.getInstance().registerRestResponse(Context.getRestClientInstance().postJSon("/rest/v1/groups/", JsonUtil.toString(request)));
}
use of alien4cloud.security.groups.rest.CreateGroupRequest in project alien4cloud by alien4cloud.
the class GroupsStepDefinitions method I_create_a_new_group_in_the_system_with_name_a_role_and_a_user.
@When("^I create a new group in the system with name \"([^\"]*)\" , a role \"([^\"]*)\" and a user \"([^\"]*)\"$")
public void I_create_a_new_group_in_the_system_with_name_a_role_and_a_user(String name, String role, String username) throws Throwable {
CreateGroupRequest request = new CreateGroupRequest();
request.setName(name);
request.setRoles(Sets.newHashSet(role));
request.setUsers(Sets.newHashSet(username));
Context.getInstance().registerRestResponse(Context.getRestClientInstance().postJSon("/rest/v1/groups/", JsonUtil.toString(request)));
String groupId = JsonUtil.read(Context.getInstance().getRestResponse(), String.class).getData();
if (groupId != null) {
Context.getInstance().registerGroupId(name, groupId);
}
}
Aggregations