@Test public void findClientByName() { when(clientDAO.getClientByName(client.getName())).thenReturn(Optional.of(client)); assertThat(resource.getClientByName(user, "client")).isEqualTo(client); }
protected Client getClientByName(@Auth User user, String name) { logger.info("User '{}' retrieving client name={}.", user, name); return clientFromName(name); }
ClientsResource { protected Client getClientByName(@Auth User user, String name) { logger.info("User '{}' retrieving client name={}.", user, name); return clientFromName(name); } }
ClientsResource { protected Client getClientByName(@Auth User user, String name) { logger.info("User '{}' retrieving client name={}.", user, name); return clientFromName(name); } @Inject  ClientsResource(AclDAOFactory aclDAOFactory, ClientDAOFactory clientDAOFactory,
      AuditLog auditLog); @VisibleForTesting  ClientsResource(AclDAO aclDAO, ClientDAO clientDAO, AuditLog auditLog); }
ClientsResource { protected Client getClientByName(@Auth User user, String name) { logger.info("User '{}' retrieving client name={}.", user, name); return clientFromName(name); } @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); }
ClientsResource { protected Client getClientByName(@Auth User user, String name) { logger.info("User '{}' retrieving client name={}.", user, name); return clientFromName(name); } @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);  }