|
9 | 9 | logicaltest "github.com/hashicorp/vault/helper/testhelpers/logical"
|
10 | 10 | "github.com/hashicorp/vault/sdk/logical"
|
11 | 11 | "github.com/mitchellh/mapstructure"
|
12 |
| - "gotest.tools/assert" |
| 12 | + "gotest.tools/v3/assert" |
13 | 13 |
|
14 | 14 | "github.com/splunk/vault-plugin-splunk/clients/splunk"
|
15 | 15 | )
|
@@ -40,6 +40,7 @@ func TestBackend_basic(t *testing.T) {
|
40 | 40 | testAccStepConfig(t),
|
41 | 41 | testAccStepRole(t, "test", roleConfig),
|
42 | 42 | testAccStepCredsRead(t, "test"),
|
| 43 | + testAccStepCredsReadMultiBadConfig(t, "test"), |
43 | 44 | },
|
44 | 45 | })
|
45 | 46 | }
|
@@ -278,6 +279,21 @@ func testAccStepCredsRead(t *testing.T, role string) logicaltest.TestStep {
|
278 | 279 | }
|
279 | 280 | }
|
280 | 281 |
|
| 282 | +func testAccStepCredsReadMultiBadConfig(t *testing.T, role string) logicaltest.TestStep { |
| 283 | + return logicaltest.TestStep{ |
| 284 | + Operation: logical.ReadOperation, |
| 285 | + Path: "creds/" + role + "/someNonExistentNodeID", |
| 286 | + ErrorOk: true, |
| 287 | + Check: func(resp *logical.Response) error { |
| 288 | + if resp == nil { |
| 289 | + return fmt.Errorf("response is nil") |
| 290 | + } |
| 291 | + assert.Error(t, resp.Error(), `host "someNonExistentNodeID" not found`) |
| 292 | + return nil |
| 293 | + }, |
| 294 | + } |
| 295 | +} |
| 296 | + |
281 | 297 | func testAccRotateRoot(t *testing.T, conn string) logicaltest.TestStep {
|
282 | 298 | return logicaltest.TestStep{
|
283 | 299 | Operation: logical.UpdateOperation,
|
|
0 commit comments