Skip to content

Commit 35e8342

Browse files
authoredMar 25, 2021
fix: add labels to examples (#97)
* fix(activity tracker): add labels to example output * fix(case management): add labels to example output * fix(configuration governance): add spaces between "\n" and "%s" in printf methods for easier readability * fix(enterprise billing units): add labels to example output * fix(enterprise usage report): add labels to example output * fix(global catalog): add labels to example output * fix(global search): add labels to example output * fix(global tagging): add labels to example output * fix(iam access groups): add labels to example output * fix(iam identity): add labels to example output * fix(iam policy management): add labels to example output * fix(open service broker): add labels to example output * fix(resource controller): add labels to example output * fix(resource manager): add labels to example output * fix(usage metering): add labels to example output * fix(usage reports): add labels to example output * fix(user management): add labels to example output * fix(attracker): fix labels in example output * fix(case management): fix labels in example output * fix(configuration governance): fix labels in example output * fix(enterprise billing units): fix labels in example output * fix(enterprise usage reports): fix labels in example output * fix(global catalog): fix labels in example output * fix(global search): fix labels in example output * fix(global tagging): fix labels in example output * fix(iam access groups): fix labels in example output * fix(iam identity): fix labels in example output * fix(iam policy management): fix labels in example output * fix(open service broker): fix labels in example output * fix(resource controller): fix labels in example output * fix(resource manager): fix labels in example output * fix(usage metering): fix labels in example output * fix(usage reports): fix labels in example output * fix(user management): fix labels in example output * fix(configuration governance): fix build fail
1 parent af50700 commit 35e8342

16 files changed

+130
-109
lines changed
 

‎atrackerv1/atracker_v1_examples_test.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ var _ = Describe(`AtrackerV1 Examples Tests`, func() {
115115
panic(err)
116116
}
117117
b, _ := json.MarshalIndent(target, "", " ")
118-
fmt.Println(string(b))
118+
fmt.Printf("\nCreateTarget() result:\n%s\n", string(b))
119119

120120
// end-create_target
121121

@@ -136,7 +136,7 @@ var _ = Describe(`AtrackerV1 Examples Tests`, func() {
136136
panic(err)
137137
}
138138
b, _ := json.MarshalIndent(targetList, "", " ")
139-
fmt.Println(string(b))
139+
fmt.Printf("\nListTargets() result:\n%s\n", string(b))
140140

141141
// end-list_targets
142142

@@ -157,7 +157,7 @@ var _ = Describe(`AtrackerV1 Examples Tests`, func() {
157157
panic(err)
158158
}
159159
b, _ := json.MarshalIndent(target, "", " ")
160-
fmt.Println(string(b))
160+
fmt.Printf("\nGetTarget() result:\n%s\n", string(b))
161161

162162
// end-get_target
163163

@@ -188,7 +188,7 @@ var _ = Describe(`AtrackerV1 Examples Tests`, func() {
188188
panic(err)
189189
}
190190
b, _ := json.MarshalIndent(target, "", " ")
191-
fmt.Println(string(b))
191+
fmt.Printf("\nReplaceTarget() result:\n%s\n", string(b))
192192

193193
// end-replace_target
194194

@@ -215,7 +215,7 @@ var _ = Describe(`AtrackerV1 Examples Tests`, func() {
215215
panic(err)
216216
}
217217
b, _ := json.MarshalIndent(route, "", " ")
218-
fmt.Println(string(b))
218+
fmt.Printf("\nCreateRoute() result:\n%s\n", string(b))
219219

220220
// end-create_route
221221

@@ -236,7 +236,7 @@ var _ = Describe(`AtrackerV1 Examples Tests`, func() {
236236
panic(err)
237237
}
238238
b, _ := json.MarshalIndent(routeList, "", " ")
239-
fmt.Println(string(b))
239+
fmt.Printf("\nListRoutes() result:\n%s\n", string(b))
240240

241241
// end-list_routes
242242

@@ -257,7 +257,7 @@ var _ = Describe(`AtrackerV1 Examples Tests`, func() {
257257
panic(err)
258258
}
259259
b, _ := json.MarshalIndent(route, "", " ")
260-
fmt.Println(string(b))
260+
fmt.Printf("\nGetRoute() result:\n%s\n", string(b))
261261

262262
// end-get_route
263263

@@ -285,7 +285,7 @@ var _ = Describe(`AtrackerV1 Examples Tests`, func() {
285285
panic(err)
286286
}
287287
b, _ := json.MarshalIndent(route, "", " ")
288-
fmt.Println(string(b))
288+
fmt.Printf("\nReplaceRoute() result:\n%s\n", string(b))
289289

290290
// end-replace_route
291291

@@ -305,7 +305,7 @@ var _ = Describe(`AtrackerV1 Examples Tests`, func() {
305305
if err != nil {
306306
panic(err)
307307
}
308-
308+
fmt.Printf("\nDeleteRoute() response status code: %d\n", response.StatusCode)
309309
// end-delete_route
310310

311311
Expect(err).To(BeNil())
@@ -323,7 +323,7 @@ var _ = Describe(`AtrackerV1 Examples Tests`, func() {
323323
if err != nil {
324324
panic(err)
325325
}
326-
326+
fmt.Printf("\nDeleteTarget() result status code: %d\n", response.StatusCode)
327327
// end-delete_target
328328

329329
Expect(err).To(BeNil())

‎casemanagementv1/case_management_v1_examples_test.go

+11-10
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ var _ = Describe(`CaseManagementV1 Examples Tests`, func() {
140140
panic(err)
141141
}
142142
b, _ := json.MarshalIndent(caseVar, "", " ")
143-
fmt.Println(string(b))
143+
fmt.Printf("\nCreateCase() result:\n%s\n", string(b))
144144

145145
// end-createCase
146146

@@ -172,7 +172,7 @@ var _ = Describe(`CaseManagementV1 Examples Tests`, func() {
172172
panic(err)
173173
}
174174
b, _ := json.MarshalIndent(caseVar, "", " ")
175-
fmt.Println(string(b))
175+
fmt.Printf("\nGetCase() result:\n%s\n", string(b))
176176

177177
// end-getCase
178178

@@ -195,7 +195,7 @@ var _ = Describe(`CaseManagementV1 Examples Tests`, func() {
195195
panic(err)
196196
}
197197
b, _ := json.MarshalIndent(caseList, "", " ")
198-
fmt.Println(string(b))
198+
fmt.Printf("\nGetCases() result:\n%s\n", string(b))
199199

200200
// end-getCases
201201

@@ -219,7 +219,7 @@ var _ = Describe(`CaseManagementV1 Examples Tests`, func() {
219219
panic(err)
220220
}
221221
b, _ := json.MarshalIndent(comment, "", " ")
222-
fmt.Println(string(b))
222+
fmt.Printf("\nAddComment() result:\n%s\n", string(b))
223223

224224
// end-addComment
225225

@@ -245,7 +245,7 @@ var _ = Describe(`CaseManagementV1 Examples Tests`, func() {
245245
panic(err)
246246
}
247247
b, _ := json.MarshalIndent(watchlistAddResponse, "", " ")
248-
fmt.Println(string(b))
248+
fmt.Printf("\nAddWatchlist() result:\n%s\n", string(b))
249249

250250
// end-addWatchlist
251251

@@ -271,7 +271,7 @@ var _ = Describe(`CaseManagementV1 Examples Tests`, func() {
271271
panic(err)
272272
}
273273
b, _ := json.MarshalIndent(watchlist, "", " ")
274-
fmt.Println(string(b))
274+
fmt.Printf("\nRemoveWatchlist() result:\n%s\n", string(b))
275275

276276
// end-removeWatchlist
277277

@@ -296,7 +296,7 @@ var _ = Describe(`CaseManagementV1 Examples Tests`, func() {
296296
panic(err)
297297
}
298298
b, _ := json.MarshalIndent(resource, "", " ")
299-
fmt.Println(string(b))
299+
fmt.Printf("\nAddResource() result:\n%s\n", string(b))
300300

301301
// end-addResource
302302

@@ -328,7 +328,7 @@ var _ = Describe(`CaseManagementV1 Examples Tests`, func() {
328328
panic(err)
329329
}
330330
b, _ := json.MarshalIndent(attachment, "", " ")
331-
fmt.Println(string(b))
331+
fmt.Printf("\nUploadFile() result:\n%s\n", string(b))
332332

333333
// end-uploadFile
334334

@@ -359,6 +359,7 @@ var _ = Describe(`CaseManagementV1 Examples Tests`, func() {
359359
buf := new(bytes.Buffer)
360360
buf.ReadFrom(result)
361361

362+
fmt.Println("\nDownloadFile() result:")
362363
fmt.Println("Attachment content-type: ", response.GetHeaders().Get("Content-Type"))
363364
fmt.Println("Attachment contents: ", buf.String())
364365
}
@@ -386,7 +387,7 @@ var _ = Describe(`CaseManagementV1 Examples Tests`, func() {
386387
panic(err)
387388
}
388389
b, _ := json.MarshalIndent(attachmentList, "", " ")
389-
fmt.Println(string(b))
390+
fmt.Printf("\nDeleteFile() result:\n%s\n", string(b))
390391

391392
// end-deleteFile
392393

@@ -416,7 +417,7 @@ var _ = Describe(`CaseManagementV1 Examples Tests`, func() {
416417
panic(err)
417418
}
418419
b, _ := json.MarshalIndent(caseVar, "", " ")
419-
fmt.Println(string(b))
420+
fmt.Printf("\nUpdateCaseStatus() result:\n%s\n", string(b))
420421

421422
// end-updateCaseStatus
422423

‎configurationgovernancev1/configuration_governance_v1_examples_test.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,7 @@ var _ = Describe(`ConfigurationGovernanceV1 Examples Tests`, func() {
440440
if err != nil {
441441
panic(err)
442442
}
443-
b, _ := json.MarshalIndent(response, "", " ")
444-
fmt.Printf("DeleteAttachment() response body:\n%s\n", string(b))
443+
fmt.Printf("DeleteAttachment() response status code: %d\n", response.StatusCode)
445444

446445
// end-delete_attachment
447446

@@ -459,8 +458,7 @@ var _ = Describe(`ConfigurationGovernanceV1 Examples Tests`, func() {
459458
if err != nil {
460459
panic(err)
461460
}
462-
b, _ := json.MarshalIndent(response, "", " ")
463-
fmt.Printf("DeleteRule() response body:\n%s\n", string(b))
461+
fmt.Printf("DeleteRule() response status code: %d\n", response.StatusCode)
464462

465463
// end-delete_rule
466464

‎enterprisebillingunitsv1/enterprise_billing_units_v1_examples_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ var _ = Describe(`EnterpriseBillingUnitsV1 Examples Tests`, func() {
126126
panic(err)
127127
}
128128
b, _ := json.MarshalIndent(billingUnit, "", " ")
129-
fmt.Println(string(b))
129+
fmt.Printf("\nGetBillingUnit() result:\n%s\n", string(b))
130130

131131
// end-get_billing_unit
132132

@@ -146,7 +146,7 @@ var _ = Describe(`EnterpriseBillingUnitsV1 Examples Tests`, func() {
146146
panic(err)
147147
}
148148
b, _ := json.MarshalIndent(billingUnitsList, "", " ")
149-
fmt.Println(string(b))
149+
fmt.Printf("\nListBillingUnits() result:\n%s\n", string(b))
150150

151151
// end-list_billing_units
152152

@@ -167,7 +167,7 @@ var _ = Describe(`EnterpriseBillingUnitsV1 Examples Tests`, func() {
167167
panic(err)
168168
}
169169
b, _ := json.MarshalIndent(billingOption, "", " ")
170-
fmt.Println(string(b))
170+
fmt.Printf("\nListBillingOptions() result:\n%s\n", string(b))
171171

172172
// end-list_billing_options
173173

@@ -188,7 +188,7 @@ var _ = Describe(`EnterpriseBillingUnitsV1 Examples Tests`, func() {
188188
panic(err)
189189
}
190190
b, _ := json.MarshalIndent(creditPoolsList, "", " ")
191-
fmt.Println(string(b))
191+
fmt.Printf("\nGetCreditPools() result:\n%s\n", string(b))
192192

193193
// end-get_credit_pools
194194

‎enterpriseusagereportsv1/enterprise_usage_reports_v1_examples_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ var _ = Describe(`EnterpriseUsageReportsV1 Examples Tests`, func() {
134134
panic(err)
135135
}
136136
b, _ := json.MarshalIndent(reports, "", " ")
137-
fmt.Println(string(b))
137+
fmt.Printf("\nGetResourceUsageReport() result:\n%s\n", string(b))
138138

139139
// end-get_resource_usage_report
140140

‎globalcatalogv1/global_catalog_v1_examples_test.go

+17-12
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
169169
panic(err)
170170
}
171171
b, _ := json.MarshalIndent(catalogEntry, "", " ")
172-
fmt.Println(string(b))
172+
fmt.Printf("\nCreateCatalogEntry() result:\n%s\n", string(b))
173173

174174
// end-create_catalog_entry
175175

@@ -193,7 +193,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
193193
panic(err)
194194
}
195195
b, _ := json.MarshalIndent(catalogEntry, "", " ")
196-
fmt.Println(string(b))
196+
fmt.Printf("\nGetCatalogEntry() result:\n%s\n", string(b))
197197

198198
// end-get_catalog_entry
199199

@@ -258,7 +258,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
258258
panic(err)
259259
}
260260
b, _ := json.MarshalIndent(catalogEntry, "", " ")
261-
fmt.Println(string(b))
261+
fmt.Printf("\nUpdateCatalogEntry() result:\n%s\n", string(b))
262262

263263
// end-update_catalog_entry
264264

@@ -281,7 +281,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
281281
panic(err)
282282
}
283283
b, _ := json.MarshalIndent(entrySearchResult, "", " ")
284-
fmt.Println(string(b))
284+
fmt.Printf("\nListCatalogEntries() result:\n%s\n", string(b))
285285

286286
// end-list_catalog_entries
287287

@@ -308,7 +308,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
308308
panic(err)
309309
}
310310
b, _ := json.MarshalIndent(entrySearchResult, "", " ")
311-
fmt.Println(string(b))
311+
fmt.Printf("\nGetChildObjects() result:\n%s\n", string(b))
312312

313313
// end-get_child_objects
314314

@@ -329,6 +329,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
329329
if err != nil {
330330
panic(err)
331331
}
332+
fmt.Printf("\nRestoreCatalogEntry() response status code: %d\n", response.StatusCode)
332333

333334
// end-restore_catalog_entry
334335

@@ -350,7 +351,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
350351
panic(err)
351352
}
352353
b, _ := json.MarshalIndent(visibility, "", " ")
353-
fmt.Println(string(b))
354+
fmt.Printf("\nGetVisibility() result:\n%s\n", string(b))
354355

355356
// end-get_visibility
356357

@@ -373,6 +374,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
373374
if err != nil {
374375
fmt.Println("UpdateVisibility() returned the following error: ", err.Error())
375376
}
377+
fmt.Printf("\nUpdateVisibility() response status code: %d\n: ", response.StatusCode)
376378

377379
// end-update_visibility
378380

@@ -393,7 +395,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
393395
panic(err)
394396
}
395397
b, _ := json.MarshalIndent(pricingGet, "", " ")
396-
fmt.Println(string(b))
398+
fmt.Printf("\nGetPricing() result:\n%s\n", string(b))
397399

398400
// end-get_pricing
399401

@@ -418,7 +420,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
418420
panic(err)
419421
}
420422
b, _ := json.MarshalIndent(auditSearchResult, "", " ")
421-
fmt.Println(string(b))
423+
fmt.Printf("\nGetAuditLogs() result:\n%s\n", string(b))
422424

423425
// end-get_audit_logs
424426

@@ -444,6 +446,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
444446
if err != nil {
445447
panic(err)
446448
}
449+
fmt.Printf("\nUploadArtifact() response status code: %d\n", response.StatusCode)
447450

448451
// end-upload_artifact
449452

@@ -468,8 +471,9 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
468471
defer result.Close()
469472
buf := new(bytes.Buffer)
470473
buf.ReadFrom(result)
471-
fmt.Println("Artifact content-type: ", response.GetHeaders().Get("Content-Type"))
472-
fmt.Println("Artifact contents: ", buf.String())
474+
fmt.Println("\nGetArtifact() result:")
475+
fmt.Printf("Artifact content-type: %s \n", response.GetHeaders().Get("Content-Type"))
476+
fmt.Printf("Artifact contents: %s \n", buf.String())
473477
}
474478

475479
// end-get_artifact
@@ -492,7 +496,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
492496
panic(err)
493497
}
494498
b, _ := json.MarshalIndent(artifacts, "", " ")
495-
fmt.Println(string(b))
499+
fmt.Printf("\nListArtifacts() result:\n%s\n", string(b))
496500

497501
// end-list_artifacts
498502

@@ -515,7 +519,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
515519
if err != nil {
516520
panic(err)
517521
}
518-
522+
fmt.Printf("\nDeleteArtifact() response status code: %d\n", response.StatusCode)
519523
// end-delete_artifact
520524

521525
Expect(err).To(BeNil())
@@ -535,6 +539,7 @@ var _ = Describe(`GlobalCatalogV1 Examples Tests`, func() {
535539
if err != nil {
536540
panic(err)
537541
}
542+
fmt.Printf("\nDeleteCatalogEntry() response status code: %d\n", response.StatusCode)
538543

539544
// end-delete_catalog_entry
540545

0 commit comments

Comments
 (0)
Please sign in to comment.