Skip to content

Commit

Permalink
Add changelog and assure the new field in the existing tests for /sys…
Browse files Browse the repository at this point in the history
…/health/
  • Loading branch information
kubawi committed Nov 28, 2023
1 parent fc2db38 commit ff0e57a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog/24270.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:change
api: add the `enterprise` parameter to the `/sys/health` endpoint
```
7 changes: 7 additions & 0 deletions http/sys_health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"reflect"
"testing"

"github.com/hashicorp/vault/helper/constants"
"github.com/hashicorp/vault/sdk/helper/consts"
"github.com/hashicorp/vault/vault"
)
Expand All @@ -26,6 +27,7 @@ func TestSysHealth_get(t *testing.T) {

var actual map[string]interface{}
expected := map[string]interface{}{
"enterprise": constants.IsEnterprise,
"replication_performance_mode": consts.ReplicationUnknown.GetPerformanceString(),
"replication_dr_mode": consts.ReplicationUnknown.GetDRString(),
"initialized": false,
Expand Down Expand Up @@ -60,6 +62,7 @@ func TestSysHealth_get(t *testing.T) {

actual = map[string]interface{}{}
expected = map[string]interface{}{
"enterprise": constants.IsEnterprise,
"replication_performance_mode": consts.ReplicationUnknown.GetPerformanceString(),
"replication_dr_mode": consts.ReplicationUnknown.GetDRString(),
"initialized": true,
Expand Down Expand Up @@ -98,6 +101,7 @@ func TestSysHealth_get(t *testing.T) {

actual = map[string]interface{}{}
expected = map[string]interface{}{
"enterprise": constants.IsEnterprise,
"replication_performance_mode": consts.ReplicationPerformanceDisabled.GetPerformanceString(),
"replication_dr_mode": consts.ReplicationDRDisabled.GetDRString(),
"initialized": true,
Expand Down Expand Up @@ -141,6 +145,7 @@ func TestSysHealth_customcodes(t *testing.T) {

var actual map[string]interface{}
expected := map[string]interface{}{
"enterprise": constants.IsEnterprise,
"replication_performance_mode": consts.ReplicationUnknown.GetPerformanceString(),
"replication_dr_mode": consts.ReplicationUnknown.GetDRString(),
"initialized": false,
Expand Down Expand Up @@ -176,6 +181,7 @@ func TestSysHealth_customcodes(t *testing.T) {

actual = map[string]interface{}{}
expected = map[string]interface{}{
"enterprise": constants.IsEnterprise,
"replication_performance_mode": consts.ReplicationUnknown.GetPerformanceString(),
"replication_dr_mode": consts.ReplicationUnknown.GetDRString(),
"initialized": true,
Expand Down Expand Up @@ -215,6 +221,7 @@ func TestSysHealth_customcodes(t *testing.T) {

actual = map[string]interface{}{}
expected = map[string]interface{}{
"enterprise": constants.IsEnterprise,
"replication_performance_mode": consts.ReplicationPerformanceDisabled.GetPerformanceString(),
"replication_dr_mode": consts.ReplicationDRDisabled.GetDRString(),
"initialized": true,
Expand Down

0 comments on commit ff0e57a

Please sign in to comment.