@Test
public void returnsSingleSecretWhenAllowed() throws Exception {

    SanitizedSecret sanitizedSecret = SanitizedSecret.fromSecret(secret);
    ImmutableList<String> secretNames = ImmutableList.of(sanitizedSecret.name());
    BatchSecretRequest req = BatchSecretRequest.create(secretNames);
    when(aclDAO.getBatchSanitizedSecretsFor(client, secretNames))
            .thenReturn(List.of(sanitizedSecret));
    when(clientDAO.getClientByName(client.getName())).thenReturn(Optional.of(client));
    when(secretController.getSecretsByName(secretNames))
            .thenReturn(List.of(secret));
    List<SecretDeliveryResponse> response = batchSecretDeliveryResource.getBatchSecret(client, req);
    assertThat(response).isEqualTo(ImmutableList.of(SecretDeliveryResponse.fromSecret(secret)));
}