-
Notifications
You must be signed in to change notification settings - Fork 21
/
path_token_create_test.go
61 lines (50 loc) · 1.73 KB
/
path_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
54
55
56
57
58
59
60
61
package artifactory
import (
"testing"
)
func TestAcceptanceBackend_PathTokenCreate(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 role", accTestEnv.CreatePathRole)
t.Run("create admin role", accTestEnv.CreatePathAdminRole)
t.Run("create token for role", accTestEnv.CreatePathToken)
t.Run("create scoped down token for admin role", accTestEnv.CreatePathScopedDownToken)
t.Run("create scoped down token for admin role with bad scope", accTestEnv.CreatePathScopedDownTokenBadScope)
t.Run("delete role", accTestEnv.DeletePathRole)
t.Run("cleanup backend", accTestEnv.DeletePathConfig)
}
func TestAcceptanceBackend_PathTokenCreate_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 role", accTestEnv.CreatePathRole)
t.Run("create token for role", accTestEnv.CreatePathToken_overrides)
t.Run("delete role", accTestEnv.DeletePathRole)
t.Run("cleanup backend", accTestEnv.DeletePathConfig)
}
func TestAcceptanceBackend_PathTokenCreate_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 role", accTestEnv.CreatePathRole)
t.Run("create token for role", accTestEnv.CreatePathToken_no_access_token)
t.Run("delete role", accTestEnv.DeletePathRole)
t.Run("cleanup backend", accTestEnv.DeletePathConfig)
}