From 8524c54c0c4119b9b839f0376d9f1b9c524873b7 Mon Sep 17 00:00:00 2001 From: Wenxi Zeng Date: Tue, 14 May 2024 17:15:46 -0500 Subject: [PATCH] unit test bug fix --- .../analytics/kotlin/core/HTTPClientTests.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/src/test/kotlin/com/segment/analytics/kotlin/core/HTTPClientTests.kt b/core/src/test/kotlin/com/segment/analytics/kotlin/core/HTTPClientTests.kt index 493a9462..2d05a083 100644 --- a/core/src/test/kotlin/com/segment/analytics/kotlin/core/HTTPClientTests.kt +++ b/core/src/test/kotlin/com/segment/analytics/kotlin/core/HTTPClientTests.kt @@ -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() @@ -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) } } @@ -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) } } \ No newline at end of file