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

Commit 76c55c9

Browse files
theScrabiabelgardep
authored andcommitted
add changes according to review
1 parent db478ef commit 76c55c9

File tree

4 files changed

+27
-39
lines changed

4 files changed

+27
-39
lines changed

owncloudComLibrary/build.gradle

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ dependencies {
1616
kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshiVersion"
1717

1818
testImplementation 'junit:junit:4.13'
19-
testImplementation 'org.robolectric:robolectric:4.3'
20-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
21-
androidTestImplementation 'androidx.test:runner:1.3.0'
22-
androidTestImplementation 'androidx.test:core:1.3.0'
23-
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
24-
androidTestImplementation 'androidx.test:rules:1.3.0'
2519
}
2620

2721
android {
@@ -48,10 +42,4 @@ android {
4842
sourceCompatibility JavaVersion.VERSION_1_8
4943
targetCompatibility JavaVersion.VERSION_1_8
5044
}
51-
52-
testOptions {
53-
unitTests {
54-
includeAndroidResources = true
55-
}
56-
}
5745
}

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,6 @@ class GetRemoteShareesOperation
121121
return RemoteOperationResult(method)
122122
}
123123

124-
private fun flattenResultData(jsonResults: Array<JSONArray>):ArrayList<JSONObject> {
125-
val data = ArrayList<JSONObject>() // For result data
126-
for (i in 0..jsonResults.size) {
127-
for (j in 0 until jsonResults[i].length()) {
128-
val jsonResult = jsonResults[i].getJSONObject(j)
129-
data.add(jsonResult)
130-
Timber.d("*** Added item: ${jsonResult.getString(PROPERTY_LABEL)}")
131-
}
132-
}
133-
return data
134-
}
135-
136124
private fun onRequestSuccessful(response: String?): RemoteOperationResult<ShareeOcsResponse> {
137125
val result = RemoteOperationResult<ShareeOcsResponse>(OK)
138126
Timber.d("Successful response: $response")

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,9 @@ import com.squareup.moshi.JsonClass
3232
*/
3333
@JsonClass(generateAdapter = true)
3434
data class ShareeOcsResponse(
35-
@Json(name = "exact")
3635
val exact: ExactSharees?,
37-
@Json(name = "groups")
3836
val groups: List<ShareeItem>,
39-
@Json(name = "remotes")
4037
val remotes: List<ShareeItem>,
41-
@Json(name = "users")
4238
val users: List<ShareeItem>
4339
) {
4440
fun getFlatRepresentationWithoutExact() = ArrayList<ShareeItem>().apply {
@@ -50,11 +46,8 @@ data class ShareeOcsResponse(
5046

5147
@JsonClass(generateAdapter = true)
5248
data class ExactSharees(
53-
@Json(name = "groups")
5449
val groups: List<ShareeItem>,
55-
@Json(name = "remotes")
5650
val remotes: List<ShareeItem>,
57-
@Json(name = "users")
5851
val users: List<ShareeItem>
5952
) {
6053
fun getFlatRepresentation() = ArrayList<ShareeItem>().apply {
@@ -66,17 +59,13 @@ data class ExactSharees(
6659

6760
@JsonClass(generateAdapter = true)
6861
data class ShareeItem(
69-
@Json(name = "label")
7062
val label: String,
71-
@Json(name = "value")
7263
val value: ShareeValue
7364
)
7465

7566
@JsonClass(generateAdapter = true)
7667
data class ShareeValue(
77-
@Json(name = "shareType")
7868
val shareType: Int,
79-
@Json(name = "shareWith")
8069
val shareWith: String,
8170
@Json(name = "shareWithAdditionalInfo")
8271
val additionalInfo: String?

owncloudComLibrary/src/test/java/com/owncloud/android/lib/ShareeResponseTest.kt renamed to owncloudComLibrary/src/test/java/com/owncloud/android/lib/resources/shares/responses/ShareeResponseTest.kt

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,35 @@
1-
package com.owncloud.android.lib
1+
/* ownCloud Android Library is available under MIT license
2+
* Copyright (C) 2020 ownCloud GmbH.
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
18+
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19+
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
* THE SOFTWARE.
22+
*
23+
*/
24+
25+
package com.owncloud.android.lib.resources.shares.responses
226

327
import com.owncloud.android.lib.resources.CommonOcsResponse
4-
import com.owncloud.android.lib.resources.shares.responses.ShareeOcsResponse
528
import com.squareup.moshi.JsonAdapter
629
import com.squareup.moshi.Moshi
730
import com.squareup.moshi.Types
8-
import junit.framework.Assert.assertEquals
9-
import junit.framework.Assert.assertTrue
31+
import org.junit.Assert.assertEquals
32+
import org.junit.Assert.assertTrue
1033
import org.junit.Assert.assertNotEquals
1134
import org.junit.Before
1235
import org.junit.Test

0 commit comments

Comments
 (0)