Skip to content

Commit 6e8f46a

Browse files
committed
add tests
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
1 parent b51c73e commit 6e8f46a

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

app/src/androidTest/java/com/owncloud/android/operations/DeleteE2ERemoteOperationIT.kt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import com.owncloud.android.lib.resources.users.DeletePublicKeyRemoteOperation
1414
import com.owncloud.android.lib.resources.users.GetPrivateKeyRemoteOperation
1515
import com.owncloud.android.lib.resources.users.GetPublicKeyRemoteOperation
1616
import com.owncloud.android.lib.resources.users.StorePrivateKeyRemoteOperation
17+
import com.owncloud.android.utils.EncryptionUtils
18+
import com.owncloud.android.utils.crypto.CryptoHelper
1719
import org.junit.Assert.assertFalse
1820
import org.junit.Assert.assertTrue
1921
import org.junit.Test
@@ -29,7 +31,17 @@ class DeleteE2ERemoteOperationIT : AbstractOnServerIT() {
2931

3032
@Test
3133
fun testDeletePrivateKey() {
32-
StorePrivateKeyRemoteOperation("private_key").execute(nextcloudClient)
34+
val keyPair = EncryptionUtils.generateKeyPair()
35+
val privateKey = keyPair.private
36+
val keyPhrase = "moreovertelevisionfactorytendencyindependenceinternationalintellectualimpress" +
37+
"interestvolunteer"
38+
val privatePemKeyString = EncryptionUtils.privateKeyToPEM(privateKey)
39+
val encryptedPrivateKey = CryptoHelper.encryptPrivateKey(
40+
privatePemKeyString,
41+
keyPhrase
42+
)
43+
44+
StorePrivateKeyRemoteOperation(encryptedPrivateKey).execute(nextcloudClient)
3345

3446
val sut = DeletePrivateKeyRemoteOperation()
3547
val result = sut.execute(nextcloudClient)

gradle/verification-metadata.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21094,6 +21094,14 @@
2109421094
<sha256 value="69722898d31a3a5ad32cc372f2a14a057902c75bd14019570cbfc221a67fc52c" origin="Generated by Gradle" reason="Artifact is not signed"/>
2109521095
</artifact>
2109621096
</component>
21097+
<component group="com.github.nextcloud" name="android-library" version="3c4d9d6">
21098+
<artifact name="android-library-3c4d9d6.aar">
21099+
<sha256 value="24093678fe62d18725875dba92603e92e47013844b7d67cb5c83116f78af65c4" origin="Generated by Gradle" reason="Artifact is not signed"/>
21100+
</artifact>
21101+
<artifact name="android-library-3c4d9d6.module">
21102+
<sha256 value="9e53f9f1a8a4c84165d8f408febe67c80a0591791730ef70ea97ba60d1eb586d" origin="Generated by Gradle" reason="Artifact is not signed"/>
21103+
</artifact>
21104+
</component>
2109721105
<component group="com.github.nextcloud" name="android-library" version="3d422b28376339c0fbd772e480dbbdc56b7ae1a1">
2109821106
<artifact name="android-library-3d422b28376339c0fbd772e480dbbdc56b7ae1a1.aar">
2109921107
<sha256 value="58debdb6fecf8f254f38bed011ea4849405017679c7978755e2a004031b3f69e" origin="Generated by Gradle" reason="Artifact is not signed"/>

0 commit comments

Comments
 (0)