From bae33f8c603c69c273d49ce084343a9a8b8afc96 Mon Sep 17 00:00:00 2001 From: Bel LaPointe <153096461+breel-render@users.noreply.github.com> Date: Fri, 23 May 2025 19:44:24 -0600 Subject: [PATCH] try /transactions too --- src/bank/teller/teller_integration_test.go | 38 +++++++++++++--------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/src/bank/teller/teller_integration_test.go b/src/bank/teller/teller_integration_test.go index f2a0359..2b0d491 100644 --- a/src/bank/teller/teller_integration_test.go +++ b/src/bank/teller/teller_integration_test.go @@ -24,22 +24,30 @@ func TestIntegration(t *testing.T) { } //curl --cert certificate.pem --cert-key private_key.pem --auth test_token_bfu2cyvq3il6o: https://api.teller.io/accounts - req, err := http.NewRequest(http.MethodGet, "https://api.teller.io/accounts", nil) - if err != nil { - t.Fatal(err) - } - req.SetBasicAuth("test_token_bfu2cyvq3il6o", "") + for _, url := range []string{ + "https://api.teller.io/accounts", + "https://api.teller.io/accounts/acc_pdvv4810fi9hmrcn6g000/transactions", + } { + url := url + t.Run(url, func(t *testing.T) { + req, err := http.NewRequest(http.MethodGet, url, nil) + if err != nil { + t.Fatal(err) + } + req.SetBasicAuth("test_token_bfu2cyvq3il6o", "") - resp, err := c.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() + resp, err := c.Do(req) + if err != nil { + t.Fatal(err) + } + defer resp.Body.Close() - body, _ := io.ReadAll(resp.Body) - if code := resp.StatusCode; code >= 300 { - t.Fatalf("(%d) %s", code, body) - } + body, _ := io.ReadAll(resp.Body) + if code := resp.StatusCode; code >= 300 { + t.Fatalf("(%d) %s", code, body) + } - t.Logf("(%d) %s", resp.StatusCode, body) + t.Logf("(%d) %s", resp.StatusCode, body) + }) + } }