From 1587ce1b65559e70a8890b1e097922a4184a57ad Mon Sep 17 00:00:00 2001 From: Jamie Li Date: Wed, 8 Nov 2023 13:07:47 -0800 Subject: [PATCH] Remove ReferenceServerTests in favor of Sep24Tests.kt --- .../integrationtest/ReferenceServerTests.kt | 81 +------------------ 1 file changed, 1 insertion(+), 80 deletions(-) diff --git a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/ReferenceServerTests.kt b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/ReferenceServerTests.kt index 440d09c2dd..59864af7d5 100644 --- a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/ReferenceServerTests.kt +++ b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/ReferenceServerTests.kt @@ -1,82 +1,3 @@ package org.stellar.anchor.platform.integrationtest -import io.ktor.http.* -import java.util.UUID -import kotlinx.coroutines.runBlocking -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test -import org.skyscreamer.jsonassert.JSONAssert -import org.stellar.anchor.api.callback.SendEventRequest -import org.stellar.anchor.platform.AbstractIntegrationTests -import org.stellar.anchor.platform.TestConfig -import org.stellar.anchor.platform.gson -import org.stellar.anchor.util.StringHelper.json -import org.stellar.reference.client.AnchorReferenceServerClient - -class ReferenceServerTests : AbstractIntegrationTests(TestConfig(testProfileName = "default")) { - @Test - fun `test if the reference server records the events sent by sendEvent() method`() { - val client = AnchorReferenceServerClient(Url("http://localhost:8091")) - val sendEventRequest1 = gson.fromJson(sendEventRequestJson, SendEventRequest::class.java) - val sendEventRequest2 = gson.fromJson(sendEventRequestJson2, SendEventRequest::class.java) - sendEventRequest1.id = UUID.randomUUID().toString() - sendEventRequest2.id = UUID.randomUUID().toString() - runBlocking { - // Send event1 - client.sendEvent(sendEventRequest1) - // send event2 - client.sendEvent(sendEventRequest2) - // check if these events are recorded - client - .getEvents() - .stream() - .filter { it.id == sendEventRequest1.id } - .findFirst() - .get() - .apply { JSONAssert.assertEquals(json(this), json(sendEventRequest1), true) } - client - .getEvents() - .stream() - .filter { it.id == sendEventRequest2.id } - .findFirst() - .get() - .apply { JSONAssert.assertEquals(json(this), json(sendEventRequest2), true) } - } - } - - companion object { - val sendEventRequestJson = - """ - { - "timestamp": "2011-10-05T14:48:00.000Z", - "id": "2a419880-0dde-4821-90cb-f3bfcb671ea3", - "type": "transaction_created", - "payload": { - "transaction": { - "amount_in": { - "amount": "10.0", - "asset": "USDC" - } - } - } - } - """ - .trimIndent() - - val sendEventRequestJson2 = - """ -{ - "id": "2a419880-0dde-4821-90cb-f3bfcb671ea3", - "timestamp": "2011-10-05T14:48:00.000Z", - "type": "quote_created", - "payload": { - "quote": { - "sell_amount": "10.0", - "buy_amount": "1" - } - } -} - """ - .trimIndent() - } -} +// The test is removed in favor of Sep24Tests.kt