(t *testing.T)
| 38 | } |
| 39 | |
| 40 | func TestBearerAuthStatic(t *testing.T) { |
| 41 | p, err := NewAuthProvider(AuthConfig{Scheme: "bearer", Token: "abc123"}, nil) |
| 42 | if err != nil { |
| 43 | t.Fatal(err) |
| 44 | } |
| 45 | req := newTestRequest(t, "https://api.example.com/users") |
| 46 | if err := p.Apply(context.Background(), req, nil); err != nil { |
| 47 | t.Fatal(err) |
| 48 | } |
| 49 | if got := req.Header.Get("Authorization"); got != "Bearer abc123" { |
| 50 | t.Errorf("Authorization = %q, want Bearer abc123", got) |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | func TestBearerAuthPassThrough(t *testing.T) { |
| 55 | p, err := NewAuthProvider(AuthConfig{ |
nothing calls this directly
no test coverage detected