-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathpath_user_token_create_test.go
53 lines (42 loc) · 1.31 KB
/
path_user_token_create_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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package artifactory
import (
"testing"
)
func TestAcceptanceBackend_PathUserTokenCreate(t *testing.T) {
if !runAcceptanceTests {
t.SkipNow()
}
accTestEnv, err := newAcceptanceTestEnv()
if err != nil {
t.Fatal(err)
}
t.Run("configure backend", accTestEnv.UpdatePathConfig)
t.Run("create token for admin user", accTestEnv.CreatePathUserToken)
t.Run("cleanup backend", accTestEnv.DeletePathConfig)
}
func TestAcceptanceBackend_PathUserTokenCreate_overrides(t *testing.T) {
if !runAcceptanceTests {
t.SkipNow()
}
accTestEnv, err := newAcceptanceTestEnv()
if err != nil {
t.Fatal(err)
}
t.Run("configure backend", accTestEnv.UpdatePathConfig)
t.Run("create token for user", accTestEnv.CreatePathUserToken_overrides)
t.Run("create token for user with bad scope", accTestEnv.CreatePathUserToken_BadScope)
t.Run("cleanup backend", accTestEnv.DeletePathConfig)
}
func TestAcceptanceBackend_PathUserTokenCreate_no_access_token(t *testing.T) {
if !runAcceptanceTests {
t.SkipNow()
}
accTestEnv, err := newAcceptanceTestEnv()
if err != nil {
t.Fatal(err)
}
accTestEnv.AccessToken = ""
t.Run("configure backend with no access token", accTestEnv.UpdatePathConfig)
t.Run("create token for admin user", accTestEnv.CreatePathUserToken_no_access_token)
t.Run("cleanup backend", accTestEnv.DeletePathConfig)
}