File tree Expand file tree Collapse file tree 4 files changed +37
-4
lines changed
main/kotlin/io/github/wechaty/filebox
test/kotlin/io/github/wechaty/filebox
wechaty/src/main/kotlin/io/github/wechaty/user/manager Expand file tree Collapse file tree 4 files changed +37
-4
lines changed Original file line number Diff line number Diff line change 104104 <groupId >com.squareup.okhttp3</groupId >
105105 <artifactId >okhttp</artifactId >
106106 </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 >
108121
109122 </dependencies >
110123
Original file line number Diff line number Diff line change @@ -202,8 +202,8 @@ class FileBox(options: FileBoxOptions) {
202202
203203 FileBoxType .Url .code -> {
204204 fileBox = fromUrl(
205- jsonNode.findValue(" name " ).asText(),
206- jsonNode.findValue(" remoteUrl " ).asText()
205+ jsonNode.findValue(" remoteUrl " ).asText(),
206+ jsonNode.findValue(" name " ).asText()
207207 )
208208 }
209209
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+ }
Original file line number Diff line number Diff line change 11package io.github.wechaty.user.manager
22
3- import com.sun.xml.internal.ws.message.PayloadElementSniffer
43import io.github.wechaty.Accessory
54import io.github.wechaty.Wechaty
65import io.github.wechaty.schemas.FriendshipPayload
You can’t perform that action at this time.
0 commit comments