Skip to content

Commit 96ff03f

Browse files
committed
Handle new responses for field validation errors
HashiCorp corrected the way the Vault server responds to field validation issues. SEE: hashicorp/vault#12042 Signed-off-by: Martin Baillie <martin@baillie.id>
1 parent d72dbaf commit 96ff03f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

github/path_token_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"errors"
77
"net/http"
88
"net/http/httptest"
9+
"strings"
910
"testing"
1011

1112
"github.com/hashicorp/vault/sdk/logical"
@@ -112,8 +113,10 @@ func testBackendPathTokenWrite(t *testing.T, op logical.Operation) {
112113
keyPerms: "not a map of string to string",
113114
},
114115
})
115-
assert.Assert(t, is.Nil(r))
116-
assert.Assert(t, err != nil)
116+
117+
assert.NilError(t, err)
118+
assert.Assert(t, r != nil)
119+
assert.Assert(t, strings.Contains(r.Data["error"].(string), "Field validation failed"))
117120
})
118121

119122
t.Run("FailedCreate", func(t *testing.T) {

0 commit comments

Comments
 (0)