@Test
public void listSecretsBatched() {

  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", NOWPLUS, "user", NOWPLUS, "user",
      emptyMap, null, null, 1136214245, 250L, NOW, "user");
  when(secretController.getSecretsBatched(0, 1, false)).thenReturn(ImmutableList.of(secret1));
  when(secretController.getSecretsBatched(0, 1, true)).thenReturn(ImmutableList.of(secret2));
  when(secretController.getSecretsBatched(1, 1, false)).thenReturn(ImmutableList.of(secret2));
  List<SanitizedSecret> response = resource.listSecretsBatched(user, 0, 1, false);
  assertThat(response).containsOnly(secret1);
  response = resource.listSecretsBatched(user, 1, 1, false);
  assertThat(response).containsOnly(secret2);
  response = resource.listSecretsBatched(user, 0, 1, true);
  assertThat(response).containsOnly(secret2);
}