### Question:
Encryptor { public static String encrypt(String key, String initVector, String value) { try { IvParameterSpec iv = new IvParameterSpec(initVector.getBytes(Constants.UTF_8_CHARSET)); SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes(Constants.UTF_8_CHARSET), Constants.AES_ALGORITHM); Cipher cipher = Cipher.getInstance(Constants.AES_CTR_NO_PADDING); cipher.init(Cipher.ENCRYPT_MODE, skeySpec, iv); byte[] encrypted = cipher.doFinal(value.getBytes()); return Base64.encodeToString(encrypted, Base64.DEFAULT); } catch (Exception ex) { ex.printStackTrace(); SentryUtils.captureException(ex); } return null; }  static String encrypt(String key, String initVector, String value); static String decrypt(String key, String initVector, String encrypted);  }### Answer:
@Test public void test_encrypt_without_exception() { String normalString = "This is my test string"; String key = "1234567890123456"; String vector = "1234567890123456"; PowerMockito.when(Base64.encodeToString(any(byte[].class), anyInt())).thenReturn(""); String realEncryptedString = Encryptor.encrypt(key, vector, normalString); assertNotEquals(realEncryptedString, normalString); PowerMockito.verifyStatic(Base64.class, times(1)); Base64.encodeToString(any(byte[].class), anyInt()); }