2015-10-01 12:36:54 -07:00

25 lines
699 B
Java

package org.thoughtcrime.securesms.crypto;
import org.junit.Before;
import org.junit.Test;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.thoughtcrime.securesms.BaseUnitTest;
import org.whispersystems.libaxolotl.InvalidMessageException;
@PowerMockIgnore("javax.crypto.*")
public class MasterCipherTest extends BaseUnitTest {
private MasterCipher masterCipher;
@Before
@Override
public void setUp() throws Exception {
super.setUp();
masterCipher = new MasterCipher(masterSecret);
}
@Test(expected = InvalidMessageException.class)
public void testEncryptBytesWithZeroBody() throws Exception {
masterCipher.decryptBytes(new byte[]{});
}
}