Skip to content

Commit

Permalink
use named struct fields for TestSysConfigState_Sanitized cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ccapurso committed Apr 13, 2023
1 parent 8a9cfb2 commit ca39491
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions http/sys_config_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ func TestSysConfigState_Sanitized(t *testing.T) {
expectedHAStorageOutput map[string]interface{}
}{
{
"raft storage",
&server.Storage{
name: "raft storage",
storageConfig: &server.Storage{
Type: "raft",
RedirectAddr: "http://127.0.0.1:8200",
ClusterAddr: "http://127.0.0.1:8201",
Expand All @@ -35,8 +35,8 @@ func TestSysConfigState_Sanitized(t *testing.T) {
"max_entry_size": "2097152",
},
},
nil,
map[string]interface{}{
haStorageConfig: nil,
expectedStorageOutput: map[string]interface{}{
"type": "raft",
"redirect_addr": "http://127.0.0.1:8200",
"cluster_addr": "http://127.0.0.1:8201",
Expand All @@ -45,34 +45,34 @@ func TestSysConfigState_Sanitized(t *testing.T) {
"max_entry_size": "2097152",
},
},
nil,
expectedHAStorageOutput: nil,
},
{
"inmem storage, no HA storage",
&server.Storage{
name: "inmem storage, no HA storage",
storageConfig: &server.Storage{
Type: "inmem",
RedirectAddr: "http://127.0.0.1:8200",
ClusterAddr: "http://127.0.0.1:8201",
DisableClustering: false,
},
nil,
map[string]interface{}{
haStorageConfig: nil,
expectedStorageOutput: map[string]interface{}{
"type": "inmem",
"redirect_addr": "http://127.0.0.1:8200",
"cluster_addr": "http://127.0.0.1:8201",
"disable_clustering": false,
},
nil,
expectedHAStorageOutput: nil,
},
{
"inmem storage, raft HA storage",
&server.Storage{
name: "inmem storage, raft HA storage",
storageConfig: &server.Storage{
Type: "inmem",
RedirectAddr: "http://127.0.0.1:8200",
ClusterAddr: "http://127.0.0.1:8201",
DisableClustering: false,
},
&server.Storage{
haStorageConfig: &server.Storage{
Type: "raft",
RedirectAddr: "http://127.0.0.1:8200",
ClusterAddr: "http://127.0.0.1:8201",
Expand All @@ -83,13 +83,13 @@ func TestSysConfigState_Sanitized(t *testing.T) {
"max_entry_size": "2097152",
},
},
map[string]interface{}{
expectedStorageOutput: map[string]interface{}{
"type": "inmem",
"redirect_addr": "http://127.0.0.1:8200",
"cluster_addr": "http://127.0.0.1:8201",
"disable_clustering": false,
},
map[string]interface{}{
expectedHAStorageOutput: map[string]interface{}{
"type": "raft",
"redirect_addr": "http://127.0.0.1:8200",
"cluster_addr": "http://127.0.0.1:8201",
Expand Down

0 comments on commit ca39491

Please sign in to comment.