From 4a7ca09e613eae2cb409d81d26ddc58bcb63d76f Mon Sep 17 00:00:00 2001 From: joragua Date: Tue, 10 Dec 2024 14:20:32 +0100 Subject: [PATCH] test: refactored some asserts and set correct parameters in some tests --- .../owncloud/android/data/oauth/OCOAuthRepositoryTest.kt | 8 ++++---- .../sharing/shares/repository/OCShareRepositoryTest.kt | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/owncloudData/src/test/java/com/owncloud/android/data/oauth/OCOAuthRepositoryTest.kt b/owncloudData/src/test/java/com/owncloud/android/data/oauth/OCOAuthRepositoryTest.kt index e9078930a9f..0195d3f232f 100644 --- a/owncloudData/src/test/java/com/owncloud/android/data/oauth/OCOAuthRepositoryTest.kt +++ b/owncloudData/src/test/java/com/owncloud/android/data/oauth/OCOAuthRepositoryTest.kt @@ -24,7 +24,7 @@ package com.owncloud.android.data.oauth import com.owncloud.android.data.oauth.datasources.RemoteOAuthDataSource import com.owncloud.android.data.oauth.repository.OCOAuthRepository -import com.owncloud.android.testutil.OC_SECURE_SERVER_INFO_BASIC_AUTH +import com.owncloud.android.testutil.OC_SECURE_SERVER_INFO_OIDC_AUTH import com.owncloud.android.testutil.oauth.OC_CLIENT_REGISTRATION import com.owncloud.android.testutil.oauth.OC_CLIENT_REGISTRATION_REQUEST import com.owncloud.android.testutil.oauth.OC_OIDC_SERVER_CONFIGURATION @@ -44,14 +44,14 @@ class OCOAuthRepositoryTest { @Test fun `performOIDCDiscovery returns an OIDCServerConfiguration`() { every { - remoteOAuthDataSource.performOIDCDiscovery(OC_SECURE_SERVER_INFO_BASIC_AUTH.baseUrl) + remoteOAuthDataSource.performOIDCDiscovery(OC_SECURE_SERVER_INFO_OIDC_AUTH.baseUrl) } returns OC_OIDC_SERVER_CONFIGURATION - val oidcServerConfiguration = oAuthRepository.performOIDCDiscovery(OC_SECURE_SERVER_INFO_BASIC_AUTH.baseUrl) + val oidcServerConfiguration = oAuthRepository.performOIDCDiscovery(OC_SECURE_SERVER_INFO_OIDC_AUTH.baseUrl) assertEquals(OC_OIDC_SERVER_CONFIGURATION, oidcServerConfiguration) verify(exactly = 1) { - remoteOAuthDataSource.performOIDCDiscovery(OC_SECURE_SERVER_INFO_BASIC_AUTH.baseUrl) + remoteOAuthDataSource.performOIDCDiscovery(OC_SECURE_SERVER_INFO_OIDC_AUTH.baseUrl) } } 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 acacad7e0b9..0e7028a3d80 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 @@ -198,7 +198,7 @@ class OCShareRepositoryTest { } returns sharesLiveDataList val sharesResult = ocShareRepository.getSharesAsLiveData(filePath, OC_ACCOUNT_NAME) - assertEquals(sharesResult, sharesLiveDataList) + assertEquals(sharesLiveDataList, sharesResult) verify(exactly = 1) { localShareDataSource.getSharesAsLiveData( @@ -218,7 +218,7 @@ class OCShareRepositoryTest { } returns shareLiveData val shareResult = ocShareRepository.getShareAsLiveData(OC_SHARE.remoteId) - assertEquals(shareResult, shareLiveData) + assertEquals(shareLiveData, shareResult) verify(exactly = 1) { localShareDataSource.getShareAsLiveData(OC_SHARE.remoteId)