Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jefferai committed May 29, 2018
1 parent d090db0 commit e7728c7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions vault/identity_store_groups_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"sort"
"testing"

"github.com/go-test/deep"
"github.com/hashicorp/vault/helper/identity"
"github.com/hashicorp/vault/logical"
)
Expand Down Expand Up @@ -290,6 +291,7 @@ func TestIdentityStore_GroupsCreateUpdate(t *testing.T) {
"testkey1": "testvalue1",
"testkey2": "testvalue2",
},
"parent_group_ids": []string(nil),
}
expectedData["id"] = resp.Data["id"]
expectedData["type"] = resp.Data["type"]
Expand All @@ -301,8 +303,8 @@ func TestIdentityStore_GroupsCreateUpdate(t *testing.T) {
expectedData["modify_index"] = resp.Data["modify_index"]
expectedData["alias"] = resp.Data["alias"]

if !reflect.DeepEqual(expectedData, resp.Data) {
t.Fatalf("bad: group data;\nexpected: %#v\n actual: %#v\n", expectedData, resp.Data)
if diff := deep.Equal(expectedData, resp.Data); diff != nil {
t.Fatal(diff)
}

// Update the policies and metadata in the group
Expand Down Expand Up @@ -410,6 +412,7 @@ func TestIdentityStore_GroupsCRUD_ByID(t *testing.T) {
"testkey1": "testvalue1",
"testkey2": "testvalue2",
},
"parent_group_ids": []string(nil),
}
expectedData["id"] = resp.Data["id"]
expectedData["type"] = resp.Data["type"]
Expand All @@ -421,8 +424,8 @@ func TestIdentityStore_GroupsCRUD_ByID(t *testing.T) {
expectedData["modify_index"] = resp.Data["modify_index"]
expectedData["alias"] = resp.Data["alias"]

if !reflect.DeepEqual(expectedData, resp.Data) {
t.Fatalf("bad: group data;\nexpected: %#v\n actual: %#v\n", expectedData, resp.Data)
if diff := deep.Equal(expectedData, resp.Data); diff != nil {
t.Fatal(diff)
}

// Update the policies and metadata in the group
Expand Down

0 comments on commit e7728c7

Please sign in to comment.