From 143eee528aefc90b116f5ac7fa325ec9d6b056cf Mon Sep 17 00:00:00 2001 From: "Aeneas Rekkas (arekkas)" Date: Wed, 14 Jun 2017 23:17:43 +0200 Subject: [PATCH] unstaged --- oauth2/fosite_store_test.go | 5 ----- oauth2/fosite_store_test_helpers.go | 19 ++++++++++--------- oauth2/oauth2_auth_code_test.go | 9 +++++---- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/oauth2/fosite_store_test.go b/oauth2/fosite_store_test.go index 003bdcb9e0..66b2a7d3a1 100644 --- a/oauth2/fosite_store_test.go +++ b/oauth2/fosite_store_test.go @@ -1,20 +1,15 @@ package oauth2 import ( - "context" "fmt" "os" "testing" - "time" "github.com/Sirupsen/logrus" "github.com/ory/fosite" "github.com/ory/hydra/client" "github.com/ory/hydra/integration" "github.com/ory/hydra/pkg" - "github.com/pborman/uuid" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) var clientManagers = map[string]pkg.FositeStorer{} diff --git a/oauth2/fosite_store_test_helpers.go b/oauth2/fosite_store_test_helpers.go index 9de902345c..9fadc83fde 100644 --- a/oauth2/fosite_store_test_helpers.go +++ b/oauth2/fosite_store_test_helpers.go @@ -4,14 +4,15 @@ import ( "context" "testing" - "github.com/ory/fosite" - "github.com/ory/hydra/pkg" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" "net/url" "time" + + "github.com/ory/fosite" "github.com/ory/hydra/client" + "github.com/ory/hydra/pkg" "github.com/pborman/uuid" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) var defaultRequest = fosite.Request{ @@ -40,8 +41,8 @@ func TestHelperCreateGetDeleteOpenIDConnectSession(m pkg.FositeStorer) func(t *t require.NoError(t, err) _, err = m.GetOpenIDConnectSession(ctx, "4321", &fosite.Request{}) - assert.NotNil(t, err) - } + assert.NotNil(t, err) + } } func TestHelperCreateGetDeleteRefreshTokenSession(m pkg.FositeStorer) func(t *testing.T) { @@ -61,9 +62,9 @@ func TestHelperCreateGetDeleteRefreshTokenSession(m pkg.FositeStorer) func(t *te require.NoError(t, err) _, err = m.GetRefreshTokenSession(ctx, "4321", &fosite.DefaultSession{}) - assert.NotNil(t, err) + assert.NotNil(t, err) } - + } func TestHelperRevokeRefreshToken(m pkg.FositeStorer) func(t *testing.T) { return func(t *testing.T) { @@ -89,7 +90,7 @@ func TestHelperRevokeRefreshToken(m pkg.FositeStorer) func(t *testing.T) { _, err = m.GetRefreshTokenSession(ctx, "1122", &fosite.DefaultSession{}) assert.NotNil(t, err) - + } } diff --git a/oauth2/oauth2_auth_code_test.go b/oauth2/oauth2_auth_code_test.go index 60d62715d0..782fa39e8a 100644 --- a/oauth2/oauth2_auth_code_test.go +++ b/oauth2/oauth2_auth_code_test.go @@ -8,6 +8,9 @@ import ( "net/http/cookiejar" + "net/url" + "strings" + "github.com/dgrijalva/jwt-go" "github.com/julienschmidt/httprouter" ejwt "github.com/ory/fosite/token/jwt" @@ -15,11 +18,9 @@ import ( . "github.com/ory/hydra/oauth2" "github.com/ory/hydra/pkg" "github.com/pkg/errors" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "golang.org/x/oauth2" - "github.com/stretchr/testify/assert" - "net/url" - "strings" ) func TestAuthCode(t *testing.T) { @@ -95,4 +96,4 @@ func testRefresh(t *testing.T, token *oauth2.Token) (*http.Response, error) { req.SetBasicAuth(oauthClientConfig.ClientID, oauthClientConfig.ClientSecret) return http.DefaultClient.Do(req) -} \ No newline at end of file +}