Skip to content

Commit

Permalink
Bump io.ktor:ktor-client-cio from 1.6.7 to 2.3.6 (#14)
Browse files Browse the repository at this point in the history
* Bump io.ktor:ktor-client-cio from 1.6.7 to 2.3.6

Bumps [io.ktor:ktor-client-cio](https://github.com/ktorio/ktor) from 1.6.7 to 2.3.6.
- [Release notes](https://github.com/ktorio/ktor/releases)
- [Changelog](https://github.com/ktorio/ktor/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ktorio/ktor/commits)

---
updated-dependencies:
- dependency-name: io.ktor:ktor-client-cio
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Fix errors

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Roger Viñas <[email protected]>
  • Loading branch information
dependabot[bot] and rogervinas authored Nov 7, 2023
1 parent 08d0f24 commit 82eaeb3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ In order to make the test pass 🟩 we can implement the **BarKtorClient** this
```kotlin
class BarKtorClient(private val url: String) : BarClient {

private val client = HttpClient(CIO)
private val client = HttpClient(CIO) {
expectSuccess = true
}

override fun call(name: String): String = runBlocking {
try {
Expand Down Expand Up @@ -171,7 +173,9 @@ Same as before in order to make the test pass 🟩 we can implement the **FooKto
```kotlin
class FooKtorClient(private val url: String) : FooClient {

private val client = HttpClient(CIO)
private val client = HttpClient(CIO) {
expectSuccess = true
}

override fun call(name: String): String = runBlocking {
try {
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ repositories {
dependencies {
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("io.ktor:ktor-client-core:1.6.7")
implementation("io.ktor:ktor-client-cio:1.6.7")
implementation("io.ktor:ktor-client-core:2.3.6")
implementation("io.ktor:ktor-client-cio:2.3.6")

testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
testImplementation("io.mockk:mockk:1.12.2")
Expand Down
7 changes: 5 additions & 2 deletions src/main/kotlin/com/rogervinas/wiremock/BarKtorClient.kt
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
package com.rogervinas.wiremock

import io.ktor.client.HttpClient
import io.ktor.client.call.body
import io.ktor.client.engine.cio.CIO
import io.ktor.client.request.get
import kotlinx.coroutines.runBlocking

class BarKtorClient(private val url: String) : BarClient {

private val client = HttpClient(CIO)
private val client = HttpClient(CIO) {
expectSuccess = true
}

override fun call(name: String): String = runBlocking {
try {
client.get("$url/bar/$name")
client.get("$url/bar/$name").body<String>()
} catch (e: Exception) {
"Bar api error: ${e.message}"
}
Expand Down
7 changes: 5 additions & 2 deletions src/main/kotlin/com/rogervinas/wiremock/FooKtorClient.kt
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
package com.rogervinas.wiremock

import io.ktor.client.HttpClient
import io.ktor.client.call.body
import io.ktor.client.engine.cio.CIO
import io.ktor.client.request.get
import io.ktor.client.request.parameter
import kotlinx.coroutines.runBlocking

class FooKtorClient(private val url: String) : FooClient {

private val client = HttpClient(CIO)
private val client = HttpClient(CIO) {
expectSuccess = true
}

override fun call(name: String): String = runBlocking {
try {
client.get("$url/foo") {
parameter("name", name)
}
}.body<String>()
} catch (e: Exception) {
"Foo api error: ${e.message}"
}
Expand Down

0 comments on commit 82eaeb3

Please sign in to comment.