-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: modified the value of
resource
parameter from OCWebFinger…
…RepositoryTest
- Loading branch information
Showing
1 changed file
with
11 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* | ||
* @author Jorge Aguado Recio | ||
* | ||
* Copyright (C) 2024 ownCloud GmbH. | ||
* Copyright (C) 2025 ownCloud GmbH. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2, | ||
|
@@ -40,37 +40,41 @@ class OCWebFingerRepositoryTest { | |
|
||
@Test | ||
fun `getInstancesFromWebFinger returns a list of String of webfinger url`() { | ||
val webFingerResource = "admin" | ||
|
||
every { | ||
remoteWebFingerDatasource.getInstancesFromWebFinger( | ||
OC_SECURE_SERVER_INFO_BASIC_AUTH.baseUrl, | ||
WebFingerRel.OIDC_ISSUER_DISCOVERY, | ||
OC_SECURE_SERVER_INFO_BASIC_AUTH.baseUrl | ||
webFingerResource | ||
) | ||
} returns listOf(webFingerInstance) | ||
|
||
val webFingerResult = ocWebFingerRepository.getInstancesFromWebFinger( | ||
OC_SECURE_SERVER_INFO_BASIC_AUTH.baseUrl, | ||
WebFingerRel.OIDC_ISSUER_DISCOVERY, | ||
OC_SECURE_SERVER_INFO_BASIC_AUTH.baseUrl | ||
webFingerResource | ||
) | ||
assertEquals(listOf(webFingerInstance), webFingerResult) | ||
|
||
verify(exactly = 1) { | ||
remoteWebFingerDatasource.getInstancesFromWebFinger( | ||
OC_SECURE_SERVER_INFO_BASIC_AUTH.baseUrl, | ||
WebFingerRel.OIDC_ISSUER_DISCOVERY, | ||
OC_SECURE_SERVER_INFO_BASIC_AUTH.baseUrl | ||
webFingerResource | ||
) | ||
} | ||
} | ||
|
||
@Test | ||
fun `getInstancesFromAuthenticatedWebFinger returns a list of String of webfinger url`() { | ||
val webFingerAuthenticatedResource = "acct:[email protected]" | ||
|
||
every { | ||
remoteWebFingerDatasource.getInstancesFromAuthenticatedWebFinger( | ||
OC_SECURE_SERVER_INFO_BASIC_AUTH.baseUrl, | ||
WebFingerRel.OIDC_ISSUER_DISCOVERY, | ||
OC_SECURE_SERVER_INFO_BASIC_AUTH.baseUrl, | ||
webFingerAuthenticatedResource, | ||
OC_ACCOUNT_ID, | ||
OC_ACCESS_TOKEN | ||
) | ||
|
@@ -79,7 +83,7 @@ class OCWebFingerRepositoryTest { | |
val webFingerResult = ocWebFingerRepository.getInstancesFromAuthenticatedWebFinger( | ||
OC_SECURE_SERVER_INFO_BASIC_AUTH.baseUrl, | ||
WebFingerRel.OIDC_ISSUER_DISCOVERY, | ||
OC_SECURE_SERVER_INFO_BASIC_AUTH.baseUrl, | ||
webFingerAuthenticatedResource, | ||
OC_ACCOUNT_ID, | ||
OC_ACCESS_TOKEN | ||
) | ||
|
@@ -89,7 +93,7 @@ class OCWebFingerRepositoryTest { | |
remoteWebFingerDatasource.getInstancesFromAuthenticatedWebFinger( | ||
OC_SECURE_SERVER_INFO_BASIC_AUTH.baseUrl, | ||
WebFingerRel.OIDC_ISSUER_DISCOVERY, | ||
OC_SECURE_SERVER_INFO_BASIC_AUTH.baseUrl, | ||
webFingerAuthenticatedResource, | ||
OC_ACCOUNT_ID, | ||
OC_ACCESS_TOKEN | ||
) | ||
|