diff --git a/essential-tests/build.gradle.kts b/essential-tests/build.gradle.kts index 965e233514..120ec414aa 100644 --- a/essential-tests/build.gradle.kts +++ b/essential-tests/build.gradle.kts @@ -31,6 +31,8 @@ dependencies { testFixturesImplementation(project(":wallet-reference-server")) testFixturesImplementation(project(":service-runner")) testFixturesImplementation(project(":lib-util")) + + testImplementation(libs.stellar.wallet.sdk) } tasks { bootJar { enabled = false } } diff --git a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/ReferenceServerTests.kt b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/ReferenceServerTests.kt deleted file mode 100644 index 24da521647..0000000000 --- a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/ReferenceServerTests.kt +++ /dev/null @@ -1,75 +0,0 @@ -package org.stellar.anchor.integrationtest - -import io.ktor.http.* -import kotlinx.coroutines.runBlocking -import org.junit.jupiter.api.Assertions -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test -import org.skyscreamer.jsonassert.JSONAssert -import org.stellar.anchor.AbstractIntegrationTests -import org.stellar.anchor.api.callback.SendEventRequest -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) - runBlocking { - // Send event1 - client.sendEvent(sendEventRequest1) - var latestEvent = client.getLatestEvent() - Assertions.assertNotNull(latestEvent) - JSONAssert.assertEquals(json(latestEvent), json(sendEventRequest1), true) - // send event2 - client.sendEvent(sendEventRequest2) - latestEvent = client.getLatestEvent() - Assertions.assertNotNull(latestEvent) - JSONAssert.assertEquals(json(latestEvent), json(sendEventRequest2), true) - // check if there are totally two events recorded - assertEquals(client.getEvents().size, 2) - JSONAssert.assertEquals(json(client.getEvents()[0]), json(sendEventRequest1), true) - JSONAssert.assertEquals(json(client.getEvents()[1]), 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() - } -} diff --git a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/AbstractIntegrationTests.kt b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/AbstractIntegrationTests.kt similarity index 86% rename from essential-tests/src/testFixtures/kotlin/org/stellar/anchor/AbstractIntegrationTests.kt rename to essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/AbstractIntegrationTests.kt index 3fa21ae6fc..be2855b0f0 100644 --- a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/AbstractIntegrationTests.kt +++ b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/AbstractIntegrationTests.kt @@ -1,11 +1,8 @@ -package org.stellar.anchor +package org.stellar.anchor.platform import io.ktor.client.plugins.* import io.ktor.http.* import kotlinx.coroutines.runBlocking -import org.stellar.anchor.client.* -import org.stellar.anchor.platform.TestConfig -import org.stellar.anchor.platform.resourceAsString import org.stellar.anchor.util.Sep1Helper.TomlContent import org.stellar.anchor.util.Sep1Helper.parse import org.stellar.walletsdk.ApplicationConfiguration diff --git a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/TestAccounts.kt b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/TestAccounts.kt similarity index 91% rename from essential-tests/src/testFixtures/kotlin/org/stellar/anchor/TestAccounts.kt rename to essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/TestAccounts.kt index da92036cc4..34bd8527d4 100644 --- a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/TestAccounts.kt +++ b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/TestAccounts.kt @@ -1,4 +1,4 @@ -package org.stellar.anchor +package org.stellar.anchor.platform var CLIENT_WALLET_SECRET = "SBHTWEF5U7FK53FLGDMBQYGXRUJ24VBM3M6VDXCHRIGCRG3Z64PH45LW" var CLIENT_WALLET_ACCOUNT = "GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG" diff --git a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/e2etest/Sep24End2EndTests.kt b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/e2etest/Sep24End2EndTests.kt similarity index 98% rename from essential-tests/src/testFixtures/kotlin/org/stellar/anchor/e2etest/Sep24End2EndTests.kt rename to essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/e2etest/Sep24End2EndTests.kt index 03c1d1edd5..922a0be05f 100644 --- a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/e2etest/Sep24End2EndTests.kt +++ b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/e2etest/Sep24End2EndTests.kt @@ -1,4 +1,4 @@ -package org.stellar.anchor.e2etest +package org.stellar.anchor.platform.e2etest import io.ktor.client.* import io.ktor.client.plugins.* @@ -22,8 +22,6 @@ import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.Arguments import org.junit.jupiter.params.provider.MethodSource import org.springframework.web.util.UriComponentsBuilder -import org.stellar.anchor.AbstractIntegrationTests -import org.stellar.anchor.CLIENT_WALLET_SECRET import org.stellar.anchor.api.callback.SendEventRequest import org.stellar.anchor.api.callback.SendEventRequestPayload import org.stellar.anchor.api.event.AnchorEvent @@ -33,6 +31,8 @@ import org.stellar.anchor.api.sep.SepTransactionStatus import org.stellar.anchor.api.sep.sep24.Sep24GetTransactionResponse import org.stellar.anchor.auth.JwtService import org.stellar.anchor.auth.Sep24InteractiveUrlJwt +import org.stellar.anchor.platform.AbstractIntegrationTests +import org.stellar.anchor.platform.CLIENT_WALLET_SECRET import org.stellar.anchor.platform.TestConfig import org.stellar.anchor.util.Log.info import org.stellar.reference.client.AnchorReferenceServerClient diff --git a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/e2etest/Sep6End2EndTest.kt b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/e2etest/Sep6End2EndTest.kt similarity index 98% rename from essential-tests/src/testFixtures/kotlin/org/stellar/anchor/e2etest/Sep6End2EndTest.kt rename to essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/e2etest/Sep6End2EndTest.kt index d4c75e9c34..09e504ff3a 100644 --- a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/e2etest/Sep6End2EndTest.kt +++ b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/e2etest/Sep6End2EndTest.kt @@ -1,4 +1,4 @@ -package org.stellar.anchor.e2etest +package org.stellar.anchor.platform.e2etest import io.ktor.http.* import kotlin.test.DefaultAsserter.fail @@ -9,12 +9,12 @@ import kotlinx.coroutines.delay import kotlinx.coroutines.runBlocking import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test -import org.stellar.anchor.AbstractIntegrationTests import org.stellar.anchor.api.sep.SepTransactionStatus import org.stellar.anchor.api.sep.SepTransactionStatus.* import org.stellar.anchor.api.sep.sep6.GetTransactionResponse import org.stellar.anchor.api.shared.InstructionField import org.stellar.anchor.client.Sep6Client +import org.stellar.anchor.platform.AbstractIntegrationTests import org.stellar.anchor.platform.TestConfig import org.stellar.anchor.util.GsonUtils import org.stellar.anchor.util.Log diff --git a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/CallbackApiTests.kt b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/CallbackApiTests.kt similarity index 95% rename from essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/CallbackApiTests.kt rename to essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/CallbackApiTests.kt index 99d694552c..1e37ed2fcd 100644 --- a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/CallbackApiTests.kt +++ b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/CallbackApiTests.kt @@ -1,4 +1,4 @@ -package org.stellar.anchor.integrationtest +package org.stellar.anchor.platform.integrationtest import com.google.gson.Gson import java.time.Instant @@ -13,7 +13,6 @@ import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.parallel.Execution import org.junit.jupiter.api.parallel.ExecutionMode import org.skyscreamer.jsonassert.JSONAssert -import org.stellar.anchor.AbstractIntegrationTests import org.stellar.anchor.api.callback.GetCustomerRequest import org.stellar.anchor.api.callback.GetFeeRequest import org.stellar.anchor.api.callback.GetRateRequest @@ -22,12 +21,13 @@ import org.stellar.anchor.api.sep.sep12.Sep12PutCustomerRequest import org.stellar.anchor.auth.AuthHelper import org.stellar.anchor.auth.JwtService import org.stellar.anchor.client.Sep12Client -import org.stellar.anchor.integrationtest.Sep12Tests.Companion.testCustomer1Json -import org.stellar.anchor.integrationtest.Sep12Tests.Companion.testCustomer2Json +import org.stellar.anchor.platform.AbstractIntegrationTests import org.stellar.anchor.platform.TestConfig import org.stellar.anchor.platform.callback.RestCustomerIntegration import org.stellar.anchor.platform.callback.RestFeeIntegration import org.stellar.anchor.platform.callback.RestRateIntegration +import org.stellar.anchor.platform.integrationtest.Sep12Tests.Companion.testCustomer1Json +import org.stellar.anchor.platform.integrationtest.Sep12Tests.Companion.testCustomer2Json import org.stellar.anchor.util.GsonUtils @TestInstance(TestInstance.Lifecycle.PER_CLASS) diff --git a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/CallbackSignatureTest.kt b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/CallbackSignatureTest.kt similarity index 95% rename from essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/CallbackSignatureTest.kt rename to essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/CallbackSignatureTest.kt index 6e594508d1..e057b97a8c 100644 --- a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/CallbackSignatureTest.kt +++ b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/CallbackSignatureTest.kt @@ -1,4 +1,4 @@ -package org.stellar.anchor.integrationtest +package org.stellar.anchor.platform.integrationtest import org.junit.jupiter.api.Assertions.assertFalse import org.junit.jupiter.api.Assertions.assertTrue diff --git a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/EventProcessingTests.kt b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/EventProcessingTests.kt similarity index 94% rename from essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/EventProcessingTests.kt rename to essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/EventProcessingTests.kt index fe1df7cebf..89ffac5bd4 100644 --- a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/EventProcessingTests.kt +++ b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/EventProcessingTests.kt @@ -1,9 +1,9 @@ -package org.stellar.anchor.integrationtest +package org.stellar.anchor.platform.integrationtest import org.junit.jupiter.api.Test -import org.stellar.anchor.AbstractIntegrationTests import org.stellar.anchor.api.event.AnchorEvent import org.stellar.anchor.event.EventService.EventQueue.TRANSACTION +import org.stellar.anchor.platform.AbstractIntegrationTests import org.stellar.anchor.platform.TestConfig import org.stellar.anchor.platform.config.PropertyEventConfig import org.stellar.anchor.platform.event.DefaultEventService diff --git a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/PlatformApiTests.kt b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/PlatformApiTests.kt similarity index 99% rename from essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/PlatformApiTests.kt rename to essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/PlatformApiTests.kt index ace8fe6240..faac53a631 100644 --- a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/PlatformApiTests.kt +++ b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/PlatformApiTests.kt @@ -1,4 +1,4 @@ -package org.stellar.anchor.integrationtest +package org.stellar.anchor.platform.integrationtest import com.google.gson.reflect.TypeToken import org.apache.http.HttpStatus.SC_OK @@ -8,7 +8,6 @@ import org.skyscreamer.jsonassert.Customization import org.skyscreamer.jsonassert.JSONAssert import org.skyscreamer.jsonassert.JSONCompareMode import org.skyscreamer.jsonassert.comparator.CustomComparator -import org.stellar.anchor.AbstractIntegrationTests import org.stellar.anchor.api.rpc.RpcRequest import org.stellar.anchor.api.rpc.method.NotifyOffchainFundsReceivedRequest import org.stellar.anchor.api.rpc.method.RequestOffchainFundsRequest @@ -22,6 +21,7 @@ import org.stellar.anchor.auth.AuthHelper import org.stellar.anchor.client.Sep12Client import org.stellar.anchor.client.Sep24Client import org.stellar.anchor.client.Sep31Client +import org.stellar.anchor.platform.AbstractIntegrationTests import org.stellar.anchor.platform.TestConfig import org.stellar.anchor.util.GsonUtils 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 new file mode 100644 index 0000000000..59864af7d5 --- /dev/null +++ b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/ReferenceServerTests.kt @@ -0,0 +1,3 @@ +package org.stellar.anchor.platform.integrationtest + +// The test is removed in favor of Sep24Tests.kt diff --git a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/Sep10Tests.kt b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/Sep10Tests.kt similarity index 92% rename from essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/Sep10Tests.kt rename to essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/Sep10Tests.kt index e2905999b8..ac05b3bc56 100644 --- a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/Sep10Tests.kt +++ b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/Sep10Tests.kt @@ -1,12 +1,11 @@ -package org.stellar.anchor.integrationtest +package org.stellar.anchor.platform.integrationtest import kotlin.test.assertFailsWith import org.junit.jupiter.api.Test -import org.stellar.anchor.* import org.stellar.anchor.api.exception.SepNotAuthorizedException import org.stellar.anchor.api.sep.sep10.ValidationRequest import org.stellar.anchor.client.Sep10Client -import org.stellar.anchor.platform.TestConfig +import org.stellar.anchor.platform.* class Sep10Tests : AbstractIntegrationTests(TestConfig(testProfileName = "default")) { lateinit var sep10Client: Sep10Client diff --git a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/Sep12Tests.kt b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/Sep12Tests.kt similarity index 96% rename from essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/Sep12Tests.kt rename to essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/Sep12Tests.kt index caf1cb1f6b..f77f8df25e 100644 --- a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/Sep12Tests.kt +++ b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/Sep12Tests.kt @@ -1,4 +1,4 @@ -package org.stellar.anchor.integrationtest +package org.stellar.anchor.platform.integrationtest import io.ktor.client.plugins.* import kotlinx.coroutines.runBlocking @@ -6,8 +6,8 @@ import kotlinx.serialization.json.Json import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows -import org.stellar.anchor.AbstractIntegrationTests import org.stellar.anchor.api.sep.sep12.Sep12Status +import org.stellar.anchor.platform.AbstractIntegrationTests import org.stellar.anchor.platform.TestConfig import org.stellar.anchor.platform.printRequest import org.stellar.anchor.platform.printResponse diff --git a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/Sep24Tests.kt b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/Sep24Tests.kt similarity index 99% rename from essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/Sep24Tests.kt rename to essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/Sep24Tests.kt index 664812b522..b58c477b97 100644 --- a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/Sep24Tests.kt +++ b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/Sep24Tests.kt @@ -1,4 +1,4 @@ -package org.stellar.anchor.integrationtest +package org.stellar.anchor.platform.integrationtest import com.google.gson.reflect.TypeToken import kotlinx.coroutines.runBlocking @@ -13,7 +13,6 @@ import org.junit.jupiter.api.parallel.ExecutionMode.SAME_THREAD import org.skyscreamer.jsonassert.JSONAssert import org.skyscreamer.jsonassert.JSONCompareMode import org.springframework.web.util.UriComponentsBuilder -import org.stellar.anchor.AbstractIntegrationTests import org.stellar.anchor.api.exception.SepException import org.stellar.anchor.api.platform.PatchTransactionsRequest import org.stellar.anchor.apiclient.PlatformApiClient @@ -21,6 +20,7 @@ import org.stellar.anchor.auth.AuthHelper import org.stellar.anchor.auth.JwtService import org.stellar.anchor.auth.Sep24InteractiveUrlJwt import org.stellar.anchor.auth.Sep24MoreInfoUrlJwt +import org.stellar.anchor.platform.AbstractIntegrationTests import org.stellar.anchor.platform.TestConfig import org.stellar.anchor.platform.gson import org.stellar.anchor.platform.printRequest diff --git a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/Sep31Tests.kt b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/Sep31Tests.kt similarity index 98% rename from essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/Sep31Tests.kt rename to essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/Sep31Tests.kt index 3705828ef7..9461c16d54 100644 --- a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/Sep31Tests.kt +++ b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/Sep31Tests.kt @@ -1,4 +1,4 @@ -package org.stellar.anchor.integrationtest +package org.stellar.anchor.platform.integrationtest import java.time.Instant import kotlin.streams.toList @@ -11,7 +11,6 @@ import org.skyscreamer.jsonassert.JSONCompareMode import org.skyscreamer.jsonassert.JSONCompareMode.LENIENT import org.springframework.data.domain.Sort.Direction import org.springframework.data.domain.Sort.Direction.* -import org.stellar.anchor.AbstractIntegrationTests import org.stellar.anchor.api.exception.SepException import org.stellar.anchor.api.platform.* import org.stellar.anchor.api.platform.PlatformTransactionData.Sep.SEP_31 @@ -27,10 +26,11 @@ import org.stellar.anchor.api.sep.sep31.Sep31PostTransactionResponse import org.stellar.anchor.apiclient.PlatformApiClient import org.stellar.anchor.auth.AuthHelper import org.stellar.anchor.client.* -import org.stellar.anchor.integrationtest.Sep12Tests.Companion.testCustomer1Json -import org.stellar.anchor.integrationtest.Sep12Tests.Companion.testCustomer2Json +import org.stellar.anchor.platform.AbstractIntegrationTests import org.stellar.anchor.platform.TestConfig import org.stellar.anchor.platform.gson +import org.stellar.anchor.platform.integrationtest.Sep12Tests.Companion.testCustomer1Json +import org.stellar.anchor.platform.integrationtest.Sep12Tests.Companion.testCustomer2Json import org.stellar.anchor.platform.printRequest import org.stellar.anchor.util.GsonUtils import org.stellar.anchor.util.StringHelper.json diff --git a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/Sep38Tests.kt b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/Sep38Tests.kt similarity index 95% rename from essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/Sep38Tests.kt rename to essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/Sep38Tests.kt index defdaa5308..0e03e4c712 100644 --- a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/Sep38Tests.kt +++ b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/Sep38Tests.kt @@ -1,14 +1,14 @@ -package org.stellar.anchor.integrationtest +package org.stellar.anchor.platform.integrationtest import java.time.Instant import java.time.format.DateTimeFormatter import kotlin.test.assertEquals import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows -import org.stellar.anchor.AbstractIntegrationTests import org.stellar.anchor.api.exception.SepException import org.stellar.anchor.api.sep.sep38.Sep38Context.SEP31 import org.stellar.anchor.client.Sep38Client +import org.stellar.anchor.platform.AbstractIntegrationTests import org.stellar.anchor.platform.TestConfig import org.stellar.anchor.platform.printRequest import org.stellar.anchor.platform.printResponse diff --git a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/Sep6Tests.kt b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/Sep6Tests.kt similarity index 98% rename from essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/Sep6Tests.kt rename to essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/Sep6Tests.kt index e2e894ab6e..52ffb84692 100644 --- a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/Sep6Tests.kt +++ b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/Sep6Tests.kt @@ -1,13 +1,13 @@ -package org.stellar.anchor.integrationtest +package org.stellar.anchor.platform.integrationtest import org.junit.jupiter.api.Test import org.skyscreamer.jsonassert.JSONAssert import org.skyscreamer.jsonassert.JSONCompareMode -import org.stellar.anchor.AbstractIntegrationTests -import org.stellar.anchor.CLIENT_WALLET_ACCOUNT import org.stellar.anchor.api.sep.sep38.Sep38Context import org.stellar.anchor.client.Sep38Client import org.stellar.anchor.client.Sep6Client +import org.stellar.anchor.platform.AbstractIntegrationTests +import org.stellar.anchor.platform.CLIENT_WALLET_ACCOUNT import org.stellar.anchor.platform.TestConfig import org.stellar.anchor.platform.gson import org.stellar.anchor.util.Log diff --git a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/ServerHealthTests.kt b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/ServerHealthTests.kt similarity index 94% rename from essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/ServerHealthTests.kt rename to essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/ServerHealthTests.kt index 79a44e5d0b..2d2cacbe30 100644 --- a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/ServerHealthTests.kt +++ b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/ServerHealthTests.kt @@ -1,4 +1,4 @@ -package org.stellar.anchor.integrationtest +package org.stellar.anchor.platform.integrationtest import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test diff --git a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/StellarObserverTests.kt b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/StellarObserverTests.kt similarity index 95% rename from essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/StellarObserverTests.kt rename to essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/StellarObserverTests.kt index bf8916c809..4f3d070ae4 100644 --- a/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/integrationtest/StellarObserverTests.kt +++ b/essential-tests/src/testFixtures/kotlin/org/stellar/anchor/platform/integrationtest/StellarObserverTests.kt @@ -1,11 +1,11 @@ -package org.stellar.anchor.integrationtest +package org.stellar.anchor.platform.integrationtest import java.util.concurrent.TimeUnit import okhttp3.OkHttpClient import okhttp3.Request import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test -import org.stellar.anchor.AbstractIntegrationTests +import org.stellar.anchor.platform.AbstractIntegrationTests import org.stellar.anchor.platform.TestConfig import org.stellar.anchor.platform.gson diff --git a/extended-tests/src/test/kotlin/org/stellar/anchor/platform/AbstractIntegrationTest.kt b/extended-tests/src/test/kotlin/org/stellar/anchor/platform/AbstractIntegrationTest.kt index 68d1615fb5..9856b1cb43 100644 --- a/extended-tests/src/test/kotlin/org/stellar/anchor/platform/AbstractIntegrationTest.kt +++ b/extended-tests/src/test/kotlin/org/stellar/anchor/platform/AbstractIntegrationTest.kt @@ -3,7 +3,6 @@ package org.stellar.anchor.platform import io.ktor.client.plugins.* import io.ktor.http.* import kotlinx.coroutines.runBlocking -import org.stellar.anchor.CLIENT_WALLET_SECRET import org.stellar.anchor.platform.test.* import org.stellar.anchor.util.Sep1Helper import org.stellar.walletsdk.ApplicationConfiguration diff --git a/extended-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep24CustodyEnd2EndTests.kt b/extended-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep24CustodyEnd2EndTests.kt index 8bc53853d7..43c5d6853f 100644 --- a/extended-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep24CustodyEnd2EndTests.kt +++ b/extended-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep24CustodyEnd2EndTests.kt @@ -12,7 +12,6 @@ import kotlinx.coroutines.runBlocking import org.assertj.core.api.Assertions import org.junit.jupiter.api.Assertions.assertNotNull import org.springframework.web.util.UriComponentsBuilder -import org.stellar.anchor.CLIENT_WALLET_SECRET import org.stellar.anchor.api.callback.SendEventRequest import org.stellar.anchor.api.callback.SendEventRequestPayload import org.stellar.anchor.api.event.AnchorEvent @@ -22,6 +21,7 @@ import org.stellar.anchor.api.sep.SepTransactionStatus import org.stellar.anchor.api.sep.sep24.Sep24GetTransactionResponse import org.stellar.anchor.auth.JwtService import org.stellar.anchor.auth.Sep24InteractiveUrlJwt +import org.stellar.anchor.platform.CLIENT_WALLET_SECRET import org.stellar.anchor.platform.TestConfig import org.stellar.anchor.util.Log.info import org.stellar.reference.client.AnchorReferenceServerClient diff --git a/extended-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep24CustodyRpcEnd2EndTests.kt b/extended-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep24CustodyRpcEnd2EndTests.kt index 48dafe4300..6f8b5b233c 100644 --- a/extended-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep24CustodyRpcEnd2EndTests.kt +++ b/extended-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep24CustodyRpcEnd2EndTests.kt @@ -12,7 +12,6 @@ import kotlinx.coroutines.runBlocking import org.assertj.core.api.Assertions import org.junit.jupiter.api.Assertions.assertNotNull import org.springframework.web.util.UriComponentsBuilder -import org.stellar.anchor.CLIENT_WALLET_SECRET import org.stellar.anchor.api.callback.SendEventRequest import org.stellar.anchor.api.callback.SendEventRequestPayload import org.stellar.anchor.api.event.AnchorEvent @@ -22,6 +21,7 @@ import org.stellar.anchor.api.sep.SepTransactionStatus import org.stellar.anchor.api.sep.sep24.Sep24GetTransactionResponse import org.stellar.anchor.auth.JwtService import org.stellar.anchor.auth.Sep24InteractiveUrlJwt +import org.stellar.anchor.platform.CLIENT_WALLET_SECRET import org.stellar.anchor.platform.TestConfig import org.stellar.anchor.util.Log.info import org.stellar.reference.client.AnchorReferenceServerClient diff --git a/extended-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep24RpcEnd2EndTests.kt b/extended-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep24RpcEnd2EndTests.kt index b49f35d27e..c251687961 100644 --- a/extended-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep24RpcEnd2EndTests.kt +++ b/extended-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep24RpcEnd2EndTests.kt @@ -13,7 +13,6 @@ import org.assertj.core.api.Assertions import org.junit.jupiter.api.Assertions.assertNotNull import org.junit.jupiter.api.Assertions.assertTrue import org.springframework.web.util.UriComponentsBuilder -import org.stellar.anchor.CLIENT_WALLET_SECRET import org.stellar.anchor.api.callback.SendEventRequest import org.stellar.anchor.api.callback.SendEventRequestPayload import org.stellar.anchor.api.event.AnchorEvent @@ -23,6 +22,7 @@ import org.stellar.anchor.api.sep.SepTransactionStatus import org.stellar.anchor.api.sep.sep24.Sep24GetTransactionResponse import org.stellar.anchor.auth.JwtService import org.stellar.anchor.auth.Sep24InteractiveUrlJwt +import org.stellar.anchor.platform.CLIENT_WALLET_SECRET import org.stellar.anchor.platform.TestConfig import org.stellar.anchor.util.Log.info import org.stellar.reference.client.AnchorReferenceServerClient diff --git a/extended-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep31CustodyRpcEnd2EndTests.kt b/extended-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep31CustodyRpcEnd2EndTests.kt index e8552b8660..774d9c044b 100644 --- a/extended-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep31CustodyRpcEnd2EndTests.kt +++ b/extended-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep31CustodyRpcEnd2EndTests.kt @@ -9,7 +9,6 @@ import kotlinx.coroutines.delay import kotlinx.coroutines.runBlocking import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Assertions.assertNotNull -import org.stellar.anchor.CLIENT_WALLET_SECRET import org.stellar.anchor.api.callback.SendEventRequest import org.stellar.anchor.api.callback.SendEventRequestPayload import org.stellar.anchor.api.event.AnchorEvent @@ -24,9 +23,10 @@ import org.stellar.anchor.auth.AuthHelper import org.stellar.anchor.client.Sep12Client import org.stellar.anchor.client.Sep31Client import org.stellar.anchor.client.Sep38Client -import org.stellar.anchor.integrationtest.Sep12Tests.Companion.testCustomer1Json -import org.stellar.anchor.integrationtest.Sep12Tests.Companion.testCustomer2Json +import org.stellar.anchor.platform.CLIENT_WALLET_SECRET import org.stellar.anchor.platform.TestConfig +import org.stellar.anchor.platform.integrationtest.Sep12Tests.Companion.testCustomer1Json +import org.stellar.anchor.platform.integrationtest.Sep12Tests.Companion.testCustomer2Json import org.stellar.anchor.util.GsonUtils import org.stellar.anchor.util.Log.info import org.stellar.anchor.util.MemoHelper diff --git a/extended-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep31RpcEnd2EndTests.kt b/extended-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep31RpcEnd2EndTests.kt index 4238aed795..e0eed1144d 100644 --- a/extended-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep31RpcEnd2EndTests.kt +++ b/extended-tests/src/test/kotlin/org/stellar/anchor/platform/test/Sep31RpcEnd2EndTests.kt @@ -9,7 +9,6 @@ import kotlinx.coroutines.delay import kotlinx.coroutines.runBlocking import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Assertions.assertNotNull -import org.stellar.anchor.CLIENT_WALLET_SECRET import org.stellar.anchor.api.callback.SendEventRequest import org.stellar.anchor.api.callback.SendEventRequestPayload import org.stellar.anchor.api.event.AnchorEvent @@ -24,9 +23,10 @@ import org.stellar.anchor.auth.AuthHelper import org.stellar.anchor.client.Sep12Client import org.stellar.anchor.client.Sep31Client import org.stellar.anchor.client.Sep38Client -import org.stellar.anchor.integrationtest.Sep12Tests.Companion.testCustomer1Json -import org.stellar.anchor.integrationtest.Sep12Tests.Companion.testCustomer2Json +import org.stellar.anchor.platform.CLIENT_WALLET_SECRET import org.stellar.anchor.platform.TestConfig +import org.stellar.anchor.platform.integrationtest.Sep12Tests.Companion.testCustomer1Json +import org.stellar.anchor.platform.integrationtest.Sep12Tests.Companion.testCustomer2Json import org.stellar.anchor.util.GsonUtils import org.stellar.anchor.util.Log.info import org.stellar.anchor.util.MemoHelper diff --git a/platform/src/test/kotlin/org/stellar/anchor/platform/config/CustodyConfigTest.kt b/platform/src/test/kotlin/org/stellar/anchor/platform/config/CustodyConfigTest.kt index 37e6fe8c2d..a55f1874a3 100644 --- a/platform/src/test/kotlin/org/stellar/anchor/platform/config/CustodyConfigTest.kt +++ b/platform/src/test/kotlin/org/stellar/anchor/platform/config/CustodyConfigTest.kt @@ -2,9 +2,9 @@ package org.stellar.anchor.platform.config import org.junit.jupiter.api.Assertions.assertFalse import org.junit.jupiter.api.BeforeEach +import org.junit.jupiter.api.Test import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.EnumSource -import org.junit.jupiter.params.provider.NullSource import org.junit.jupiter.params.provider.ValueSource import org.springframework.validation.BindException import org.springframework.validation.Errors @@ -35,10 +35,8 @@ class PropertyCustodyConfigTest { assertFalse(errors.hasErrors()) } - @ParameterizedTest - @NullSource - @ValueSource(strings = [""]) - fun `test empty type`(type: String?) { + @Test + fun `test empty type`() { config.type = null config.validate(config, errors) assertErrorCode(errors, "custody-type-empty") diff --git a/platform/src/test/kotlin/org/stellar/anchor/platform/configurator/ConfigHelperTest.kt b/platform/src/test/kotlin/org/stellar/anchor/platform/configurator/ConfigHelperTest.kt index 9c8e994689..b679b65f78 100644 --- a/platform/src/test/kotlin/org/stellar/anchor/platform/configurator/ConfigHelperTest.kt +++ b/platform/src/test/kotlin/org/stellar/anchor/platform/configurator/ConfigHelperTest.kt @@ -11,17 +11,16 @@ class ConfigHelperTest { @CsvSource( value = [ - "clients[0]_name,clients,[0],name", - "clients[1]_name,clients,[1],name", - "clients[2]_name,clients,[2],name", - "clients[0]_type,clients,[0],type", - "clients[0]_callback_url,clients,[0],callback_url" + "clients[0]_name,clients,name", + "clients[1]_name,clients,name", + "clients[2]_name,clients,name", + "clients[0]_type,clients,type", + "clients[0]_callback_url,clients,callback_url" ] ) fun `test the list name extraction if the name is a list`( name: String, listName: String, - index: String, elementName: String ) { val result = ConfigHelper.extractListNameIfAny(name)