Skip to content

Commit caead87

Browse files
committed
fix(get-tags-remote-operation): tests
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
1 parent 749fdd2 commit caead87

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

library/src/androidTest/java/com/owncloud/android/lib/resources/tags/GetTagsRemoteOperationIT.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88
package com.owncloud.android.lib.resources.tags
99

10-
import com.nextcloud.operations.DeleteMethod
1110
import com.nextcloud.test.RandomStringGenerator
1211
import com.owncloud.android.AbstractIT
1312
import com.owncloud.android.lib.common.network.WebdavEntry
@@ -20,6 +19,7 @@ import junit.framework.TestCase.assertEquals
2019
import junit.framework.TestCase.assertNotNull
2120
import junit.framework.TestCase.assertTrue
2221
import org.apache.commons.httpclient.HttpStatus
22+
import org.apache.jackrabbit.webdav.client.methods.DeleteMethod
2323
import org.apache.jackrabbit.webdav.client.methods.PropPatchMethod
2424
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet
2525
import org.apache.jackrabbit.webdav.property.DavPropertySet
@@ -39,7 +39,9 @@ class GetTagsRemoteOperationIT : AbstractIT() {
3939
@After
4040
fun deleteCreatedTags() {
4141
createdTags.forEach {
42-
DeleteMethod(client.baseUri.toString() + TAG_URL + it.id, true).execute(nextcloudClient)
42+
val deleteMethod = DeleteMethod(client2.baseUri.toString() + TAG_URL + it.id)
43+
client2.executeMethod(deleteMethod)
44+
deleteMethod.releaseConnection()
4345
}
4446
createdTags.clear()
4547
}
@@ -78,7 +80,6 @@ class GetTagsRemoteOperationIT : AbstractIT() {
7880
assertTrue(sut.isSuccess)
7981
assertEquals(count + 2, sut.resultData.size)
8082

81-
// add color to one tag
8283
val plainColor = "ff00ff"
8384
val colorWithHex = "#$plainColor"
8485
val newProps = DavPropertySet()
@@ -91,11 +92,11 @@ class GetTagsRemoteOperationIT : AbstractIT() {
9192
)
9293
val propPatchMethod =
9394
PropPatchMethod(
94-
client.baseUri.toString() + TAG_URL + tag1.id,
95+
client2.baseUri.toString() + TAG_URL + tag1.id,
9596
newProps,
9697
DavPropertyNameSet()
9798
)
98-
val propPatchStatus = client.executeMethod(propPatchMethod)
99+
val propPatchStatus = client2.executeMethod(propPatchMethod)
99100
propPatchMethod.releaseConnection()
100101
assertEquals(HttpStatus.SC_MULTI_STATUS, propPatchStatus)
101102

0 commit comments

Comments
 (0)