### Question:
AthenaUDFHandler extends UserDefinedFunctionHandler { public String encrypt(String plaintext, String secretName) { String secretString = cachableSecretsManager.getSecret(secretName); byte[] plaintextKey = Base64.getDecoder().decode(secretString); try { Cipher cipher = getCipher(Cipher.ENCRYPT_MODE, plaintextKey); byte[] encryptedContent = cipher.doFinal(plaintext.getBytes()); byte[] encodedContent = Base64.getEncoder().encode(encryptedContent); return new String(encodedContent); } catch (IllegalBlockSizeException | BadPaddingException e) { throw new RuntimeException(e); } } AthenaUDFHandler(); @VisibleForTesting  AthenaUDFHandler(CachableSecretsManager cachableSecretsManager); String compress(String input); String decompress(String input); String decrypt(String ciphertext, String secretName); String encrypt(String plaintext, String secretName);  }### Answer:
@Test public void testKmsEncryption() throws Exception { SecretKeySpec skeySpec = new SecretKeySpec(decoder.decode(PLAINTEXT_DATA_KEY), "AES"); Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.ENCRYPT_MODE, skeySpec); String content = "abcdef"; String expected = new String(encoder.encode(cipher.doFinal(content.getBytes()))); String result = athenaUDFHandler.encrypt(content, DUMMY_SECRET_NAME); assertEquals(expected, result); }