Skip to content

Commit

Permalink
Fix reference in test
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed Sep 10, 2024
1 parent 35d6843 commit dbd59dc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions p2p/http/auth/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func TestMutualAuth(t *testing.T) {
serverID, resp, err := clientAuth.AuthenticatedDo(client, req)
require.NoError(t, err)
require.Equal(t, expectedServerID, serverID)
require.NotZero(t, clientAuth.tokenMap["example.com"])
require.NotZero(t, clientAuth.tm.tokenMap["example.com"])
require.Equal(t, http.StatusOK, resp.StatusCode)
require.Equal(t, 2, requestsSent())

Expand All @@ -141,7 +141,7 @@ func TestMutualAuth(t *testing.T) {
require.NotEmpty(t, req.Header.Get("Authorization"))
require.NoError(t, err)
require.Equal(t, expectedServerID, serverID)
require.NotZero(t, clientAuth.tokenMap["example.com"])
require.NotZero(t, clientAuth.tm.tokenMap["example.com"])
require.Equal(t, http.StatusOK, resp.StatusCode)
require.Equal(t, 1, requestsSent(), "should only call newRequest once since we have a token")

Expand All @@ -165,7 +165,7 @@ func TestMutualAuth(t *testing.T) {
require.NotEmpty(t, req.Header.Get("Authorization"))
require.Equal(t, http.StatusOK, resp.StatusCode)
require.Equal(t, expectedServerID, serverID)
require.NotZero(t, clientAuth.tokenMap["example.com"])
require.NotZero(t, clientAuth.tm.tokenMap["example.com"])
require.Equal(t, 3, requestsSent(), "should call newRequest 3x since our token expired")
})

Expand All @@ -191,7 +191,7 @@ func TestMutualAuth(t *testing.T) {
require.NotEmpty(t, req.Header.Get("Authorization"))
require.Equal(t, http.StatusOK, resp.StatusCode)
require.Equal(t, expectedServerID, serverID)
require.NotZero(t, clientAuth.tokenMap["example.com"])
require.NotZero(t, clientAuth.tm.tokenMap["example.com"])
require.Equal(t, 3, requestsSent(), "should call have sent 3 reqs since our token expired")
})

Expand Down

0 comments on commit dbd59dc

Please sign in to comment.