MCPcopy
hub / github.com/minio/minio-go / TestChainIsExpired

Function TestChainIsExpired

pkg/credentials/chain_test.go:84–111  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

82}
83
84func 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
113func TestChainWithNoProvider(t *testing.T) {
114 p := &Chain{

Callers

nothing calls this directly

Calls 2

IsExpiredMethod · 0.95

Tested by

no test coverage detected