File tree Expand file tree Collapse file tree 3 files changed +37
-3
lines changed
main/kotlin/io/github/wechaty/filebox
test/kotlin/io/github/wechaty/filebox Expand file tree Collapse file tree 3 files changed +37
-3
lines changed Original file line number Diff line number Diff line change 104
104
<groupId >com.squareup.okhttp3</groupId >
105
105
<artifactId >okhttp</artifactId >
106
106
</dependency >
107
-
107
+ <dependency >
108
+ <groupId >org.hamcrest</groupId >
109
+ <artifactId >hamcrest-core</artifactId >
110
+ </dependency >
111
+ <dependency >
112
+ <groupId >org.mockito</groupId >
113
+ <artifactId >mockito-core</artifactId >
114
+ <scope >test</scope >
115
+ </dependency >
116
+ <dependency >
117
+ <groupId >junit</groupId >
118
+ <artifactId >junit</artifactId >
119
+ <scope >test</scope >
120
+ </dependency >
108
121
109
122
</dependencies >
110
123
Original file line number Diff line number Diff line change @@ -202,8 +202,8 @@ class FileBox(options: FileBoxOptions) {
202
202
203
203
FileBoxType .Url .code -> {
204
204
fileBox = fromUrl(
205
- jsonNode.findValue(" name " ).asText(),
206
- jsonNode.findValue(" remoteUrl " ).asText()
205
+ jsonNode.findValue(" remoteUrl " ).asText(),
206
+ jsonNode.findValue(" name " ).asText()
207
207
)
208
208
}
209
209
Original file line number Diff line number Diff line change
1
+ package io.github.wechaty.filebox
2
+
3
+ import junit.framework.Assert.assertEquals
4
+ import org.junit.Test
5
+
6
+ const val EXPECTED_FILEBOX_URL = " http://testurl"
7
+ const val EXPECTED_FILEBOX_NAME = " fileboxname"
8
+
9
+ class FileBoxTest {
10
+
11
+ @Test
12
+ fun testFileBoxFromURLShallHaveCorrectNameAndURL () {
13
+
14
+ var filebox : FileBox = FileBox .fromJson(" {\" remoteUrl\" :\" " + EXPECTED_FILEBOX_URL + " \" ," +
15
+ " \" name\" :\" " + EXPECTED_FILEBOX_NAME + " \" ," +
16
+ " \" boxType\" :2}" )
17
+
18
+ assertEquals(EXPECTED_FILEBOX_URL , filebox.remoteUrl)
19
+ assertEquals(EXPECTED_FILEBOX_NAME , filebox.name)
20
+ }
21
+ }
You can’t perform that action at this time.
0 commit comments