### Question:
DataProtection { public byte[] decryptData(final byte[] encryptedData, final DataType dataType, final DataUse dataUse, final InteractionPurpose interactionPurpose) throws IOException, EscrowAgentErrorResponseException { AuthorizationBundle authBundle = new DecryptionBundle(dataType, dataUse, interactionPurpose); SecretKey key = getEncryptionKey(authBundle, PDGuardRequestType .DECRYPTION); try { Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.DECRYPT_MODE, key); return cipher.doFinal(encryptedData); } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) { throw new CryptoException("Data decryption cannot be completed. An" + " unexpected error occurred.", e.getCause()); } } DataProtection(final String escrowAgentName,
            final ClientCredentials clientCredentials); byte[] decryptData(final byte[] encryptedData,
            final DataType dataType, final DataUse dataUse,
            final InteractionPurpose interactionPurpose); byte[] encryptData(final byte[] cleartextData,
            final DataType dataType, final DataProvenance dataProvenance,
            final boolean update); SecretKey getEncryptionKey(
            final AuthorizationBundle authBundle, final PDGuardRequestType
            requestType);  }### Answer:
@Test(expected = CryptoException.class) public void testDataDecryptionFailed() throws NoSuchAlgorithmException, NoSuchPaddingException, BadPaddingException, IllegalBlockSizeException, InvalidKeyException, IOException, EscrowAgentErrorResponseException { byte[] cleartextData = "My personal data".getBytes(); KeyGenerator keyGen = KeyGenerator.getInstance("AES"); SecureRandom random = new SecureRandom(); keyGen.init(random); SecretKey secretKey = keyGen.generateKey(); Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.ENCRYPT_MODE, secretKey); byte[] encryptedData = cipher.doFinal(cleartextData); mockCon.decryptData(encryptedData, DataType.SURNAME, DataUse.COMPOSE_EMAIL_TO_SUBJECT, InteractionPurpose.ADVERT); }