use of keywhiz.api.automation.v2.ModifyClientRequestV2 in project keywhiz by square.
the class ClientResourceTest method modifyClient_notFound.
@Test
public void modifyClient_notFound() throws Exception {
ModifyClientRequestV2 request = ModifyClientRequestV2.forName("non-existent");
RequestBody body = RequestBody.create(JSON, mapper.writeValueAsString(request));
Request post = clientRequest("/automation/v2/clients/non-existent").post(body).build();
Response httpResponse = mutualSslClient.newCall(post).execute();
assertThat(httpResponse.code()).isEqualTo(404);
}
use of keywhiz.api.automation.v2.ModifyClientRequestV2 in project keywhiz by square.
the class ClientResourceTest method modifyClient_success.
@Ignore
@Test
public void modifyClient_success() throws Exception {
// Create sample client
create(CreateClientRequestV2.builder().name("client9").build());
ClientDetailResponseV2 originalClient = lookup("client9");
// Modify client
ModifyClientRequestV2 request = ModifyClientRequestV2.forName("client9b");
ClientDetailResponseV2 clientDetail = modify("client9", request);
assertThat(clientDetail.name()).isEqualTo("client9b");
assertThat(clientDetail).isEqualToIgnoringGivenFields(originalClient, "name", "updateDate");
assertThat(clientDetail.updatedAtSeconds()).isGreaterThan(originalClient.updatedAtSeconds());
}
Aggregations