APISonar


keywhiz.client.KeywhizClient.JSON

> keywhiz > client > KeywhizClient > JSON
keywhiz APIs client APIs KeywhizClient APIs JSON APIs

Example 1
@Test public void createGroup() throws Exception {
    CreateGroupRequest request = new CreateGroupRequest("newgroup", "group-description", ImmutableMap.of("app", "new"));
    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();

    Response response = mutualSslClient.newCall(post).execute();
    assertThat(response.code()).isEqualTo(200);
  }