Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 90b6ff5

Browse files
theScrabiabelgardep
authored andcommitted
add aditional data field to ocs sharees
1 parent 26def4f commit 90b6ff5

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/shares/responses/ShareeResponse.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,7 @@ data class ShareeValue(
9191
@Json(name = "shareType")
9292
val shareType: Int?,
9393
@Json(name = "shareWith")
94-
val shareWith: String?
94+
val shareWith: String?,
95+
@Json(name ="shareWithAdditionalInfo")
96+
val additionalInfo: String?
9597
)

owncloudComLibrary/src/test/java/com/owncloud/android/lib/ShareeResponseTest.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ class ShareeResponseTest {
6868
assertEquals(1, response?.ocs?.data?.exact?.users?.size)
6969
}
7070

71+
@Test
72+
fun `check structure - ok - user1 contains additional data`() {
73+
assertEquals("[email protected]", response?.ocs?.data?.users?.get(0)?.value?.additionalInfo)
74+
}
75+
76+
@Test
77+
fun `check structure - ok - user2 does not contain additional data`() {
78+
assertEquals(null, response!!.ocs.data.users!![1].value!!.additionalInfo)
79+
}
80+
7181
companion object {
7282
val EXAMPLE_RESPONSE = """
7383
{
@@ -108,7 +118,8 @@ class ShareeResponseTest {
108118
"label": "user1",
109119
"value": {
110120
"shareType": 0,
111-
"shareWith": "user1"
121+
"shareWith": "user1",
122+
"shareWithAdditionalInfo": "[email protected]"
112123
}
113124
},
114125
{

0 commit comments

Comments
 (0)