func TestClaimsMarshalledValue(t *testing.T) {
	assert := audit.NewTestingAssertion(t, true)
	assert.Logf("testing claims deep value unmarshalling")
	baz := []*nestedValue{
		{"one", 1},
		{"two", 2},
		{"three", 3},
	}
	claims := jwt.NewClaims()
	claims.Set("foo", "bar")
	claims.Set("baz", baz)
	// Now marshal and unmarshal the claims.
	jsonValue, err := json.Marshal(claims)
	assert.NotNil(jsonValue)
	assert.Nil(err)
	var unmarshalled jwt.Claims
	err = json.Unmarshal(jsonValue, &unmarshalled)
	assert.Nil(err)
	assert.Length(unmarshalled, 2)
	foo, ok := claims.Get("foo")
	assert.Equal(foo, "bar")
	assert.True(ok)
	var unmarshalledBaz []*nestedValue
	ok, err = claims.GetMarshalled("baz", &unmarshalledBaz)
	assert.True(ok)
	assert.Nil(err)
	assert.Length(unmarshalledBaz, 3)
	assert.Equal(unmarshalledBaz[0].Name, "one")
	assert.Equal(unmarshalledBaz[2].Value, 3)
}
// TestClaimsMarshalledValue tests the marshalling and
// unmarshalling of structures as values.
TestClaimsMarshalledValue tests the marshalling and
unmarshalling of structures as values.
// TestClaimsMarshalledValue tests the marshalling and // unmarshalling of structures as values .
func TestClaimsMarshalledValue(t *testing.T) {
	assert := audit.NewTestingAssertion(t, true)
	assert.Logf("testing claims deep value unmarshalling")
	baz := []*nestedValue{
		{"one", 1},
		{"two", 2},
		{"three", 3},
	}
	claims := jwt.NewClaims()
	claims.Set("foo", "bar")
	claims.Set("baz", baz)
	jsonValue, err := json.Marshal(claims)
	assert.NotNil(jsonValue)
	assert.Nil(err)
	var unmarshalled jwt.Claims
	err = json.Unmarshal(jsonValue, &unmarshalled)
	assert.Nil(err)
	assert.Length(unmarshalled, 2)
	foo, ok := claims.Get("foo")
	assert.Equal(foo, "bar")
	assert.True(ok)
	var unmarshalledBaz []*nestedValue
	ok, err = claims.GetMarshalled("baz", &unmarshalledBaz)
	assert.True(ok)
	assert.Nil(err)
	assert.Length(unmarshalledBaz, 3)
	assert.Equal(unmarshalledBaz[0].Name, "one")
	assert.Equal(unmarshalledBaz[2].Value, 3)
}
func TestClaimsMarshalledValue ( t * testing . T ) { assert := audit . NewTestingAssertion ( t , true ) assert . Logf ( " " ) baz := [ ] * nestedValue { { " " , 1 } , { " " , 2 } , { " " , 3 } , } claims := jwt . NewClaims ( ) claims . Set ( " " , " " ) claims . Set ( " " , baz ) jsonValue , err := json . Marshal ( claims ) assert . NotNil ( jsonValue ) assert . Nil ( err ) var unmarshalled jwt . Claims err = json . Unmarshal ( jsonValue , & unmarshalled ) assert . Nil ( err ) assert . Length ( unmarshalled , 2 ) foo , ok := claims . Get ( " " ) assert . Equal ( foo , " " ) assert . True ( ok ) var unmarshalledBaz [ ] * nestedValue ok , err = claims . GetMarshalled ( " " , & unmarshalledBaz ) assert . True ( ok ) assert . Nil ( err ) assert . Length ( unmarshalledBaz , 3 ) assert . Equal ( unmarshalledBaz [ 0 ] . Name , " " ) assert . Equal ( unmarshalledBaz [ 2 ] . Value , 3 ) }
TestClaimsMarshalledValue tests the marshalling and
unmarshalling of structures as values.
TestClaimsMarshalledValue tests the marshalling and unmarshalling of structures as values .
// Now marshal and unmarshal the claims.