diff --git a/owncloudData/src/test/java/com/owncloud/android/data/folderbackup/repository/OCFolderBackupRepositoryTest.kt b/owncloudData/src/test/java/com/owncloud/android/data/folderbackup/repository/OCFolderBackupRepositoryTest.kt index 8eea93dc017..a93add01216 100644 --- a/owncloudData/src/test/java/com/owncloud/android/data/folderbackup/repository/OCFolderBackupRepositoryTest.kt +++ b/owncloudData/src/test/java/com/owncloud/android/data/folderbackup/repository/OCFolderBackupRepositoryTest.kt @@ -42,7 +42,7 @@ class OCFolderBackupRepositoryTest { private val pictureUploadsName = "Pictures uploads" @Test - fun `getAutomaticUploadsConfiguration returns AutomaticUploadsConfiguration`() { + fun `getAutomaticUploadsConfiguration returns an AutomaticUploadsConfiguration`() { every { localFolderBackupDataSource.getAutomaticUploadsConfiguration() } returns OC_AUTOMATIC_UPLOADS_CONFIGURATION @@ -56,7 +56,7 @@ class OCFolderBackupRepositoryTest { } @Test - fun `getAutomaticUploadsConfiguration returns null when local data source returns a null configuration`() { + fun `getAutomaticUploadsConfiguration returns null when local datasource returns a null configuration`() { every { localFolderBackupDataSource.getAutomaticUploadsConfiguration() } returns null @@ -84,7 +84,7 @@ class OCFolderBackupRepositoryTest { } @Test - fun `getFolderBackupConfigurationByNameAsFlow returns a Flow with null when local data source returns a Flow with null `() = runTest { + fun `getFolderBackupConfigurationByNameAsFlow returns a Flow with null when local datasource returns a Flow with null `() = runTest { every { localFolderBackupDataSource.getFolderBackupConfigurationByNameAsFlow(pictureUploadsName) } returns flowOf(null) @@ -107,7 +107,7 @@ class OCFolderBackupRepositoryTest { } @Test - fun `resetFolderBackupConfigurationByName resets a folder backup configuration correctly by the name`() { + fun `resetFolderBackupConfigurationByName resets a folder backup configuration by name correctly`() { ocFolderBackupRepository.resetFolderBackupConfigurationByName(pictureUploadsName) verify(exactly = 1) { diff --git a/owncloudData/src/test/java/com/owncloud/android/data/server/repository/OCServerInfoRepositoryTest.kt b/owncloudData/src/test/java/com/owncloud/android/data/server/repository/OCServerInfoRepositoryTest.kt index ae242e26dec..3148c690bec 100644 --- a/owncloudData/src/test/java/com/owncloud/android/data/server/repository/OCServerInfoRepositoryTest.kt +++ b/owncloudData/src/test/java/com/owncloud/android/data/server/repository/OCServerInfoRepositoryTest.kt @@ -64,7 +64,7 @@ class OCServerInfoRepositoryTest { } @Test - fun `getServerInfo returns a BasicServer when creatingAccount parameter is true and webfinger datasource returns null`() { + fun `getServerInfo returns a BasicServer when creatingAccount parameter is true and webfinger datasource throws an exception`() { every { remoteWebFingerDataSource.getInstancesFromWebFinger( lookupServer = OC_SECURE_SERVER_INFO_BASIC_AUTH.baseUrl, @@ -95,7 +95,7 @@ class OCServerInfoRepositoryTest { } @Test - fun `getServerInfo returns an OAuthServer when creatingAccount parameter is false`() { + fun `getServerInfo returns an OAuth2Server when creatingAccount parameter is false`() { every { remoteServerInfoDataSource.getServerInfo(OC_SECURE_SERVER_INFO_BEARER_AUTH.baseUrl, false) } returns OC_SECURE_SERVER_INFO_BEARER_AUTH @@ -118,7 +118,7 @@ class OCServerInfoRepositoryTest { } @Test - fun `getServerInfo returns an OAuthServer when creatingAccount parameter is true and webfinger datasource returns null`() { + fun `getServerInfo returns an OAuth2Server when creatingAccount parameter is true and webfinger datasource throws an exception`() { every { remoteWebFingerDataSource.getInstancesFromWebFinger( lookupServer = OC_SECURE_SERVER_INFO_BEARER_AUTH.baseUrl, @@ -177,7 +177,7 @@ class OCServerInfoRepositoryTest { } @Test - fun `getServerInfo returns an OIDCServer when creatingAccount parameter is true and web finger datasource returns null`() { + fun `getServerInfo returns an OIDCServer when creatingAccount parameter is true and webfinger datasource throws an exception`() { every { remoteWebFingerDataSource.getInstancesFromWebFinger( lookupServer = OC_SECURE_SERVER_INFO_OIDC_AUTH.baseUrl, @@ -213,7 +213,7 @@ class OCServerInfoRepositoryTest { } @Test - fun `getServerInfo returns an OIDCServer when creatingAccount is true and web finger data source returns an instance`() { + fun `getServerInfo returns an OIDCServer when creatingAccount is true and webfinger datasource returns an OIDC issuer`() { every { remoteWebFingerDataSource.getInstancesFromWebFinger( lookupServer = OC_SECURE_SERVER_INFO_OIDC_AUTH_WEBFINGER_INSTANCE.baseUrl, diff --git a/owncloudData/src/test/java/com/owncloud/android/data/sharing/sharees/repository/OCShareeRepositoryTest.kt b/owncloudData/src/test/java/com/owncloud/android/data/sharing/sharees/repository/OCShareeRepositoryTest.kt index acfc2b7cc20..c41572bca27 100644 --- a/owncloudData/src/test/java/com/owncloud/android/data/sharing/sharees/repository/OCShareeRepositoryTest.kt +++ b/owncloudData/src/test/java/com/owncloud/android/data/sharing/sharees/repository/OCShareeRepositoryTest.kt @@ -33,7 +33,7 @@ import org.junit.Test class OCShareeRepositoryTest { private val remoteShareeDataSource = mockk(relaxUnitFun = true) - private val oCShareeRepository = OCShareeRepository(remoteShareeDataSource) + private val ocShareeRepository = OCShareeRepository(remoteShareeDataSource) private val searchString = "user" private val requestedPage = 1 @@ -45,7 +45,7 @@ class OCShareeRepositoryTest { remoteShareeDataSource.getSharees(searchString, requestedPage, resultsPerPage, OC_ACCOUNT_NAME) } returns listOf(OC_SHAREE) - val listOfSharees = oCShareeRepository.getSharees(searchString, requestedPage, resultsPerPage, OC_ACCOUNT_NAME) + val listOfSharees = ocShareeRepository.getSharees(searchString, requestedPage, resultsPerPage, OC_ACCOUNT_NAME) assertEquals(listOf(OC_SHAREE), listOfSharees) verify(exactly = 1) { diff --git a/owncloudData/src/test/java/com/owncloud/android/data/sharing/shares/repository/OCShareRepositoryTest.kt b/owncloudData/src/test/java/com/owncloud/android/data/sharing/shares/repository/OCShareRepositoryTest.kt index 0e7028a3d80..cef49c6cffc 100644 --- a/owncloudData/src/test/java/com/owncloud/android/data/sharing/shares/repository/OCShareRepositoryTest.kt +++ b/owncloudData/src/test/java/com/owncloud/android/data/sharing/shares/repository/OCShareRepositoryTest.kt @@ -66,7 +66,7 @@ class OCShareRepositoryTest { every { localShareDataSource.insert(OC_PRIVATE_SHARE) - } returns 1 + } returns 1 // The result of this method is not used, so it can be anything ocShareRepository.insertPrivateShare(filePath, OC_PRIVATE_SHARE.shareType, OC_SHAREE.shareWith, permissions, OC_ACCOUNT_NAME) @@ -100,7 +100,7 @@ class OCShareRepositoryTest { every { localShareDataSource.update(OC_PRIVATE_SHARE) - } returns 1 + } returns 1 // The result of this method is not used, so it can be anything ocShareRepository.updatePrivateShare(OC_PRIVATE_SHARE.remoteId, permissions, OC_ACCOUNT_NAME) @@ -134,7 +134,7 @@ class OCShareRepositoryTest { every { localShareDataSource.insert(OC_PUBLIC_SHARE) - } returns 1 + } returns 1 // The result of this method is not used, so it can be anything ocShareRepository.insertPublicShare(filePath, permissions, OC_PUBLIC_SHARE.name!!, password, expiration, OC_ACCOUNT_NAME) @@ -168,7 +168,7 @@ class OCShareRepositoryTest { every { localShareDataSource.update(OC_PUBLIC_SHARE) - } returns 1 + } returns 1 // The result of this method is not used, so it can be anything ocShareRepository.updatePublicShare(OC_PUBLIC_SHARE.remoteId, OC_PUBLIC_SHARE.name!!, password, expiration, permissions, OC_ACCOUNT_NAME) @@ -226,7 +226,7 @@ class OCShareRepositoryTest { } @Test - fun `refreshSharesFromNetwork refreshes shares correctly when the list of shares is not empty`() { + fun `refreshSharesFromNetwork refreshes shares correctly when the list of shares received is not empty`() { every { remoteShareDataSource.getShares( remoteFilePath = filePath, @@ -238,7 +238,7 @@ class OCShareRepositoryTest { every { localShareDataSource.replaceShares(listOfShares) - } returns listOf(1, 1, 1, 1) + } returns listOf(1, 1) // The result of this method is not used, so it can be anything ocShareRepository.refreshSharesFromNetwork(filePath, OC_ACCOUNT_NAME) @@ -254,7 +254,7 @@ class OCShareRepositoryTest { } @Test - fun `refreshSharesFromNetwork refreshes shares correctly when the list of shares is empty`() { + fun `refreshSharesFromNetwork deletes local shares and refreshes shares correctly when the list of shares received is empty`() { every { remoteShareDataSource.getShares( remoteFilePath = filePath, @@ -286,7 +286,7 @@ class OCShareRepositoryTest { fun `deleteShare deletes a share correctly`() { every { localShareDataSource.deleteShare(OC_SHARE.remoteId) - } returns 1 + } returns 1 // The result of this method is not used, so it can be anything ocShareRepository.deleteShare(OC_SHARE.remoteId, OC_ACCOUNT_NAME) diff --git a/owncloudTestUtil/src/main/java/com/owncloud/android/testutil/OCSharee.kt b/owncloudTestUtil/src/main/java/com/owncloud/android/testutil/OCSharee.kt index 51d658d708d..c6d97074d6d 100644 --- a/owncloudTestUtil/src/main/java/com/owncloud/android/testutil/OCSharee.kt +++ b/owncloudTestUtil/src/main/java/com/owncloud/android/testutil/OCSharee.kt @@ -1,6 +1,8 @@ /** * ownCloud Android client application * + * @author Jorge Aguado Recio + * * Copyright (C) 2024 ownCloud GmbH. * * This program is free software: you can redistribute it and/or modify