@Test public void findClientByName() {

  Client client = new Client(2, "client", "2nd client", null, now, "test", now, "test", null, null,
      true, false);
  Group firstGroup = new Group(1, "first Group", "testing group", now, "client", now, "client",
      ImmutableMap.of("app", "keywhiz"));
  Group secondGroup = new Group(2, "second Group", "testing group", now, "client", now, "client",
      ImmutableMap.of("app", "keywhiz"));
  ClientDetailResponse expectedClient = ClientDetailResponse.fromClient(client,
      ImmutableList.of(firstGroup, secondGroup), ImmutableList.of());
  when(clientDAO.getClientByName("client")).thenReturn(Optional.of(client));
  when(aclDAO.getGroupsFor(client)).thenReturn(ImmutableSet.of(firstGroup, secondGroup));
  Response response = resource.findClient(automation, Optional.of("client"));
  assertThat(response.getEntity()).hasSameClassAs(expectedClient);
  ClientDetailResponse actualResponse = (ClientDetailResponse) response.getEntity();
  assertThat(actualResponse).isEqualToComparingFieldByField(expectedClient);
}