Skip to content

Commit

Permalink
Simplify tests
Browse files Browse the repository at this point in the history
  • Loading branch information
buger committed Feb 20, 2018
1 parent 17d79e1 commit af78691
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
7 changes: 0 additions & 7 deletions helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,13 +500,6 @@ func buildAPI(apiGens ...func(spec *APISpec)) (specs []*APISpec) {
panic(err)
}

spec.Health = &DefaultHealthChecker{
APIID: spec.APIID,
}
spec.AuthManager = &DefaultAuthorisationManager{}
spec.SessionManager = &DefaultSessionManager{}
spec.OrgSessionManager = &DefaultSessionManager{}

specs = append(specs, spec)
gen(spec)
}
Expand Down
9 changes: 1 addition & 8 deletions mw_jwt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (

"github.com/dgrijalva/jwt-go"

"github.com/TykTechnologies/tyk/storage"
"github.com/TykTechnologies/tyk/test"
"github.com/TykTechnologies/tyk/user"
)
Expand Down Expand Up @@ -342,7 +341,7 @@ func TestJWTSessionRSAWithRawSourceOnWithClientID(t *testing.T) {
ts := newTykTestServer()
defer ts.Close()

spec := buildAPI(func(spec *APISpec) {
spec := buildAndLoadAPI(func(spec *APISpec) {
spec.APIID = "777888"
spec.OrgID = "default"
spec.UseKeylessAccess = false
Expand All @@ -352,11 +351,6 @@ func TestJWTSessionRSAWithRawSourceOnWithClientID(t *testing.T) {
spec.JWTIdentityBaseField = "user_id"
spec.JWTClientIDBaseField = "azp"
spec.Proxy.ListenPath = "/"
tName := t.Name()
redisStore := storage.RedisCluster{KeyPrefix: tName + "-apikey."}
healthStore := storage.RedisCluster{KeyPrefix: tName + "-apihealth."}
orgStore := storage.RedisCluster{KeyPrefix: tName + "-orgKey."}
spec.Init(redisStore, redisStore, healthStore, orgStore)
})[0]

policyID := createPolicy(func(p *user.Policy) {
Expand All @@ -373,7 +367,6 @@ func TestJWTSessionRSAWithRawSourceOnWithClientID(t *testing.T) {
tokenID := "1234567891010101"
session := createJWTSessionWithRSAWithPolicy(policyID)

spec = loadAPI(spec)[0]
spec.SessionManager.ResetQuota(tokenID, session)
spec.SessionManager.UpdateSession(tokenID, session, 60)

Expand Down

0 comments on commit af78691

Please sign in to comment.