Skip to content

Commit b02b4d0

Browse files
committed
chore: fix test cases
1 parent 41108bf commit b02b4d0

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

router/transformer/transformer_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ func TestProxyRequest(t *testing.T) {
345345
ResponseData: tc.postParameters,
346346
DestName: "not_found_dest",
347347
Adapter: &mockAdapter{url: srv.URL},
348+
DestInfo: &v2.DestinationInfo{},
348349
}
349350
r := tr.ProxyRequest(ctx, reqParams)
350351
stCd := r.ProxyRequestStatusCode
@@ -384,6 +385,7 @@ func TestProxyRequest(t *testing.T) {
384385
ResponseData: tc.postParameters,
385386
DestName: tc.destName,
386387
Adapter: &mockAdapter{url: srv.URL},
388+
DestInfo: &v2.DestinationInfo{},
387389
}
388390
r := tr.ProxyRequest(ctx, reqParams)
389391
stCd := r.ProxyRequestStatusCode
@@ -1967,6 +1969,7 @@ func TestTransformerMetrics(t *testing.T) {
19671969
stats: statsStore,
19681970
logger: logger.NOP,
19691971
tr: &http.Transport{},
1972+
clientOAuth: srv.Client(),
19701973
expirationTimeDiff: expTimeDiff,
19711974
transformRequestTimerStat: statsStore.NewStat("router.transformer_request_time", stats.TimerType), // Add this line
19721975
}

services/oauth/v2/controlplane/cp_connector_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ var _ = Describe("CpConnector", func() {
6464
BasicAuthUser: &testutils.BasicAuthMock{},
6565
})
6666
Expect(statusCode).To(Equal(http.StatusInternalServerError))
67-
Expect(`{"errorType":"timeout","message":"mock mock 127.0.0.1:1234->127.0.0.1:12340: read: connection timed out"}`).To(MatchJSON(respBody))
67+
Expect(`{"errorType":"timeout","message":"mock mock 127.0.0.1:1234->127.0.0.1:12340: read: operation timed out"}`).To(MatchJSON(respBody))
6868
})
6969

7070
It("Test CpApiCall function to test connection reset by peer", func() {

services/oauth/v2/oauth_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -354,10 +354,10 @@ var _ = Describe("Oauth", func() {
354354
Expect(statusCode).To(Equal(http.StatusInternalServerError))
355355
expectedResponse := &v2.AuthResponse{
356356
Err: "timeout",
357-
ErrorMessage: "mock mock 127.0.0.1:1234->127.0.0.1:12340: read: connection timed out",
357+
ErrorMessage: "mock mock 127.0.0.1:1234->127.0.0.1:12340: read: operation timed out",
358358
}
359359
Expect(response).To(Equal(expectedResponse))
360-
Expect(err).To(MatchError(fmt.Errorf("error occurred while fetching/refreshing account info from CP: mock mock 127.0.0.1:1234->127.0.0.1:12340: read: connection timed out")))
360+
Expect(err).To(MatchError(fmt.Errorf("error occurred while fetching/refreshing account info from CP: mock mock 127.0.0.1:1234->127.0.0.1:12340: read: operation timed out")))
361361
})
362362
})
363363

@@ -573,10 +573,10 @@ var _ = Describe("Oauth", func() {
573573
Expect(statusCode).To(Equal(http.StatusInternalServerError))
574574
expectedResponse := &v2.AuthResponse{
575575
Err: "timeout",
576-
ErrorMessage: "mock mock 127.0.0.1:1234->127.0.0.1:12340: read: connection timed out",
576+
ErrorMessage: "mock mock 127.0.0.1:1234->127.0.0.1:12340: read: operation timed out",
577577
}
578578
Expect(response).To(Equal(expectedResponse))
579-
Expect(err).To(MatchError(fmt.Errorf("error occurred while fetching/refreshing account info from CP: mock mock 127.0.0.1:1234->127.0.0.1:12340: read: connection timed out")))
579+
Expect(err).To(MatchError(fmt.Errorf("error occurred while fetching/refreshing account info from CP: mock mock 127.0.0.1:1234->127.0.0.1:12340: read: operation timed out")))
580580
})
581581

582582
It("refreshToken function call when stored cache is same as provided secret and cpApiCall returns a failed response because of faulty implementation in some downstream service", func() {

0 commit comments

Comments
 (0)