diff options
author | MS <ms@taler.net> | 2023-02-27 16:24:09 +0100 |
---|---|---|
committer | MS <ms@taler.net> | 2023-02-27 16:24:09 +0100 |
commit | 09482f4c01d552728a2963e147cd89a29d47e639 (patch) | |
tree | a72e94e55fbdfa4d1d46aa1b6d39d432e7542ebd /nexus/src/test/kotlin/TalerTest.kt | |
parent | 2f2277c0250740b84514a0594973da9603d22fcc (diff) | |
download | libeufin-09482f4c01d552728a2963e147cd89a29d47e639.tar.gz libeufin-09482f4c01d552728a2963e147cd89a29d47e639.tar.bz2 libeufin-09482f4c01d552728a2963e147cd89a29d47e639.zip |
Long polling.
Drafting a Taler Wire Gateway testcase and
a helper class to offer methods that abstract
Postgres' LISTEN and NOTIFY.
Diffstat (limited to 'nexus/src/test/kotlin/TalerTest.kt')
-rw-r--r-- | nexus/src/test/kotlin/TalerTest.kt | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/nexus/src/test/kotlin/TalerTest.kt b/nexus/src/test/kotlin/TalerTest.kt index bc117307..36c656f1 100644 --- a/nexus/src/test/kotlin/TalerTest.kt +++ b/nexus/src/test/kotlin/TalerTest.kt @@ -1,25 +1,50 @@ import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper import io.ktor.client.plugins.* import io.ktor.client.request.* +import io.ktor.client.statement.* import io.ktor.http.* import io.ktor.server.testing.* import kotlinx.coroutines.* +import kotlinx.coroutines.future.future import org.jetbrains.exposed.sql.transactions.TransactionManager import org.jetbrains.exposed.sql.transactions.transaction import org.junit.Ignore import org.junit.Test import tech.libeufin.nexus.* import tech.libeufin.nexus.bankaccount.fetchBankAccountTransactions -import tech.libeufin.nexus.server.FetchLevel -import tech.libeufin.nexus.server.FetchSpecAllJson -import tech.libeufin.nexus.server.client -import tech.libeufin.nexus.server.nexusApp +import tech.libeufin.nexus.iso20022.EntryStatus +import tech.libeufin.nexus.server.* import tech.libeufin.sandbox.sandboxApp import tech.libeufin.sandbox.wireTransfer // This class tests the features related to the Taler facade. class TalerTest { + /** + * Tests that a client (normally represented by the wire-watch) + * gets incoming transactions. + */ + @Test + fun historyIncomingTest() { + withNexusAndSandboxUser { + testApplication { + application(nexusApp) + runBlocking { + val future = async { + client.get( + "/facades/taler/taler-wire-gateway/history/incoming?delta=5" + ) { + expectSuccess = true + contentType(ContentType.Application.Json) + basicAuth("foo", "foo") + } + } + talerIncomingForFoo("KUDOS", "10", "Invalid") + } + } + } + } + @Ignore // Ignoring because no assert takes place. @Test // Triggering a refund because of a duplicate reserve pub. fun refundTest() { |