From fdc2539e8e50871ba0aed0676c3e32fa8e03dd39 Mon Sep 17 00:00:00 2001 From: "justin.fiedler" Date: Mon, 13 Nov 2023 21:32:15 +0000 Subject: [PATCH] chore: code clean up from PR feedback --- .../com/amplitude/core/utilities/HttpClientTest.kt | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/core/src/test/kotlin/com/amplitude/core/utilities/HttpClientTest.kt b/core/src/test/kotlin/com/amplitude/core/utilities/HttpClientTest.kt index 9da1c652..191bf1a5 100644 --- a/core/src/test/kotlin/com/amplitude/core/utilities/HttpClientTest.kt +++ b/core/src/test/kotlin/com/amplitude/core/utilities/HttpClientTest.kt @@ -50,17 +50,14 @@ class HttpClientTest { every { httpClient.getCurrentTimeMillis() } returns clientUploadTimeMillis val connection = httpClient.upload() - System.currentTimeMillis() - connection.outputStream?.let { connection.setEvents(JSONUtil.eventsToString(listOf(event))) // Upload the payloads. connection.close() } - val request: RecordedRequest? = runRequest() - val body = request?.body?.readUtf8() - val result = JSONObject(body) + val request = runRequest() + val result = JSONObject(request?.body?.readUtf8()) assertEquals(apiKey, result.getString("api_key")) assertEquals(clientUploadTimeString, result.getString("client_upload_time")) @@ -82,17 +79,14 @@ class HttpClientTest { every { httpClient.getCurrentTimeMillis() } returns clientUploadTimeMillis val connection = httpClient.upload() - System.currentTimeMillis() - connection.outputStream?.let { connection.setEvents(JSONUtil.eventsToString(listOf(event))) // Upload the payloads. connection.close() } - val request: RecordedRequest? = runRequest() - val body = request?.body?.readUtf8() - val result = JSONObject(body) + val request = runRequest() + val result = JSONObject(request?.body?.readUtf8()) assertEquals(apiKey, result.getString("api_key")) assertEquals(clientUploadTimeString, result.getString("client_upload_time"))