@@ -69,7 +69,7 @@ func TestAPITeam(t *testing.T) {
6969 resp = session .MakeRequest (t , req , http .StatusCreated )
7070 apiTeam = api.Team {}
7171 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 ,
7373 teamToCreate .Permission , teamToCreate .Units , nil )
7474 checkTeamBean (t , apiTeam .ID , teamToCreate .Name , teamToCreate .Description , teamToCreate .IncludesAllRepositories ,
7575 teamToCreate .Permission , teamToCreate .Units , nil )
@@ -90,7 +90,7 @@ func TestAPITeam(t *testing.T) {
9090 resp = session .MakeRequest (t , req , http .StatusOK )
9191 apiTeam = api.Team {}
9292 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 ,
9494 teamToEdit .Permission , unit .AllUnitKeyNames (), nil )
9595 checkTeamBean (t , apiTeam .ID , teamToEdit .Name , * teamToEdit .Description , * teamToEdit .IncludesAllRepositories ,
9696 teamToEdit .Permission , unit .AllUnitKeyNames (), nil )
@@ -102,7 +102,7 @@ func TestAPITeam(t *testing.T) {
102102 resp = session .MakeRequest (t , req , http .StatusOK )
103103 apiTeam = api.Team {}
104104 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 ,
106106 teamToEdit .Permission , unit .AllUnitKeyNames (), nil )
107107 checkTeamBean (t , apiTeam .ID , teamToEdit .Name , * teamToEditDesc .Description , * teamToEdit .IncludesAllRepositories ,
108108 teamToEdit .Permission , unit .AllUnitKeyNames (), nil )
@@ -114,7 +114,7 @@ func TestAPITeam(t *testing.T) {
114114 resp = session .MakeRequest (t , req , http .StatusOK )
115115 apiTeam = api.Team {}
116116 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 ,
118118 teamRead .AccessMode .String (), teamRead .GetUnitNames (), teamRead .GetUnitsMap ())
119119
120120 // Delete team.
@@ -135,7 +135,7 @@ func TestAPITeam(t *testing.T) {
135135 resp = session .MakeRequest (t , req , http .StatusCreated )
136136 apiTeam = api.Team {}
137137 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 ,
139139 "read" , nil , teamToCreate .UnitsMap )
140140 checkTeamBean (t , apiTeam .ID , teamToCreate .Name , teamToCreate .Description , teamToCreate .IncludesAllRepositories ,
141141 "read" , nil , teamToCreate .UnitsMap )
@@ -156,7 +156,7 @@ func TestAPITeam(t *testing.T) {
156156 resp = session .MakeRequest (t , req , http .StatusOK )
157157 apiTeam = api.Team {}
158158 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 ,
160160 "read" , nil , teamToEdit .UnitsMap )
161161 checkTeamBean (t , apiTeam .ID , teamToEdit .Name , * teamToEdit .Description , * teamToEdit .IncludesAllRepositories ,
162162 "read" , nil , teamToEdit .UnitsMap )
@@ -168,7 +168,7 @@ func TestAPITeam(t *testing.T) {
168168 resp = session .MakeRequest (t , req , http .StatusOK )
169169 apiTeam = api.Team {}
170170 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 ,
172172 "read" , nil , teamToEdit .UnitsMap )
173173 checkTeamBean (t , apiTeam .ID , teamToEdit .Name , * teamToEditDesc .Description , * teamToEdit .IncludesAllRepositories ,
174174 "read" , nil , teamToEdit .UnitsMap )
@@ -180,7 +180,7 @@ func TestAPITeam(t *testing.T) {
180180 apiTeam = api.Team {}
181181 DecodeJSON (t , resp , & apiTeam )
182182 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 ,
184184 teamRead .AccessMode .String (), teamRead .GetUnitNames (), teamRead .GetUnitsMap ())
185185
186186 // Delete team.
@@ -189,8 +189,8 @@ func TestAPITeam(t *testing.T) {
189189 unittest .AssertNotExistsBean (t , & organization.Team {ID : teamID })
190190}
191191
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 ) {
194194 assert .Equal (t , name , apiTeam .Name , "name" )
195195 assert .Equal (t , description , apiTeam .Description , "description" )
196196 assert .Equal (t , includesAllRepositories , apiTeam .IncludesAllRepositories , "includesAllRepositories" )
@@ -209,7 +209,9 @@ func checkTeamResponse(t *testing.T, apiTeam *api.Team, name, description string
209209func checkTeamBean (t * testing.T , id int64 , name , description string , includesAllRepositories bool , permission string , units []string , unitsMap map [string ]string ) {
210210 team := unittest .AssertExistsAndLoadBean (t , & organization.Team {ID : id }).(* organization.Team )
211211 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 )
213215}
214216
215217type TeamSearchResults struct {
0 commit comments