(t *testing.T)
| 82 | } |
| 83 | |
| 84 | func TestChainIsExpired(t *testing.T) { |
| 85 | credProvider := &credProvider{ |
| 86 | creds: Value{ |
| 87 | AccessKeyID: "UXHW", |
| 88 | SecretAccessKey: "MYSECRET", |
| 89 | SessionToken: "", |
| 90 | }, |
| 91 | expired: true, |
| 92 | } |
| 93 | p := &Chain{ |
| 94 | Providers: []Provider{ |
| 95 | credProvider, |
| 96 | }, |
| 97 | } |
| 98 | |
| 99 | if !p.IsExpired() { |
| 100 | t.Fatal("Expected expired to be true before any Retrieve") |
| 101 | } |
| 102 | |
| 103 | _, err := p.RetrieveWithCredContext(defaultCredContext) |
| 104 | if err != nil { |
| 105 | t.Fatal(err) |
| 106 | } |
| 107 | |
| 108 | if p.IsExpired() { |
| 109 | t.Fatal("Expected to be not expired after Retrieve") |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | func TestChainWithNoProvider(t *testing.T) { |
| 114 | p := &Chain{ |
nothing calls this directly
no test coverage detected