Skip to content

Commit

Permalink
add test helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
vinay-gopalan committed Dec 5, 2024
1 parent 4cf4f96 commit ebcf3cf
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions path_static_creds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,18 @@ func TestCreds(t *testing.T) {
}
})
}

func readStaticCred(t *testing.T, b *backend, storage logical.Storage, roleName string) *logical.Response {
t.Helper()
req := &logical.Request{
Operation: logical.ReadOperation,
Path: staticCredPath + roleName,
Storage: storage,
}

resp, err := b.HandleRequest(context.Background(), req)
if resp == nil || err != nil || (resp != nil && resp.IsError()) {
t.Fatalf("err:%s resp:%#v\n", err, resp)
}
return resp
}

0 comments on commit ebcf3cf

Please sign in to comment.