@Test public void createNewClient() {

  Client client = new Client(543L, "client", "2nd client", null, now, "test", now, "test", null, null,
      true, false);
  CreateClientRequest request = new CreateClientRequest("client");
  when(clientDAO.getClientByName("client")).thenReturn(Optional.empty());
  when(clientDAO.createClient("client", automation.getName(), "", null)).thenReturn(543L);
  when(clientDAO.getClientById(543L)).thenReturn(Optional.of(client));
  when(aclDAO.getGroupsFor(client)).thenReturn(ImmutableSet.of());
  ClientDetailResponse response = ClientDetailResponse.fromClient(client, ImmutableList.of(),
      ImmutableList.of());
  ClientDetailResponse response1 = resource.createClient(automation, request);
  assertThat(response.name).isEqualTo(response1.name);
}