mirror of
https://github.com/hashicorp/vault.git
synced 2025-12-09 11:31:52 +01:00
* license: update headers to IBM Corp. * `make proto` * update offset because source file changed Signed-off-by: Ryan Cragun <me@ryan.ec> Co-authored-by: Ryan Cragun <me@ryan.ec>
25 lines
569 B
Go
25 lines
569 B
Go
// Copyright IBM Corp. 2016, 2025
|
|
// 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())
|
|
}
|