Skip to content

Commit

Permalink
update how jsonification is tested
Browse files Browse the repository at this point in the history
  • Loading branch information
tyrannosaurus-becks committed Apr 24, 2020
1 parent ae3ba7f commit f297a49
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sdk/helper/authmetadata/auth_metadata_test.go
@@ -1,7 +1,6 @@
package authmetadata

import (
"encoding/json"
"fmt"
"reflect"
"sort"
Expand Down Expand Up @@ -108,7 +107,7 @@ func TestPopulateDesiredAuthMetadata(t *testing.T) {
func TestMarshalJSON(t *testing.T) {
h := NewHandler(&Fields{})
h.authMetadata = []string{"fizz", "buzz"}
b, err := json.Marshal(h)
b, err := h.MarshalJSON()
if err != nil {
t.Fatal(err)
}
Expand All @@ -119,7 +118,7 @@ func TestMarshalJSON(t *testing.T) {

func TestUnmarshalJSON(t *testing.T) {
h := NewHandler(&Fields{})
if err := json.Unmarshal([]byte(`{"auth_metadata":["fizz","buzz"]}`), h); err != nil {
if err := h.UnmarshalJSON([]byte(`{"auth_metadata":["fizz","buzz"]}`)); err != nil {
t.Fatal(err)
}
if fmt.Sprintf("%s", h.authMetadata) != `[fizz buzz]` {
Expand Down

0 comments on commit f297a49

Please sign in to comment.