SecretsResource { protected List<SanitizedSecret> listSecrets(@Auth User user) { logger.info("User '{}' listing secrets.", user); return secretController.getSanitizedSecrets(null, null); } @SuppressWarnings("unused") @Inject  SecretsResource(SecretController secretController, AclDAOFactory aclDAOFactory,
      SecretDAOFactory secretDAOFactory, AuditLog auditLog); @VisibleForTesting  SecretsResource(SecretController secretController, AclDAO aclDAOReadOnly,
      SecretDAO secretDAOReadWrite, AuditLog auditLog); @Timed @ExceptionMetered @GET Response findSecrets(@Auth User user, @DefaultValue("") @QueryParam("name") String name,
      @DefaultValue("") @QueryParam("nameOnly") String nameOnly, @QueryParam("idx") Integer idx,
      @QueryParam("num") Integer num,
      @DefaultValue("true") @QueryParam("newestFirst") Boolean newestFirst); @Timed @ExceptionMetered @POST @Consumes(APPLICATION_JSON) Response createSecret(@Auth User user, @Valid CreateSecretRequestV2 request); @Path("{name}") @Timed @ExceptionMetered @POST @Consumes(APPLICATION_JSON) Response createOrUpdateSecret(@Auth User user, @PathParam("name") String secretName,
      @Valid CreateOrUpdateSecretRequestV2 request); @Path("{name}/partialupdate") @Timed @ExceptionMetered @POST @Consumes(APPLICATION_JSON) Response partialUpdateSecret(@Auth User user, @PathParam("name") String secretName, @Valid
      PartialUpdateSecretRequestV2 request); @Path("{secretId}") @Timed @ExceptionMetered @GET SecretDetailResponse retrieveSecret(@Auth User user,
      @PathParam("secretId") LongParam secretId); @Timed @ExceptionMetered @GET @Path("versions/{name}") @Produces(APPLICATION_JSON) List<SanitizedSecret> secretVersions(@Auth User user,
      @PathParam("name") String name, @QueryParam("versionIdx") int versionIdx,
      @QueryParam("numVersions") int numVersions); @Path("rollback/{secretName}/{versionId}") @Timed @ExceptionMetered @POST Response resetSecretVersion(@Auth User user, @PathParam("secretName") String secretName,
      @PathParam("versionId") LongParam versionId); @Path("{secretId}") @Timed @ExceptionMetered @DELETE Response deleteSecret(@Auth User user, @PathParam("secretId") LongParam secretId);  }
@Test public void listSecrets() { SanitizedSecret secret1 = SanitizedSecret.of(1, "name1", "desc","checksum", NOW, "user", NOW, "user", emptyMap, null, null, 1136214245, 125L, NOW, "user"); SanitizedSecret secret2 = SanitizedSecret.of(2, "name2", "desc","checksum", NOW, "user", NOW, "user", emptyMap, null, null, 1136214245, 250L, NOW, "user"); when(secretController.getSanitizedSecrets(null, null)).thenReturn(ImmutableList.of(secret1, secret2)); List<SanitizedSecret> response = resource.listSecrets(user); assertThat(response).containsOnly(secret1, secret2); }