-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjwt_test.go
36 lines (27 loc) · 854 Bytes
/
jwt_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package frame
import (
"testing"
)
func TestService_RegisterForJwtWithParams(t *testing.T) {
t.Skip("Only run this test manually by uncommenting line")
oauthServiceURL := "http://localhost:4447"
clientName := "Testing CLI"
clientSecret := "topS3cret"
ctx, srv := NewService("Test Srv", Config(&ConfigurationDefault{
Oauth2ServiceAdminURI: oauthServiceURL,
}))
response, err := srv.RegisterForJwtWithParams(
ctx, oauthServiceURL, clientName, clientSecret,
"", []string{}, map[string]string{})
if err != nil {
t.Errorf("couldn't register for jwt %s", err)
return
}
srv.jwtClient = response
srv.L(ctx).WithField("client id", response).Info("successfully registered for Jwt")
err = srv.UnRegisterForJwt(ctx, oauthServiceURL, srv.JwtClientID())
if err != nil {
t.Errorf("couldn't un register for jwt %s", err)
return
}
}