blob: 4fdf953826c38430693bd7a07c2d625d32c9d107 [file] [log] [blame]
package identity
import (
"encoding/json"
"testing"
)
func TestAccessToken(t *testing.T) {
authResults := make(map[string]interface{})
err := json.Unmarshal([]byte(authResultsOK), &authResults)
if err != nil {
t.Error(err)
return
}
tok, err := Token(authResults)
if err != nil {
t.Error(err)
return
}
if tok.Id() != "ab48a9efdfedb23ty3494" {
t.Errorf("Expected token \"ab48a9efdfedb23ty3494\"; got \"%s\" instead", tok.Id())
return
}
}