vault/sdk/logical/response_test.go
Steven Clark 9bf3d115fc
Add an option to allow cert-auth to return metadata about client cert that fails login (#29044)
* 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
2024-11-29 10:22:09 -05:00

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())
}