@@ -28,7 +28,6 @@ import com.owncloud.android.lib.resources.CommonOcsResponse
28
28
import com.squareup.moshi.JsonAdapter
29
29
import com.squareup.moshi.Moshi
30
30
import com.squareup.moshi.Types
31
- import org.junit.Assert.assertNotNull
32
31
import org.junit.Assert.assertNull
33
32
import org.junit.Assert.assertEquals
34
33
import org.junit.Assert.assertTrue
@@ -62,56 +61,15 @@ class ShareeResponseTest {
62
61
}
63
62
64
63
@Test
65
- fun `check structure - ok - contains exact` () {
66
- val response = loadResponses(EXAMPLE_RESPONSE_JSON )!!
67
- assertNotNull(response.ocs.data.exact)
68
- }
69
-
70
- @Test
71
- fun `check structure - ok - contains groups` () {
72
- val response = loadResponses(EXAMPLE_RESPONSE_JSON )!!
73
- assertNotNull(response.ocs.data.groups)
74
- }
75
-
76
- @Test
77
- fun `check structure - ok - contains remotes` () {
78
- val response = loadResponses(EXAMPLE_RESPONSE_JSON )!!
79
- assertNotNull(response.ocs.data.remotes)
80
- }
81
-
82
- @Test
83
- fun `check structure - ok - contains users` () {
84
- val response = loadResponses(EXAMPLE_RESPONSE_JSON )!!
85
- assertNotNull(response.ocs.data.users)
86
- }
87
-
88
- @Test
89
- fun `check structure - ok - groups contains two items` () {
64
+ fun `example response - ok - correct sturcture` () {
90
65
val response = loadResponses(EXAMPLE_RESPONSE_JSON )!!
91
66
assertEquals(2 , response.ocs.data.groups.size)
92
- }
93
-
94
- @Test
95
- fun `check structure - ok - users contains two items` () {
96
- val response = loadResponses(EXAMPLE_RESPONSE_JSON )!!
67
+ assertEquals(0 , response.ocs.data.remotes.size)
97
68
assertEquals(2 , response.ocs.data.users.size)
98
- }
99
-
100
- @Test
101
- fun `check structure - ok - exact_users contains one item` () {
102
- val response = loadResponses(EXAMPLE_RESPONSE_JSON )!!
69
+ assertEquals(0 , response.ocs.data.exact?.groups?.size)
70
+ assertEquals(0 , response.ocs.data.exact?.remotes?.size)
103
71
assertEquals(1 , response.ocs.data.exact?.users?.size)
104
- }
105
-
106
- @Test
107
- fun `check structure - ok - user1 contains additional data` () {
108
- val response = loadResponses(EXAMPLE_RESPONSE_JSON )!!
109
72
assertEquals(
" [email protected] " , response.ocs.data.users.get(
0 ).value.additionalInfo)
110
- }
111
-
112
- @Test
113
- fun `check structure - ok - user2 does not contain additional data` () {
114
- val response = loadResponses(EXAMPLE_RESPONSE_JSON )!!
115
73
assertNull(response.ocs.data.users[1 ].value.additionalInfo)
116
74
}
117
75
0 commit comments