-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
- Loading branch information
1 parent
d6d062d
commit e08fc0d
Showing
30 changed files
with
725 additions
and
217 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
53 changes: 53 additions & 0 deletions
53
...ndroidTest/java/com/owncloud/android/lib/resources/users/GetPublicKeyRemoteOperationIT.kt
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* | ||
* Nextcloud Android client application | ||
* | ||
* @author Tobias Kaminsky | ||
* Copyright (C) 2023 Tobias Kaminsky | ||
* Copyright (C) 2023 Nextcloud GmbH | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
package com.owncloud.android.lib.resources.users | ||
|
||
import com.owncloud.android.AbstractIT | ||
import com.owncloud.android.lib.common.OwnCloudClientManagerFactory | ||
import junit.framework.TestCase.assertNotNull | ||
import junit.framework.TestCase.assertTrue | ||
import org.junit.Before | ||
import org.junit.Test | ||
|
||
class GetPublicKeyRemoteOperationIT : AbstractIT() { | ||
@Before | ||
fun init() { | ||
// E2E server app checks for official NC client with >=3.13.0, | ||
// and blocks all other clients, e.g. 3rd party apps using this lib | ||
OwnCloudClientManagerFactory.setUserAgent("Mozilla/5.0 (Android) Nextcloud-android/3.13.0") | ||
} | ||
|
||
@Test | ||
fun getKey() { | ||
var result = GetPublicKeyRemoteOperation().execute(nextcloudClient) | ||
|
||
assertTrue(result.isSuccess) | ||
assertNotNull(result.resultData) | ||
val testKey = result.resultData | ||
|
||
result = GetPublicKeyRemoteOperation("enc2").execute(nextcloudClient) | ||
|
||
assertTrue(result.isSuccess) | ||
assertNotNull(result.resultData) | ||
assertTrue(testKey.compareTo(result.resultData) != 0) | ||
} | ||
} |
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
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
Oops, something went wrong.