Skip to content

Commit 3cd18d5

Browse files
committed
🐛 fix test
1 parent 25b1221 commit 3cd18d5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Mitori-Satori/src/test/kotlin/SatoriServerTest.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,28 +35,28 @@ class SatoriServerTest() {
3535
user = object : UserApiHandler {},
3636
)
3737
private val resourceHandler = object : ResourceHandler {
38-
override fun getResource(id: String): Pair<ByteArray, String> {
39-
return Pair(ByteArray(0), "")
38+
override fun getResource(id: String): ResourceHandler.Resource {
39+
return ResourceHandler.Resource(ByteArray(0), "")
4040
}
4141
}
4242

4343
private val satoriServer = SatoriServer(satoriConfig, handlerConfig, resourceHandler)
44-
val client = HttpClient()
44+
private val client = HttpClient()
4545

4646
@Test
4747
fun testRoot() {
4848
satoriServer.start()
49-
val result = runBlocking { client.get(satoriServer.baseLink) }
49+
val result = runBlocking { client.get(satoriConfig.link) }
5050
assertEquals(result.status, HttpStatusCode.OK)
51-
satoriServer.stop()
51+
satoriServer.stopBlocking()
5252
}
5353

5454
@Test
5555
fun testChannelGet() {
5656
satoriServer.start()
5757

5858
val result = runBlocking {
59-
client.post(satoriServer.baseLink + satoriServer.baseUri + "/channel.get") {
59+
client.post(satoriConfig.link + satoriConfig.path + "/channel.get") {
6060
contentType(ContentType.Application.Json)
6161
header(HttpHeaders.Authorization, "Bearer 114514")
6262
setBody(Json.encodeToString(serializer(), ChannelGet("114514")))
@@ -65,6 +65,6 @@ class SatoriServerTest() {
6565
val body = runBlocking { result.bodyAsText() }
6666
assertEquals(result.status, HttpStatusCode.OK)
6767
assertEquals(Json.decodeFromString<Channel>(body), Channel("114514", ChannelType.TEXT, "114514"))
68-
satoriServer.stop()
68+
satoriServer.stopBlocking()
6969
}
7070
}

0 commit comments

Comments
 (0)