SecretSeriesDAO { public List<SecretSeries> getMultipleSecretSeriesByName(List<String> names) { return dslContext.fetch(SECRETS, SECRETS.NAME.in(names).and(SECRETS.CURRENT.isNotNull())).map(secretSeriesMapper::map); } private  SecretSeriesDAO(DSLContext dslContext, ObjectMapper mapper,
      SecretSeriesMapper secretSeriesMapper, RowHmacGenerator rowHmacGenerator); int setExpiration(long secretContentId, Instant expiration); int setHmac(long secretContentId, String hmac); int setCurrentVersion(long secretId, long secretContentId, String updater, long now); Optional<SecretSeries> getSecretSeriesById(long id); Optional<SecretSeries> getSecretSeriesByName(String name); List<SecretSeries> getMultipleSecretSeriesByName(List<String> names); ImmutableList<SecretSeries> getSecretSeries(@Nullable Long expireMaxTime,
      @Nullable Group group, @Nullable Long expireMinTime, @Nullable String minName,
      @Nullable Integer limit); ImmutableList<SecretSeries> getSecretSeriesBatched(int idx, int num, boolean newestFirst); void deleteSecretSeriesByName(String name); void deleteSecretSeriesById(long id); int countDeletedSecretSeries(); List<Long> getIdsForSecretSeriesDeletedBeforeDate(DateTime deleteBefore); long dangerPermanentlyRemoveRecordsForGivenIDs(List<Long> ids);  }
@Test public void getNonExistentMultipleSecretSeriesByName() { assertThat(secretSeriesDAO.getMultipleSecretSeriesByName(List.of("non-existent"))).isEmpty(); }
@Test public void getMultipleSecretSeriesByName() { int before = tableSize(); long now = OffsetDateTime.now().toEpochSecond(); ApiDate nowDate = new ApiDate(now); long id = secretSeriesDAO.createSecretSeries("newSecretSeries", "creator", "desc", null, ImmutableMap.of("foo", "bar"), now); long contentId = secretContentDAO.createSecretContent(id, "blah", "checksum", "creator", null, 0, now); secretSeriesDAO.setCurrentVersion(id, contentId, "creator", now); long id2 = secretSeriesDAO.createSecretSeries("newSecretSeries2", "creator", "desc", null, ImmutableMap.of("f00", "b4r"), now); long contentId2 = secretContentDAO.createSecretContent(id2, "blah", "checksum", "creator", null, 0, now); secretSeriesDAO.setCurrentVersion(id2, contentId2, "creator", now); assertThat(tableSize()).isEqualTo(before + 2); SecretSeries expected1 = SecretSeries.of(id, "newSecretSeries", "desc", nowDate, "creator", nowDate, "creator", null, ImmutableMap.of("foo", "bar"), contentId); SecretSeries expected2 = SecretSeries.of(id2, "newSecretSeries2", "desc", nowDate, "creator", nowDate, "creator", null, ImmutableMap.of("f00", "b4r"), contentId2); List<SecretSeries> actual = secretSeriesDAO.getMultipleSecretSeriesByName(List.of("newSecretSeries", "newSecretSeries2")); assertThat(actual).contains(expected1); assertThat(actual).contains(expected2); }