Skip to content

Commit

Permalink
unstaged
Browse files Browse the repository at this point in the history
  • Loading branch information
Aeneas Rekkas (arekkas) committed Jun 14, 2017
1 parent 889c6b8 commit 143eee5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
5 changes: 0 additions & 5 deletions 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{}
Expand Down
19 changes: 10 additions & 9 deletions oauth2/fosite_store_test_helpers.go
Expand Up @@ -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{
Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -89,7 +90,7 @@ func TestHelperRevokeRefreshToken(m pkg.FositeStorer) func(t *testing.T) {

_, err = m.GetRefreshTokenSession(ctx, "1122", &fosite.DefaultSession{})
assert.NotNil(t, err)

}

}
Expand Down
9 changes: 5 additions & 4 deletions oauth2/oauth2_auth_code_test.go
Expand Up @@ -8,18 +8,19 @@ import (

"net/http/cookiejar"

"net/url"
"strings"

"github.com/dgrijalva/jwt-go"
"github.com/julienschmidt/httprouter"
ejwt "github.com/ory/fosite/token/jwt"
"github.com/ory/hydra/jwk"
. "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) {
Expand Down Expand Up @@ -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)
}
}

0 comments on commit 143eee5

Please sign in to comment.