Search in sources :

Example 1 with CreateGroupRequestV2

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");
}
Also used : GroupDetailResponseV2(keywhiz.api.automation.v2.GroupDetailResponseV2) Test(org.junit.Test)

Example 2 with CreateGroupRequestV2

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");
}
Also used : GroupDetailResponseV2(keywhiz.api.automation.v2.GroupDetailResponseV2) Test(org.junit.Test)

Example 3 with CreateGroupRequestV2

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);
}
Also used : Response(okhttp3.Response) CreateGroupRequestV2(keywhiz.api.automation.v2.CreateGroupRequestV2) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 GroupDetailResponseV2 (keywhiz.api.automation.v2.GroupDetailResponseV2)2 CreateGroupRequestV2 (keywhiz.api.automation.v2.CreateGroupRequestV2)1 Response (okhttp3.Response)1