@Test
public void whenNoCredentialsCouldBeDecrypted_whenThereAreCredentials_andNoneCanBeDecrypted() {

  when(credentialVersionDataService.count()).thenReturn(4L);
  when(credentialVersionDataService.countEncryptedWithKeyUuidIn(any())).thenReturn(0L);
  decryptableDataDetector = new DefaultDecryptableDataDetector(
    keySet,
    credentialVersionDataService
  );
  try {
    decryptableDataDetector.check();
  } catch (final RuntimeException rte) {
    assertThat(rte.getMessage(),
      containsString("The encryption keys provided cannot decrypt any of the 4 value(s) in the database."
        + " Please make sure you've provided the necessary encryption keys."));
  }
}