use of keywhiz.api.automation.v2.CreateGroupRequestV2 in project keywhiz by square.
the class GroupResourceTest method groupInfo_simple.
@Test
public void groupInfo_simple() throws Exception {
// Sample group
create(CreateGroupRequestV2.builder().name("group3").description("desc").build());
GroupDetailResponseV2 groupDetail = lookup("group3");
assertThat(groupDetail.name()).isEqualTo("group3");
assertThat(groupDetail.description()).isEqualTo("desc");
}
use of keywhiz.api.automation.v2.CreateGroupRequestV2 in project keywhiz by square.
the class GroupResourceTest method groupInfo_withAssociations.
@Test
public void groupInfo_withAssociations() throws Exception {
// Sample group
create(CreateGroupRequestV2.builder().name("group4").description("desc").build());
// Sample client
createClient("client4", "group4");
GroupDetailResponseV2 groupDetail = lookup("group4");
assertThat(groupDetail.name()).isEqualTo("group4");
assertThat(groupDetail.description()).isEqualTo("desc");
}
use of keywhiz.api.automation.v2.CreateGroupRequestV2 in project keywhiz by square.
the class GroupResourceTest method createGroup_duplicate.
@Test
public void createGroup_duplicate() throws Exception {
CreateGroupRequestV2 request = CreateGroupRequestV2.builder().name("group2").build();
// Initial request OK
create(request);
// Duplicate request fails
Response httpResponse = create(request);
assertThat(httpResponse.code()).isEqualTo(409);
}
Aggregations