(t *testing.T)
| 126 | } |
| 127 | |
| 128 | func TestChainProviderWithNoValidProvider(t *testing.T) { |
| 129 | errs := []error{ |
| 130 | errors.New("FirstError"), |
| 131 | errors.New("SecondError"), |
| 132 | } |
| 133 | p := &Chain{ |
| 134 | Providers: []Provider{ |
| 135 | &credProvider{err: errs[0]}, |
| 136 | &credProvider{err: errs[1]}, |
| 137 | }, |
| 138 | } |
| 139 | |
| 140 | if !p.IsExpired() { |
| 141 | t.Fatal("Expected to be expired with no providers") |
| 142 | } |
| 143 | |
| 144 | _, err := p.RetrieveWithCredContext(defaultCredContext) |
| 145 | if err != nil { |
| 146 | if err.Error() != "No valid providers found [FirstError SecondError]" { |
| 147 | t.Error(err) |
| 148 | } |
| 149 | } |
| 150 | } |
nothing calls this directly
no test coverage detected