From 25bffe3f3ee38884b7794618cd2547f47785b73e Mon Sep 17 00:00:00 2001 From: Robert Gogolok Date: Fri, 8 Sep 2023 16:43:34 +0200 Subject: [PATCH] fix tests Somehow the GitHub tests were successful in the past, although there should have been the following errors: ``` Summarizing 6 Failures: [Fail] Extensions fetching applications [It] no error occurs /Users/robertgogolok/workspace/cf_exporter/vendor/github.com/onsi/gomega/ghttp/handlers.go:48 [Fail] Extensions fetching tasks [It] no error occurs /Users/robertgogolok/workspace/cf_exporter/vendor/github.com/onsi/gomega/ghttp/handlers.go:48 [Fail] Extensions fetching org quotas [It] no error occurs /Users/robertgogolok/workspace/cf_exporter/vendor/github.com/onsi/gomega/ghttp/handlers.go:48 [Fail] Extensions fetching space quotas [It] no error occurs /Users/robertgogolok/workspace/cf_exporter/vendor/github.com/onsi/gomega/ghttp/handlers.go:48 [Fail] Extensions fetching space summary [It] no error occurs /Users/robertgogolok/workspace/cf_exporter/vendor/github.com/onsi/gomega/ghttp/handlers.go:48 [Fail] Extensions fetching app events [It] no error occurs /Users/robertgogolok/workspace/cf_exporter/vendor/github.com/onsi/gomega/ghttp/handlers.go:48 ``` The /oauth/token endpoint is being hit 3 times in a row. --- fetcher/sessionext_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fetcher/sessionext_test.go b/fetcher/sessionext_test.go index 548fc558..d5d3b4a2 100644 --- a/fetcher/sessionext_test.go +++ b/fetcher/sessionext_test.go @@ -77,6 +77,13 @@ var _ = Describe("Extensions", func() { ), ) + server.AppendHandlers( + ghttp.CombineHandlers( + ghttp.VerifyRequest("POST", "/oauth/token"), + ghttp.RespondWith(http.StatusOK, tokenResponse), + ), + ) + config = &CFConfig{ URL: server.URL(), ClientID: "fake",