Skip to content

Commit

Permalink
unit test bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Wenxi Zeng committed May 14, 2024
1 parent e7292fe commit 8524c54
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ class HTTPClientTests {

@Test
fun `settings connection has correct configuration`() {
httpClient.upload("api.segment.io/v1").connection.let {
httpClient.upload("api.segment.io/v1").also {
assertTrue(it.outputStream is GZIPOutputStream)
}.connection.let {
assertEquals(
"https://api.segment.io/v1/b",
it.url.toString()
Expand Down Expand Up @@ -131,12 +133,13 @@ class HTTPClientTests {
)
}

httpClient.upload("api.segment.io/v1").connection.let {
httpClient.upload("api.segment.io/v1").also {
assertFalse(it.outputStream is GZIPOutputStream)
}.connection.let {
assertEquals(
"https://api.test.com",
it.url.toString()
)
assertFalse(it.outputStream is GZIPOutputStream)
}
}

Expand All @@ -152,8 +155,6 @@ class HTTPClientTests {
}
})

httpClient.upload("api.segment.io/v1").connection.let {
assertFalse(it.outputStream is GZIPOutputStream)
}
assertFalse(httpClient.upload("api.segment.io/v1").outputStream is GZIPOutputStream)
}
}

0 comments on commit 8524c54

Please sign in to comment.