Mam metodę encrypt, muszę do niej napisać testy jednostkowe z wyjątkami, ale nie wiem jak zrobić test, który spowoduje u mnie wyjątek IllegalBlockSizeException
static byte[] encrypt(byte[] plainTextByte, SecretKey klucz) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException {
Cipher cipher = Cipher.getInstance("DESede/ECB/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, klucz);
System.out.println("Value of Cipher.ENCRYPT_MODE: " + Cipher.ENCRYPT_MODE);
byte[] encryptedBytes = cipher.doFinal(plainTextByte);
return encryptedBytes;
}