11package clients
22
33import (
4- "context"
54 "fmt"
65 "io"
76 "net/http"
@@ -14,18 +13,17 @@ import (
1413
1514func TestTokenFlow_Init (t * testing.T ) {
1615 type args struct {
17- ctx context.Context
1816 cfg * TokenFlowConfig
1917 }
2018 tests := []struct {
2119 name string
2220 args args
2321 wantErr bool
2422 }{
25- {"ok" , args {context . Background (), & TokenFlowConfig {
23+ {"ok" , args {& TokenFlowConfig {
2624 ServiceAccountToken : "efg" ,
2725 }}, false },
28- {"error 1" , args {context . Background (), & TokenFlowConfig {
26+ {"error 1" , args {& TokenFlowConfig {
2927 ServiceAccountToken : "" ,
3028 }}, true },
3129 }
@@ -38,7 +36,7 @@ func TestTokenFlow_Init(t *testing.T) {
3836 if err != nil {
3937 t .Fatalf ("Setting service account token: %s" , err )
4038 }
41- if err := c .Init (tt .args .ctx , tt . args . cfg ); (err != nil ) != tt .wantErr {
39+ if err := c .Init (tt .args .cfg ); (err != nil ) != tt .wantErr {
4240 t .Errorf ("TokenFlow.Init() error = %v, wantErr %v" , err , tt .wantErr )
4341 }
4442 err = os .Setenv (ServiceAccountToken , b )
@@ -86,7 +84,7 @@ func TestTokenFlow_Do(t *testing.T) {
8684 t .Error (err )
8785 return
8886 }
89- req , err := http .NewRequest (http .MethodGet , u .String (), nil )
87+ req , err := http .NewRequest (http .MethodGet , u .String (), http . NoBody )
9088 if err != nil {
9189 t .Error (err )
9290 return
0 commit comments