mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-30 18:17:55 +00:00 
			
		
		
		
	 9bf3d115fc
			
		
	
	9bf3d115fc
	
	
	
		
			
			* 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())
 | |
| }
 |