Skip to content

Commit d4e4f90

Browse files
committed
(http): assume the provided paths are encoded and pass them as is
1 parent 9123a05 commit d4e4f90

File tree

2 files changed

+17
-1
lines changed
  • lib/stove-testing-e2e-http/src

2 files changed

+17
-1
lines changed

lib/stove-testing-e2e-http/src/main/kotlin/com/trendyol/stove/testing/e2e/http/HttpSystem.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ class HttpSystem(
221221
}
222222

223223
@PublishedApi
224-
internal fun relative(uri: String): Url = URLBuilder(testSystem.baseUrl).apply { path(uri) }.build()
224+
internal fun relative(uri: String): Url = URLBuilder(testSystem.baseUrl)
225+
.apply { appendEncodedPathSegments(uri) }.build()
225226

226227
@PublishedApi
227228
internal fun toFormData(

lib/stove-testing-e2e-http/src/test/kotlin/com/trendyol/stove/testing/e2e/http/HttpSystemTests.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,21 @@ class HttpSystemTests : FunSpec({
258258
}
259259
}
260260
}
261+
262+
test("keep path segments as is") {
263+
val expectedGetDtoName = UUID.randomUUID().toString()
264+
TestSystem.validate {
265+
wiremock {
266+
mockGet("/get?path=1", 200, responseBody = TestDto(expectedGetDtoName).some())
267+
}
268+
269+
http {
270+
get<TestDto>("/get?path=1") { actual ->
271+
actual.name shouldBe expectedGetDtoName
272+
}
273+
}
274+
}
275+
}
261276
})
262277

263278
data class TestDto(

0 commit comments

Comments
 (0)