From ae7e865c2459aee2028ee5c3d7b1ae682a9c591a Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Mon, 22 Feb 2016 13:12:36 +0100 Subject: [PATCH] fixed unit test --- .../org/cryptomator/crypto/engine/impl/FileHeaderTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main/filesystem-crypto/src/test/java/org/cryptomator/crypto/engine/impl/FileHeaderTest.java b/main/filesystem-crypto/src/test/java/org/cryptomator/crypto/engine/impl/FileHeaderTest.java index 97edc75a4..391fa88b4 100644 --- a/main/filesystem-crypto/src/test/java/org/cryptomator/crypto/engine/impl/FileHeaderTest.java +++ b/main/filesystem-crypto/src/test/java/org/cryptomator/crypto/engine/impl/FileHeaderTest.java @@ -16,6 +16,7 @@ import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; import org.bouncycastle.util.encoders.Base64; +import org.cryptomator.crypto.engine.AuthenticationFailedException; import org.junit.Assert; import org.junit.Test; @@ -63,7 +64,7 @@ public class FileHeaderTest { Assert.assertArrayEquals(new byte[32], header.getPayload().getContentKey().getEncoded()); } - @Test(expected = IllegalArgumentException.class) + @Test(expected = AuthenticationFailedException.class) public void testDecryptionWithInvalidMac1() { final byte[] keyBytes = new byte[32]; final SecretKey headerKey = new SecretKeySpec(keyBytes, "AES"); @@ -72,7 +73,7 @@ public class FileHeaderTest { FileHeader.decrypt(headerKey, new ThreadLocalMac(macKey, "HmacSHA256"), headerBuf); } - @Test(expected = IllegalArgumentException.class) + @Test(expected = AuthenticationFailedException.class) public void testDecryptionWithInvalidMac2() { final byte[] keyBytes = new byte[32]; final SecretKey headerKey = new SecretKeySpec(keyBytes, "AES");