ClientsResource { protected List<Client> listClients(@Auth User user) { logger.info("User '{}' listing clients.", user); Set<Client> clients = clientDAO.getClients(); return ImmutableList.copyOf(clients); } @Inject  ClientsResource(AclDAOFactory aclDAOFactory, ClientDAOFactory clientDAOFactory,
      AuditLog auditLog); @VisibleForTesting  ClientsResource(AclDAO aclDAO, ClientDAO clientDAO, AuditLog auditLog); @Timed @ExceptionMetered @GET Response findClients(@Auth User user, @DefaultValue("") @QueryParam("name") String name); @Timed @ExceptionMetered @POST @Consumes(APPLICATION_JSON) Response createClient(@Auth User user,
      @Valid CreateClientRequestV2 createClientRequest); @Path("{clientId}") @Timed @ExceptionMetered @GET ClientDetailResponse getClient(@Auth User user,
      @PathParam("clientId") LongParam clientId); @Path("{clientId}") @Timed @ExceptionMetered @DELETE Response deleteClient(@Auth User user, @PathParam("clientId") LongParam clientId);  }
@Test public void listClients() { Client client1 = new Client(1, "client", "1st client", null, now, "test", now, "test", null, null, true, false ); Client client2 = new Client(2, "client2", "2nd client", null, now, "test", now, "test", null, null, true, false ); when(clientDAO.getClients()).thenReturn(ImmutableSet.of(client1, client2)); List<Client> response = resource.listClients(user); assertThat(response).containsOnly(client1, client2); }