Przeglądaj źródła

Fix tets that need a 8-length remote ID

Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
Álvaro Brey 2 lat temu
rodzic
commit
daafa24905

+ 1 - 1
app/src/androidTest/java/com/owncloud/android/datamodel/FileDataStorageManagerIT.java

@@ -344,7 +344,7 @@ abstract public class FileDataStorageManagerIT extends AbstractOnServerIT {
                                               targetContext).execute(client).isSuccess());
 
         OCFile newFile = new OCFile("/1/1/1.txt");
-        newFile.setRemoteId("123");
+        newFile.setRemoteId("12345678");
 
         sut.saveNewFile(newFile);
     }

+ 9 - 9
app/src/androidTest/java/com/owncloud/android/ui/fragment/GalleryFragmentIT.kt

@@ -52,10 +52,10 @@ class GalleryFragmentIT : AbstractIT() {
     fun before() {
         activity = testActivityRule.launchActivity(null)
 
-        createImage(1, true, 700, 300)
-        createImage(2, true, 500, 300)
+        createImage(10000001, true, 700, 300)
+        createImage(10000002, true, 500, 300)
 
-        createImage(7, true, 300, 400)
+        createImage(10000007, true, 300, 400)
     }
 
     @After
@@ -73,14 +73,14 @@ class GalleryFragmentIT : AbstractIT() {
         longSleep()
     }
 
-    private fun createImage(int: Int, createPreview: Boolean = true, width: Int? = null, height: Int? = null) {
+    private fun createImage(id: Int, createPreview: Boolean = true, width: Int? = null, height: Int? = null) {
         val defaultSize = ThumbnailsCacheManager.getThumbnailDimension().toFloat()
-        val file = OCFile("/$int.png").apply {
-            fileId = int.toLong()
-            remoteId = "$int"
+        val file = OCFile("/$id.png").apply {
+            fileId = id.toLong()
+            remoteId = "$id"
             mimeType = "image/png"
             isPreviewAvailable = true
-            modificationTimestamp = (1658475504 + int.toLong()) * 1000
+            modificationTimestamp = (1658475504 + id.toLong()) * 1000
             imageDimension = ImageDimension(width?.toFloat() ?: defaultSize, height?.toFloat() ?: defaultSize)
             storageManager.saveFile(this)
         }
@@ -116,6 +116,6 @@ class GalleryFragmentIT : AbstractIT() {
 
         assertNotNull(ThumbnailsCacheManager.getBitmapFromDiskCache(PREFIX_RESIZED_IMAGE + file.remoteId))
 
-        Log_OC.d("Gallery_thumbnail", "created $int with ${bitmap.width} x ${bitmap.height}")
+        Log_OC.d("Gallery_thumbnail", "created $id with ${bitmap.width} x ${bitmap.height}")
     }
 }