mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-22 15:11:07 +02:00
* Add an option to allow cert-auth to return metadata about client certs that fail login * Add cl * Update SPDX header for sdk/logical/response_test.go
25 lines
568 B
Go
25 lines
568 B
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
package logical
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
// TestResponse_ErrorResponse validates that our helper functions produce responses
|
|
// that we consider errors.
|
|
func TestResponse_ErrorResponse(t *testing.T) {
|
|
simpleResp := ErrorResponse("a test %s", "error")
|
|
assert.True(t, simpleResp.IsError())
|
|
|
|
dataMap := map[string]string{
|
|
"test1": "testing",
|
|
}
|
|
|
|
withDataResp := ErrorResponseWithData(dataMap, "a test %s", "error")
|
|
assert.True(t, withDataResp.IsError())
|
|
}
|