Skip to content

Commit

Permalink
test response metadata return for pki fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
eikenb committed Apr 12, 2022
1 parent 326a86f commit 19156b3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions dependency/vault_pki_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,13 @@ func Test_VaultPKI_refetch(t *testing.T) {
if err != nil {
t.Fatal(err)
}
act1, _, err := d.Fetch(clients, nil)
act1, rm, err := d.Fetch(clients, nil)
if err != nil {
t.Fatal(err)
}
if rm == nil {
t.Error("Fetch returned nil for response metadata.")
}

cert1, ok := act1.(string)
if !ok || !strings.Contains(cert1, "BEGIN") {
Expand All @@ -130,10 +133,13 @@ func Test_VaultPKI_refetch(t *testing.T) {
// re-fetch, should be the same cert pulled from the file
// if re-fetched from Vault it will be different
<-d.sleepCh // drain sleepCh so we don't wait
act2, _, err := d.Fetch(clients, nil)
act2, rm, err := d.Fetch(clients, nil)
if err != nil {
t.Fatal(err)
}
if rm == nil {
t.Error("Fetch returned nil for response metadata.")
}

cert2, ok := act2.(string)
if !ok || !strings.Contains(cert2, "BEGIN") {
Expand Down

0 comments on commit 19156b3

Please sign in to comment.