diff options
Diffstat (limited to 'packages/taler-harness/src/integrationtests')
3 files changed, 24 insertions, 13 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-payment-abort.ts b/packages/taler-harness/src/integrationtests/test-payment-abort.ts index a165c1e09..0ac953240 100644 --- a/packages/taler-harness/src/integrationtests/test-payment-abort.ts +++ b/packages/taler-harness/src/integrationtests/test-payment-abort.ts @@ -43,12 +43,17 @@ const axios = axiosImp.default; export async function runPaymentAbortTest(t: GlobalTestState) { // Set up test environment - const { wallet, bank, exchange, faultyMerchant } = + const { wallet, bank, exchange, faultyMerchant, faultyExchange } = await createFaultInjectedMerchantTestkudosEnvironment(t); // Withdraw digital cash into the wallet. - await withdrawViaBank(t, { wallet, bank, exchange, amount: "TESTKUDOS:20" }); + await withdrawViaBank(t, { + wallet, + bank, + exchange: faultyExchange, + amount: "TESTKUDOS:20", + }); const merchant = faultyMerchant; @@ -112,8 +117,6 @@ export async function runPaymentAbortTest(t: GlobalTestState) { publicOrderStatusResp.data, ); - let faultInjected = false; - faultyMerchant.faultProxy.addFault({ async modifyRequest(ctx: FaultInjectionRequestContext) { const url = new URL(ctx.requestUrl); diff --git a/packages/taler-harness/src/integrationtests/test-payment-fault.ts b/packages/taler-harness/src/integrationtests/test-payment-fault.ts index 209830187..c1438a419 100644 --- a/packages/taler-harness/src/integrationtests/test-payment-fault.ts +++ b/packages/taler-harness/src/integrationtests/test-payment-fault.ts @@ -71,7 +71,16 @@ export async function runPaymentFaultTest(t: GlobalTestState) { "x", ); - bank.setSuggestedExchange(exchange, exchangeBankAccount.accountPaytoUri); + const faultyExchange = new FaultInjectedExchangeService(t, exchange, 8091); + // Base URL must contain port that the proxy is listening on. + await exchange.modifyConfig(async (config) => { + config.setString("exchange", "base_url", "http://localhost:8091/"); + }); + + bank.setSuggestedExchange( + faultyExchange, + exchangeBankAccount.accountPaytoUri, + ); await bank.start(); @@ -83,12 +92,6 @@ export async function runPaymentFaultTest(t: GlobalTestState) { await exchange.start(); await exchange.pingUntilAvailable(); - const faultyExchange = new FaultInjectedExchangeService(t, exchange, 8091); - // Base URL must contain port that the proxy is listening on. - await exchange.modifyConfig(async (config) => { - config.setString("exchange", "base_url", "http://localhost:8091/"); - }); - // Print all requests to the exchange faultyExchange.faultProxy.addFault({ async modifyRequest(ctx: FaultInjectionRequestContext) { diff --git a/packages/taler-harness/src/integrationtests/test-payment-transient.ts b/packages/taler-harness/src/integrationtests/test-payment-transient.ts index a837a1b33..33a9716d5 100644 --- a/packages/taler-harness/src/integrationtests/test-payment-transient.ts +++ b/packages/taler-harness/src/integrationtests/test-payment-transient.ts @@ -42,12 +42,17 @@ const axios = axiosImp.default; export async function runPaymentTransientTest(t: GlobalTestState) { // Set up test environment - const { wallet, bank, exchange, faultyMerchant } = + const { wallet, bank, exchange, faultyMerchant, faultyExchange } = await createFaultInjectedMerchantTestkudosEnvironment(t); // Withdraw digital cash into the wallet. - await withdrawViaBank(t, { wallet, bank, exchange, amount: "TESTKUDOS:20" }); + await withdrawViaBank(t, { + wallet, + bank, + exchange: faultyExchange, + amount: "TESTKUDOS:20", + }); const merchant = faultyMerchant; |