Skip to content

Commit

Permalink
s/_testToken/testToken
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Barnes <[email protected]>
  • Loading branch information
bbarnes52-zz committed Jun 23, 2021
1 parent 14090ae commit 4163390
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/common/plugin/k8s/apiserver/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ oIrPuyjOmscrC627wX3LGUHwPKtNArBT8lKFfda1B1BqAk0q1/ui/A==
)

const (
_testToken = "TEST-TOKEN"
testToken = "TEST-TOKEN"
)

func TestAPIServerClient(t *testing.T) {
Expand Down Expand Up @@ -231,7 +231,7 @@ func (s *ClientSuite) TestGetNodeSucceeds() {

func (s *ClientSuite) TestValidateTokenFailsToLoadClient() {
client := s.createDefectiveClient("")
status, err := client.ValidateToken(ctx, _testToken, []string{"aud1", "aud2"})
status, err := client.ValidateToken(ctx, testToken, []string{"aud1", "aud2"})
s.AssertErrorContains(err, "unable to get clientset")
s.Nil(status)
}
Expand All @@ -244,7 +244,7 @@ func (s *ClientSuite) TestValidateTokenFailsIfGetsErrorFromAPIServer() {
})

client := s.createClient(fakeClient)
status, err := client.ValidateToken(ctx, _testToken, []string{"aud1"})
status, err := client.ValidateToken(ctx, testToken, []string{"aud1"})
s.AssertErrorContains(err, "unable to query token review API")
s.Nil(status)
}
Expand All @@ -257,7 +257,7 @@ func (s *ClientSuite) TestValidateTokenFailsIfGetsNilResponse() {
})

client := s.createClient(fakeClient)
status, err := client.ValidateToken(ctx, _testToken, []string{"aud1"})
status, err := client.ValidateToken(ctx, testToken, []string{"aud1"})
s.AssertErrorContains(err, "token review API response is nil")
s.Nil(status)
}
Expand All @@ -270,7 +270,7 @@ func (s *ClientSuite) TestValidateTokenFailsIfStatusContainsError() {
})

client := s.createClient(fakeClient)
status, err := client.ValidateToken(ctx, _testToken, []string{"aud1"})
status, err := client.ValidateToken(ctx, testToken, []string{"aud1"})
s.AssertErrorContains(err, "token review API response contains an error")
s.Nil(status)
}
Expand All @@ -283,7 +283,7 @@ func (s *ClientSuite) TestValidateTokenSucceeds() {
})

client := s.createClient(fakeClient)
status, err := client.ValidateToken(ctx, _testToken, []string{"aud1"})
status, err := client.ValidateToken(ctx, testToken, []string{"aud1"})
s.NoError(err)
s.NotNil(status)
s.True(status.Authenticated)
Expand Down

0 comments on commit 4163390

Please sign in to comment.