Search in sources :

Example 1 with CreateGroupRequest

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)));
}
Also used : CreateGroupRequest(alien4cloud.security.groups.rest.CreateGroupRequest) When(cucumber.api.java.en.When)

Example 2 with CreateGroupRequest

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);
    }
}
Also used : CreateGroupRequest(alien4cloud.security.groups.rest.CreateGroupRequest) When(cucumber.api.java.en.When)

Aggregations

CreateGroupRequest (alien4cloud.security.groups.rest.CreateGroupRequest)2 When (cucumber.api.java.en.When)2