Search in sources :

Example 6 with CreateGroupRequest

use of keywhiz.api.CreateGroupRequest in project keywhiz by square.

the class AutomationSecretResourceIntegrationTest method createGroup.

private Response createGroup(String name) throws Exception {
    CreateGroupRequest request = new CreateGroupRequest(name, "description", ImmutableMap.of());
    String body = mapper.writeValueAsString(request);
    Request post = new Request.Builder().post(RequestBody.create(KeywhizClient.JSON, body)).url(testUrl("/automation/groups")).addHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON).addHeader(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON).build();
    return mutualSslClient.newCall(post).execute();
}
Also used : CreateGroupRequest(keywhiz.api.CreateGroupRequest) CreateSecretRequest(keywhiz.api.CreateSecretRequest) Request(okhttp3.Request) CreateGroupRequest(keywhiz.api.CreateGroupRequest)

Aggregations

CreateGroupRequest (keywhiz.api.CreateGroupRequest)6 Request (okhttp3.Request)4 Test (org.junit.Test)4 GroupDetailResponse (keywhiz.api.GroupDetailResponse)3 Response (okhttp3.Response)3 Group (keywhiz.api.model.Group)2 CreateSecretRequest (keywhiz.api.CreateSecretRequest)1