We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1bd92ea commit b7b342dCopy full SHA for b7b342d
ktor-client/ktor-client-mock/common/test/MockEngineTest.kt
@@ -0,0 +1,30 @@
1
+import io.ktor.client.*
2
+import io.ktor.client.engine.mock.*
3
+import io.ktor.client.request.*
4
+import io.ktor.http.*
5
+import kotlin.test.*
6
+
7
+/*
8
+ * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
9
+ */
10
11
+class MockEngineTest {
12
13
+ @Test
14
+ fun testHistoryIteration() {
15
+ val client = HttpClient(MockEngine) {
16
+ engine {
17
+ addHandler {
18
+ respond("Test")
19
+ }
20
21
22
+ val engine = client.engine as MockEngine
23
+ val count = engine.requestHistory
24
+ .map(HttpRequestData::url)
25
+ .map(Url::toString)
26
+ .count()
27
28
+ assertEquals(0, count)
29
30
+}
0 commit comments