vendor: update all dependencies

This commit is contained in:
Nick Craig-Wood 2017-07-23 08:51:42 +01:00
parent 0b6fba34a3
commit eb87cf6f12
2008 changed files with 352633 additions and 1004750 deletions

View file

@ -403,15 +403,15 @@ func TestFetchWithNoRefreshToken(t *testing.T) {
func TestRefreshToken_RefreshTokenReplacement(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
w.Write([]byte(`{"access_token":"ACCESS TOKEN", "scope": "user", "token_type": "bearer", "refresh_token": "NEW REFRESH TOKEN"}`))
w.Write([]byte(`{"access_token":"ACCESS_TOKEN", "scope": "user", "token_type": "bearer", "refresh_token": "NEW_REFRESH_TOKEN"}`))
return
}))
defer ts.Close()
conf := newConf(ts.URL)
tkr := tokenRefresher{
tkr := &tokenRefresher{
conf: conf,
ctx: context.Background(),
refreshToken: "OLD REFRESH TOKEN",
refreshToken: "OLD_REFRESH_TOKEN",
}
tk, err := tkr.Token()
if err != nil {
@ -423,6 +423,29 @@ func TestRefreshToken_RefreshTokenReplacement(t *testing.T) {
}
}
func TestRefreshToken_RefreshTokenPreservation(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
w.Write([]byte(`{"access_token":"ACCESS_TOKEN", "scope": "user", "token_type": "bearer"}`))
return
}))
defer ts.Close()
conf := newConf(ts.URL)
const oldRefreshToken = "OLD_REFRESH_TOKEN"
tkr := &tokenRefresher{
conf: conf,
ctx: context.Background(),
refreshToken: oldRefreshToken,
}
_, err := tkr.Token()
if err != nil {
t.Fatalf("got err = %v; want none", err)
}
if tkr.refreshToken != oldRefreshToken {
t.Errorf("tokenRefresher.refreshToken = %q; want %q", tkr.refreshToken, oldRefreshToken)
}
}
func TestConfigClientWithToken(t *testing.T) {
tok := &Token{
AccessToken: "abc123",