Rename TemporaryStorageProvider to TemporaryFileProvider, use interface for db contract
This commit is contained in:
@@ -55,7 +55,7 @@ import org.sufficientlysecure.keychain.pgp.UncachedKeyRing;
|
||||
import org.sufficientlysecure.keychain.pgp.UncachedKeyRing.IteratorWithIOThrow;
|
||||
import org.sufficientlysecure.keychain.pgp.WrappedSignature;
|
||||
import org.sufficientlysecure.keychain.provider.ProviderHelper;
|
||||
import org.sufficientlysecure.keychain.provider.TemporaryStorageProvider;
|
||||
import org.sufficientlysecure.keychain.provider.TemporaryFileProvider;
|
||||
import org.sufficientlysecure.keychain.service.ExportKeyringParcel;
|
||||
import org.sufficientlysecure.keychain.service.SaveKeyringParcel;
|
||||
import org.sufficientlysecure.keychain.service.SaveKeyringParcel.Algorithm;
|
||||
@@ -296,7 +296,7 @@ public class ExportTest {
|
||||
PipedOutputStream pipedOutStream = new PipedOutputStream(pipedInStream);
|
||||
when(mockResolver.openOutputStream(fakePipedUri)).thenReturn(pipedOutStream);
|
||||
when(mockResolver.openInputStream(fakePipedUri)).thenReturn(pipedInStream);
|
||||
when(mockResolver.insert(eq(TemporaryStorageProvider.CONTENT_URI), any(ContentValues.class)))
|
||||
when(mockResolver.insert(eq(TemporaryFileProvider.CONTENT_URI), any(ContentValues.class)))
|
||||
.thenReturn(fakePipedUri);
|
||||
|
||||
fakeOutputUri = Uri.parse("content://fake/out/1");
|
||||
|
||||
@@ -43,7 +43,7 @@ import org.sufficientlysecure.keychain.WorkaroundBuildConfig;
|
||||
import org.sufficientlysecure.keychain.operations.InputDataOperation;
|
||||
import org.sufficientlysecure.keychain.operations.results.InputDataResult;
|
||||
import org.sufficientlysecure.keychain.provider.ProviderHelper;
|
||||
import org.sufficientlysecure.keychain.provider.TemporaryStorageProvider;
|
||||
import org.sufficientlysecure.keychain.provider.TemporaryFileProvider;
|
||||
import org.sufficientlysecure.keychain.service.InputDataParcel;
|
||||
import org.sufficientlysecure.keychain.service.input.CryptoInputParcel;
|
||||
|
||||
@@ -117,7 +117,7 @@ public class InputDataOperationTest {
|
||||
|
||||
Uri fakeOutputUri1 = Uri.parse("content://fake/out/1");
|
||||
Uri fakeOutputUri2 = Uri.parse("content://fake/out/2");
|
||||
when(mockResolver.insert(eq(TemporaryStorageProvider.CONTENT_URI), any(ContentValues.class)))
|
||||
when(mockResolver.insert(eq(TemporaryFileProvider.CONTENT_URI), any(ContentValues.class)))
|
||||
.thenReturn(fakeOutputUri1, fakeOutputUri2);
|
||||
|
||||
// application which returns mockresolver
|
||||
@@ -145,10 +145,10 @@ public class InputDataOperationTest {
|
||||
ContentValues contentValues = new ContentValues();
|
||||
contentValues.put("name", "data.txt");
|
||||
contentValues.put("mimetype", "text/plain");
|
||||
verify(mockResolver).insert(TemporaryStorageProvider.CONTENT_URI, contentValues);
|
||||
verify(mockResolver).insert(TemporaryFileProvider.CONTENT_URI, contentValues);
|
||||
contentValues.put("name", (String) null);
|
||||
contentValues.put("mimetype", "text/testvalue");
|
||||
verify(mockResolver).insert(TemporaryStorageProvider.CONTENT_URI, contentValues);
|
||||
verify(mockResolver).insert(TemporaryFileProvider.CONTENT_URI, contentValues);
|
||||
|
||||
// quoted-printable returns windows style line endings for some reason?
|
||||
Assert.assertEquals("first part must have expected content",
|
||||
|
||||
Reference in New Issue
Block a user