blob: 4fdf953826c38430693bd7a07c2d625d32c9d107 [file] [log] [blame]
Samuel A. Falvo II8a549ef2014-01-24 15:20:54 -08001package identity
2
3import (
4 "encoding/json"
5 "testing"
6)
7
8func TestAccessToken(t *testing.T) {
9 authResults := make(map[string]interface{})
10 err := json.Unmarshal([]byte(authResultsOK), &authResults)
11 if err != nil {
12 t.Error(err)
13 return
14 }
15
16 tok, err := Token(authResults)
17 if err != nil {
18 t.Error(err)
19 return
20 }
21 if tok.Id() != "ab48a9efdfedb23ty3494" {
22 t.Errorf("Expected token \"ab48a9efdfedb23ty3494\"; got \"%s\" instead", tok.Id())
23 return
24 }
25}