|
| 1 | +/* |
| 2 | + * Nextcloud - Android Client |
| 3 | + * |
| 4 | + * SPDX-FileCopyrightText: 2026 Alper Ozturk <alper.ozturk@nextcloud.com> |
| 5 | + * SPDX-License-Identifier: AGPL-3.0-or-later |
| 6 | + */ |
| 7 | + |
| 8 | +package com.owncloud.android.operations |
| 9 | + |
| 10 | +import com.owncloud.android.AbstractOnServerIT |
| 11 | +import com.owncloud.android.lib.resources.e2ee.DeleteEncryptedFilesRemoteOperation |
| 12 | +import com.owncloud.android.lib.resources.users.DeletePrivateKeyRemoteOperation |
| 13 | +import com.owncloud.android.lib.resources.users.DeletePublicKeyRemoteOperation |
| 14 | +import com.owncloud.android.lib.resources.users.GetPrivateKeyRemoteOperation |
| 15 | +import com.owncloud.android.lib.resources.users.GetPublicKeyRemoteOperation |
| 16 | +import com.owncloud.android.lib.resources.users.StorePrivateKeyRemoteOperation |
| 17 | +import org.junit.Assert.assertFalse |
| 18 | +import org.junit.Assert.assertTrue |
| 19 | +import org.junit.Test |
| 20 | + |
| 21 | +class DeleteE2ERemoteOperationIT : AbstractOnServerIT() { |
| 22 | + |
| 23 | + @Test |
| 24 | + fun testDeleteEncryptedFiles() { |
| 25 | + val sut = DeleteEncryptedFilesRemoteOperation() |
| 26 | + val result = sut.execute(nextcloudClient) |
| 27 | + assertTrue(result.isSuccess) |
| 28 | + } |
| 29 | + |
| 30 | + @Test |
| 31 | + fun testDeletePrivateKey() { |
| 32 | + StorePrivateKeyRemoteOperation("private_key").execute(nextcloudClient) |
| 33 | + |
| 34 | + val sut = DeletePrivateKeyRemoteOperation() |
| 35 | + val result = sut.execute(nextcloudClient) |
| 36 | + assertTrue(result.isSuccess) |
| 37 | + |
| 38 | + val getResult = GetPrivateKeyRemoteOperation().execute(nextcloudClient) |
| 39 | + assertFalse(getResult.isSuccess) |
| 40 | + } |
| 41 | + |
| 42 | + @Test |
| 43 | + fun testDeletePublicKey() { |
| 44 | + val sut = DeletePublicKeyRemoteOperation() |
| 45 | + val result = sut.execute(nextcloudClient) |
| 46 | + assertTrue(result.isSuccess) |
| 47 | + |
| 48 | + val getResult = GetPublicKeyRemoteOperation().execute(nextcloudClient) |
| 49 | + assertFalse(getResult.isSuccess) |
| 50 | + } |
| 51 | +} |
0 commit comments