File tree 2 files changed +58
-2
lines changed
2 files changed +58
-2
lines changed Original file line number Diff line number Diff line change 1
1
test :
2
2
./run-tests.sh
3
3
4
- start-keycloak :
4
+ start-keycloak : stop-keycloak
5
+ docker-compose up -d
6
+
7
+ stop-keycloak :
5
8
docker-compose down
6
- docker-compose up -d
Original file line number Diff line number Diff line change @@ -46,3 +46,57 @@ func BenchmarkLoginParallel(b *testing.B) {
46
46
}
47
47
})
48
48
}
49
+
50
+ func BenchmarkGetGroups (b * testing.B ) {
51
+ cfg := GetConfig (b )
52
+ client := gocloak .NewClient (cfg .HostName )
53
+ token := GetAdminToken (b , client )
54
+ b .ResetTimer ()
55
+ for i := 0 ; i < b .N ; i ++ {
56
+ _ , err := client .GetGroups (
57
+ context .Background (),
58
+ token .AccessToken ,
59
+ cfg .GoCloak .Realm ,
60
+ gocloak.GetGroupsParams {},
61
+ )
62
+ assert .NoError (b , err )
63
+ }
64
+ }
65
+
66
+ func BenchmarkGetGroupsFull (b * testing.B ) {
67
+ cfg := GetConfig (b )
68
+ client := gocloak .NewClient (cfg .HostName )
69
+ token := GetAdminToken (b , client )
70
+ params := gocloak.GetGroupsParams {
71
+ Full : gocloak .BoolP (true ),
72
+ }
73
+ b .ResetTimer ()
74
+ for i := 0 ; i < b .N ; i ++ {
75
+ _ , err := client .GetGroups (
76
+ context .Background (),
77
+ token .AccessToken ,
78
+ cfg .GoCloak .Realm ,
79
+ params ,
80
+ )
81
+ assert .NoError (b , err )
82
+ }
83
+ }
84
+
85
+ func BenchmarkGetGroupsBrief (b * testing.B ) {
86
+ cfg := GetConfig (b )
87
+ client := gocloak .NewClient (cfg .HostName )
88
+ params := gocloak.GetGroupsParams {
89
+ BriefRepresentation : gocloak .BoolP (true ),
90
+ }
91
+ token := GetAdminToken (b , client )
92
+ b .ResetTimer ()
93
+ for i := 0 ; i < b .N ; i ++ {
94
+ _ , err := client .GetGroups (
95
+ context .Background (),
96
+ token .AccessToken ,
97
+ cfg .GoCloak .Realm ,
98
+ params ,
99
+ )
100
+ assert .NoError (b , err )
101
+ }
102
+ }
You can’t perform that action at this time.
0 commit comments