@Test
public void retrieveSecrets_secretWithoutKey() {

    final DbEncryptedSecret secret = new DbEncryptedSecret();
    when(this.secretRepository.findIdOfValidMostRecent(any(), any(), any())).thenReturn(1L);
    when(this.secretRepository.findById(1L)).thenReturn(Optional.of(secret));
    assertThatIllegalStateException().isThrownBy(
            () -> this.service.retrieveSecrets("SOME_DEVICE", Arrays.asList(SecretType.E_METER_MASTER_KEY)));
}