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

Commit e769684

Browse files
committed
Reformat some webfinger classes
1 parent 70bf35f commit e769684

File tree

6 files changed

+37
-42
lines changed

6 files changed

+37
-42
lines changed

owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/webfinger/responses/WebfingerResponse.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ package com.owncloud.android.lib.resources.webfinger.responses
2727
import com.squareup.moshi.JsonClass
2828

2929
@JsonClass(generateAdapter = true)
30-
data class WebfingerJrdResponse (
31-
val subject:String,
32-
val links:List<LinkItem>
30+
data class WebfingerJrdResponse(
31+
val subject: String,
32+
val links: List<LinkItem>
3333
)
3434

3535
@JsonClass(generateAdapter = true)
3636
data class LinkItem(
37-
val href:String,
38-
val rel:String
39-
)
37+
val href: String,
38+
val rel: String
39+
)

owncloudComLibrary/src/test/java/com/owncloud/android/lib/resources/webfinger/responses/WebfingerResponseTest.kt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ import java.io.File
1111
class WebfingerResponseTest {
1212
lateinit var adapter: JsonAdapter<WebfingerJrdResponse>
1313

14-
private fun loadResponses(fileName: String) =
15-
adapter.fromJson(File(fileName).readText())
14+
private fun loadResponses(fileName: String) = adapter.fromJson(File(fileName).readText())
1615

1716
@Before
1817
fun prepare() {
@@ -21,8 +20,8 @@ class WebfingerResponseTest {
2120
}
2221

2322
@Test
24-
fun `check rel in to much information - ok - correct rell is returned`() {
25-
val response = loadResponses(TO_MUCH_INFORMATION_JSON)!!
23+
fun `check rel in too much information - ok`() {
24+
val response = loadResponses(TOO_MUCH_INFORMATION_JSON)!!
2625
Assert.assertEquals("https://gast.somedomain.de", response.links[0].href)
2726
Assert.assertEquals("http://webfinger.owncloud/rel/server-instance", response.links[0].rel)
2827
}
@@ -40,11 +39,11 @@ class WebfingerResponseTest {
4039
}
4140

4241
companion object {
43-
val RESOURCES_PATH =
42+
private const val RESOURCES_PATH =
4443
"src/test/responses/com.owncloud.android.lib.resources.webfinger.responses"
45-
val EXAMPLE_RESPONSE_JSON = "$RESOURCES_PATH/simple_response.json"
46-
val TO_MUCH_INFORMATION_JSON = "$RESOURCES_PATH/to_much_information_response.json"
47-
val BROKEN_JSON = "$RESOURCES_PATH/broken_response.json"
48-
val NOT_CONTAINING_RELEVANT_INFORMATION_JSON = "$RESOURCES_PATH/not_containing_relevant_info_response.json"
44+
private const val EXAMPLE_RESPONSE_JSON = "$RESOURCES_PATH/simple_response.json"
45+
private const val TOO_MUCH_INFORMATION_JSON = "$RESOURCES_PATH/to_much_information_response.json"
46+
private const val BROKEN_JSON = "$RESOURCES_PATH/broken_response.json"
47+
private const val NOT_CONTAINING_RELEVANT_INFORMATION_JSON = "$RESOURCES_PATH/not_containing_relevant_info_response.json"
4948
}
5049
}

owncloudComLibrary/src/test/responses/com.owncloud.android.lib.resources.webfinger.responses/not_containing_releavant_info_response.json

Lines changed: 0 additions & 10 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"subject": "acct:[email protected]",
3+
"links": [
4+
{
5+
"rel": "http://webfinger.example/rel/businesscard",
6+
"href": "https://www.example.com/~bob/bob.vcf"
7+
}
8+
]
9+
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"links": [
3-
{
4-
"href": "https://gast.somedomain.de",
5-
"rel": "http://webfinger.owncloud/rel/server-instance"
6-
}
7-
],
8-
"subject": "acct:[email protected]"
2+
"links": [
3+
{
4+
"href": "https://gast.somedomain.de",
5+
"rel": "http://webfinger.owncloud/rel/server-instance"
6+
}
7+
],
8+
"subject": "acct:[email protected]"
99
}
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,24 @@
11
{
22
"subject": "acct:[email protected]",
3-
"aliases" :
4-
[
3+
"aliases": [
54
"https://www.example.com/~bob/"
65
],
7-
"properties" :
8-
{
9-
"http://example.com/ns/role" : "employee"
6+
"properties": {
7+
"http://example.com/ns/role": "employee"
108
},
119
"gurken": {
1210
"whatever": 42
1311
},
14-
"links" :
15-
[
12+
"links": [
1613
{
1714
"gurken": "sallat",
1815
"href": "https://gast.somedomain.de",
1916
"rel": "http://webfinger.owncloud/rel/server-instance"
2017
},
2118
{
2219
"gurken": "sallat",
23-
"rel" : "http://webfinger.example/rel/businesscard",
24-
"href" : "https://www.example.com/~bob/bob.vcf"
20+
"rel": "http://webfinger.example/rel/businesscard",
21+
"href": "https://www.example.com/~bob/bob.vcf"
2522
}
2623
]
27-
}
24+
}

0 commit comments

Comments
 (0)