@@ -69,7 +69,7 @@ func TestAPITeam(t *testing.T) {
69
69
resp = session .MakeRequest (t , req , http .StatusCreated )
70
70
apiTeam = api.Team {}
71
71
DecodeJSON (t , resp , & apiTeam )
72
- checkTeamResponse (t , & apiTeam , teamToCreate .Name , teamToCreate .Description , teamToCreate .IncludesAllRepositories ,
72
+ checkTeamResponse (t , "CreateTeam1" , & apiTeam , teamToCreate .Name , teamToCreate .Description , teamToCreate .IncludesAllRepositories ,
73
73
teamToCreate .Permission , teamToCreate .Units , nil )
74
74
checkTeamBean (t , apiTeam .ID , teamToCreate .Name , teamToCreate .Description , teamToCreate .IncludesAllRepositories ,
75
75
teamToCreate .Permission , teamToCreate .Units , nil )
@@ -90,7 +90,7 @@ func TestAPITeam(t *testing.T) {
90
90
resp = session .MakeRequest (t , req , http .StatusOK )
91
91
apiTeam = api.Team {}
92
92
DecodeJSON (t , resp , & apiTeam )
93
- checkTeamResponse (t , & apiTeam , teamToEdit .Name , * teamToEdit .Description , * teamToEdit .IncludesAllRepositories ,
93
+ checkTeamResponse (t , "EditTeam1" , & apiTeam , teamToEdit .Name , * teamToEdit .Description , * teamToEdit .IncludesAllRepositories ,
94
94
teamToEdit .Permission , unit .AllUnitKeyNames (), nil )
95
95
checkTeamBean (t , apiTeam .ID , teamToEdit .Name , * teamToEdit .Description , * teamToEdit .IncludesAllRepositories ,
96
96
teamToEdit .Permission , unit .AllUnitKeyNames (), nil )
@@ -102,7 +102,7 @@ func TestAPITeam(t *testing.T) {
102
102
resp = session .MakeRequest (t , req , http .StatusOK )
103
103
apiTeam = api.Team {}
104
104
DecodeJSON (t , resp , & apiTeam )
105
- checkTeamResponse (t , & apiTeam , teamToEdit .Name , * teamToEditDesc .Description , * teamToEdit .IncludesAllRepositories ,
105
+ checkTeamResponse (t , "EditTeam1_DescOnly" , & apiTeam , teamToEdit .Name , * teamToEditDesc .Description , * teamToEdit .IncludesAllRepositories ,
106
106
teamToEdit .Permission , unit .AllUnitKeyNames (), nil )
107
107
checkTeamBean (t , apiTeam .ID , teamToEdit .Name , * teamToEditDesc .Description , * teamToEdit .IncludesAllRepositories ,
108
108
teamToEdit .Permission , unit .AllUnitKeyNames (), nil )
@@ -114,7 +114,7 @@ func TestAPITeam(t *testing.T) {
114
114
resp = session .MakeRequest (t , req , http .StatusOK )
115
115
apiTeam = api.Team {}
116
116
DecodeJSON (t , resp , & apiTeam )
117
- checkTeamResponse (t , & apiTeam , teamRead .Name , * teamToEditDesc .Description , teamRead .IncludesAllRepositories ,
117
+ checkTeamResponse (t , "ReadTeam1" , & apiTeam , teamRead .Name , * teamToEditDesc .Description , teamRead .IncludesAllRepositories ,
118
118
teamRead .AccessMode .String (), teamRead .GetUnitNames (), teamRead .GetUnitsMap ())
119
119
120
120
// Delete team.
@@ -135,7 +135,7 @@ func TestAPITeam(t *testing.T) {
135
135
resp = session .MakeRequest (t , req , http .StatusCreated )
136
136
apiTeam = api.Team {}
137
137
DecodeJSON (t , resp , & apiTeam )
138
- checkTeamResponse (t , & apiTeam , teamToCreate .Name , teamToCreate .Description , teamToCreate .IncludesAllRepositories ,
138
+ checkTeamResponse (t , "CreateTeam2" , & apiTeam , teamToCreate .Name , teamToCreate .Description , teamToCreate .IncludesAllRepositories ,
139
139
"read" , nil , teamToCreate .UnitsMap )
140
140
checkTeamBean (t , apiTeam .ID , teamToCreate .Name , teamToCreate .Description , teamToCreate .IncludesAllRepositories ,
141
141
"read" , nil , teamToCreate .UnitsMap )
@@ -156,7 +156,7 @@ func TestAPITeam(t *testing.T) {
156
156
resp = session .MakeRequest (t , req , http .StatusOK )
157
157
apiTeam = api.Team {}
158
158
DecodeJSON (t , resp , & apiTeam )
159
- checkTeamResponse (t , & apiTeam , teamToEdit .Name , * teamToEdit .Description , * teamToEdit .IncludesAllRepositories ,
159
+ checkTeamResponse (t , "EditTeam2" , & apiTeam , teamToEdit .Name , * teamToEdit .Description , * teamToEdit .IncludesAllRepositories ,
160
160
"read" , nil , teamToEdit .UnitsMap )
161
161
checkTeamBean (t , apiTeam .ID , teamToEdit .Name , * teamToEdit .Description , * teamToEdit .IncludesAllRepositories ,
162
162
"read" , nil , teamToEdit .UnitsMap )
@@ -168,7 +168,7 @@ func TestAPITeam(t *testing.T) {
168
168
resp = session .MakeRequest (t , req , http .StatusOK )
169
169
apiTeam = api.Team {}
170
170
DecodeJSON (t , resp , & apiTeam )
171
- checkTeamResponse (t , & apiTeam , teamToEdit .Name , * teamToEditDesc .Description , * teamToEdit .IncludesAllRepositories ,
171
+ checkTeamResponse (t , "EditTeam2_DescOnly" , & apiTeam , teamToEdit .Name , * teamToEditDesc .Description , * teamToEdit .IncludesAllRepositories ,
172
172
"read" , nil , teamToEdit .UnitsMap )
173
173
checkTeamBean (t , apiTeam .ID , teamToEdit .Name , * teamToEditDesc .Description , * teamToEdit .IncludesAllRepositories ,
174
174
"read" , nil , teamToEdit .UnitsMap )
@@ -180,7 +180,7 @@ func TestAPITeam(t *testing.T) {
180
180
apiTeam = api.Team {}
181
181
DecodeJSON (t , resp , & apiTeam )
182
182
assert .NoError (t , teamRead .GetUnits ())
183
- checkTeamResponse (t , & apiTeam , teamRead .Name , * teamToEditDesc .Description , teamRead .IncludesAllRepositories ,
183
+ checkTeamResponse (t , "ReadTeam2" , & apiTeam , teamRead .Name , * teamToEditDesc .Description , teamRead .IncludesAllRepositories ,
184
184
teamRead .AccessMode .String (), teamRead .GetUnitNames (), teamRead .GetUnitsMap ())
185
185
186
186
// Delete team.
@@ -189,8 +189,8 @@ func TestAPITeam(t *testing.T) {
189
189
unittest .AssertNotExistsBean (t , & organization.Team {ID : teamID })
190
190
}
191
191
192
- func checkTeamResponse (t * testing.T , apiTeam * api.Team , name , description string , includesAllRepositories bool , permission string , units []string , unitsMap map [string ]string ) {
193
- t .Run (name + description , func (t * testing.T ) {
192
+ func checkTeamResponse (t * testing.T , testName string , apiTeam * api.Team , name , description string , includesAllRepositories bool , permission string , units []string , unitsMap map [string ]string ) {
193
+ t .Run (testName , func (t * testing.T ) {
194
194
assert .Equal (t , name , apiTeam .Name , "name" )
195
195
assert .Equal (t , description , apiTeam .Description , "description" )
196
196
assert .Equal (t , includesAllRepositories , apiTeam .IncludesAllRepositories , "includesAllRepositories" )
@@ -209,7 +209,9 @@ func checkTeamResponse(t *testing.T, apiTeam *api.Team, name, description string
209
209
func checkTeamBean (t * testing.T , id int64 , name , description string , includesAllRepositories bool , permission string , units []string , unitsMap map [string ]string ) {
210
210
team := unittest .AssertExistsAndLoadBean (t , & organization.Team {ID : id }).(* organization.Team )
211
211
assert .NoError (t , team .GetUnits (), "GetUnits" )
212
- checkTeamResponse (t , convert .ToTeam (team ), name , description , includesAllRepositories , permission , units , unitsMap )
212
+ apiTeam , err := convert .ToTeam (team )
213
+ assert .NoError (t , err )
214
+ checkTeamResponse (t , fmt .Sprintf ("checkTeamBean/%s_%s" , name , description ), apiTeam , name , description , includesAllRepositories , permission , units , unitsMap )
213
215
}
214
216
215
217
type TeamSearchResults struct {
0 commit comments