From 5f7c30e840872abf2e30e218ff419c1085b9d96f Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Tue, 3 Apr 2018 00:53:29 -0700 Subject: [PATCH] Remove some old tests Fixes #7458 --- .../securesms/crypto/MasterCipherTest.java | 24 ----------- .../jobs/AttachmentDownloadJobTest.java | 40 ------------------- 2 files changed, 64 deletions(-) delete mode 100644 test/unitTest/java/org/thoughtcrime/securesms/crypto/MasterCipherTest.java delete mode 100644 test/unitTest/java/org/thoughtcrime/securesms/jobs/AttachmentDownloadJobTest.java diff --git a/test/unitTest/java/org/thoughtcrime/securesms/crypto/MasterCipherTest.java b/test/unitTest/java/org/thoughtcrime/securesms/crypto/MasterCipherTest.java deleted file mode 100644 index 3d71cfaee3..0000000000 --- a/test/unitTest/java/org/thoughtcrime/securesms/crypto/MasterCipherTest.java +++ /dev/null @@ -1,24 +0,0 @@ -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.libsignal.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[]{}); - } -} diff --git a/test/unitTest/java/org/thoughtcrime/securesms/jobs/AttachmentDownloadJobTest.java b/test/unitTest/java/org/thoughtcrime/securesms/jobs/AttachmentDownloadJobTest.java deleted file mode 100644 index af9a6735a5..0000000000 --- a/test/unitTest/java/org/thoughtcrime/securesms/jobs/AttachmentDownloadJobTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.thoughtcrime.securesms.jobs; - -import org.junit.Before; -import org.junit.Test; -import org.thoughtcrime.securesms.BaseUnitTest; -import org.thoughtcrime.securesms.attachments.Attachment; -import org.thoughtcrime.securesms.attachments.AttachmentId; -import org.thoughtcrime.securesms.jobs.AttachmentDownloadJob.InvalidPartException; - -import static org.mockito.Mockito.when; -import static org.powermock.api.mockito.PowerMockito.mock; - -public class AttachmentDownloadJobTest extends BaseUnitTest { - private AttachmentDownloadJob job; - - @Before - @Override - public void setUp() throws Exception { - super.setUp(); - job = new AttachmentDownloadJob(context, 1L, new AttachmentId(1L, 1L), false); - } - - @Test(expected = InvalidPartException.class) - public void testCreateAttachmentPointerInvalidId() throws Exception { - Attachment attachment = mock(Attachment.class); - when(attachment.getLocation()).thenReturn(null); - when(attachment.getKey()).thenReturn("a long and acceptable valid key like we all want"); - - job.createAttachmentPointer(masterSecret, attachment); - } - - @Test(expected = InvalidPartException.class) - public void testCreateAttachmentPointerInvalidKey() throws Exception { - Attachment attachment = mock(Attachment.class); - when(attachment.getLocation()).thenReturn("something"); - when(attachment.getKey()).thenReturn(null); - - job.createAttachmentPointer(masterSecret, attachment); - } -}