• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moosetechnology / GitProjectHealth / 17205053242

25 Aug 2025 09:35AM UTC coverage: 73.156% (-0.07%) from 73.223%
17205053242

Pull #222

github

web-flow
Merge e741bfeb8 into 28e7c6e1e
Pull Request #222: `importBranchesOf:` is required when performing the full metric analysis

0 of 23 new or added lines in 1 file covered. (0.0%)

33 existing lines in 2 files now uncovered.

18461 of 25235 relevant lines covered (73.16%)

0.73 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

98.55
/src/BitBucketHealth-Model-Importer-Tests/BitBucketApiMock.class.st
1
Class {
2
        #name : #BitBucketApiMock,
3
        #superclass : #Object,
4
        #instVars : [
5
                'userMock',
6
                'commitsMock',
7
                'diffs',
8
                'mergeRequests'
9
        ],
10
        #category : #'BitBucketHealth-Model-Importer-Tests'
11
}
12

13
{ #category : #'mock - commits' }
14
BitBucketApiMock >> commit2 [
1✔
15

1✔
16
        | commits2 |
1✔
17
        commits2 := '
1✔
18
    {
1✔
19
      "id": "abcdef0123abcdef4567abcdef8987abcdef6543",
1✔
20
                "message": "message test",
1✔
21
      "displayId": "abcdef0123a",
1✔
22
      "author": {
1✔
23
        "name": "charlie",
1✔
24
        "emailAddress": "charlie@example.com"
1✔
25
      },
1✔
26
      "authorTimestamp": 1727168151000,
1✔
27
      "committer": {
1✔
28
        "name": "charlie",
1✔
29
        "emailAddress": "charlie@example.com"
1✔
30
      },
1✔
31
      "committerTimestamp": 1727168151000,
1✔
32
      "message": "WIP on feature 1",
1✔
33
      "parents": [
1✔
34
        {
1✔
35
          "id": "abcdef0123abcdef4567abcdef8987abcdef6543",
1✔
36
          "displayId": "abcdef0"
1✔
37
        }
1✔
38
      ]
1✔
39
    }
1✔
40
  '.
1✔
41

1✔
42
        ^ commits2 := (NeoJSONReader on: commits2 readStream) next
1✔
43
]
1✔
44

45
{ #category : #ressources }
46
BitBucketApiMock >> commits [
1✔
47

1✔
48
        ^ BitBucketCommitsMock new commitsMock: commitsMock; diffs: diffs.
1✔
49
]
1✔
50

51
{ #category : #'mock - commits' }
52
BitBucketApiMock >> commits1 [
1✔
53

1✔
54
        | commits1 |
1✔
55
        commits1 := '[
1✔
56
    {
1✔
57
      "id": "abcdef0123abcdef4567abcdef8987abcdef6543",
1✔
58
                "message": "message test",
1✔
59
      "displayId": "abcdef0123a",
1✔
60
      "author": {
1✔
61
        "name": "charlie",
1✔
62
        "emailAddress": "charlie@example.com"
1✔
63
      },
1✔
64
      "authorTimestamp": 1727168151000,
1✔
65
      "committer": {
1✔
66
        "name": "charlie",
1✔
67
        "emailAddress": "charlie@example.com"
1✔
68
      },
1✔
69
      "committerTimestamp": 1727168151000,
1✔
70
      "message": "WIP on feature 1",
1✔
71
      "parents": [
1✔
72
        {
1✔
73
          "id": "abcdef0123abcdef4567abcdef8987abcdef6543",
1✔
74
          "displayId": "abcdef0"
1✔
75
        }
1✔
76
      ]
1✔
77
    }
1✔
78
  ]'.
1✔
79

1✔
80
        ^ commits1 := (NeoJSONReader on: commits1 readStream) next
1✔
81
]
1✔
82

83
{ #category : #'mock - commits' }
84
BitBucketApiMock >> commitsMock [
1✔
85

1✔
86
        ^ commitsMock
1✔
87
]
1✔
88

89
{ #category : #'mock - commits' }
90
BitBucketApiMock >> commitsMock: anObject [
1✔
91

1✔
92
        commitsMock := anObject
1✔
93
]
1✔
94

95
{ #category : #'mock - mergeRequests' }
96
BitBucketApiMock >> declinedMergeRequest [
1✔
97

1✔
98
        | pullRequest |
1✔
99
        pullRequest := '{
1✔
100
      "id": 539,
1✔
101
      "version": 10,
1✔
102
      "title": "title",
1✔
103
      "state": "DECLINED",
1✔
104
      "open": false,
1✔
105
      "closed": true,
1✔
106
                  "createdDate": 1721396425473,
1✔
107
                  "updatedDate": 1721457513310,
1✔
108
                  "closedDate": 1721457513310,
1✔
109
      "fromRef": {
1✔
110
        "id": "refs/heads/wip/1",
1✔
111
        "displayId": "wip/1",
1✔
112
        "latestCommit": "2",
1✔
113
        "repository": {
1✔
114
          "slug": "repoSlug",
1✔
115
          "id": 242,
1✔
116
          "name": "repo-name",
1✔
117
          "scmId": "git",
1✔
118
          "state": "AVAILABLE",
1✔
119
          "statusMessage": "Available",
1✔
120
          "forkable": true,
1✔
121
          "project": {
1✔
122
            "key": "project-key",
1✔
123
            "id": 242,
1✔
124
            "name": "project-name",
1✔
125
            "description": "project description",
1✔
126
            "public": true,
1✔
127
            "type": "NORMAL",
1✔
128
            "links": {
1✔
129
              "self": [
1✔
130
                {
1✔
131
                  "href": "link"
1✔
132
                }
1✔
133
              ]
1✔
134
            }
1✔
135
          },
1✔
136
          "public": false,
1✔
137
          "links": {
1✔
138
            "clone": [
1✔
139
              {
1✔
140
                "href": "clone",
1✔
141
                "name": "ssh"
1✔
142
              },
1✔
143
              {
1✔
144
                "href": "clone",
1✔
145
                "name": "http"
1✔
146
              }
1✔
147
            ],
1✔
148
            "self": [
1✔
149
              {
1✔
150
                "href": "link"
1✔
151
              }
1✔
152
            ]
1✔
153
          }
1✔
154
        }
1✔
155
      },
1✔
156
      "toRef": {
1✔
157
        "id": "refs/heads/develop/trunk",
1✔
158
        "displayId": "develop/trunk",
1✔
159
        "latestCommit": "3",
1✔
160
        "repository": {
1✔
161
          "slug": "repo-slug",
1✔
162
          "id": 242,
1✔
163
          "name": "repo-name",
1✔
164
          "scmId": "git",
1✔
165
          "state": "AVAILABLE",
1✔
166
          "statusMessage": "Available",
1✔
167
          "forkable": true,
1✔
168
          "project": {
1✔
169
            "key": "project-key",
1✔
170
            "id": 242,
1✔
171
            "name": "project-name",
1✔
172
            "description": "description",
1✔
173
            "public": true,
1✔
174
            "type": "NORMAL",
1✔
175
            "links": {
1✔
176
              "self": [
1✔
177
                {
1✔
178
                  "href": "link"
1✔
179
                }
1✔
180
              ]
1✔
181
            }
1✔
182
          },
1✔
183
          "public": false,
1✔
184
          "links": {
1✔
185
            "clone": [
1✔
186
              {
1✔
187
                "href": "link",
1✔
188
                "name": "ssh"
1✔
189
              },
1✔
190
              {
1✔
191
                "href": "link-http",
1✔
192
                "name": "http"
1✔
193
              }
1✔
194
            ],
1✔
195
            "self": [
1✔
196
              {
1✔
197
                "href": "link-self"
1✔
198
              }
1✔
199
            ]
1✔
200
          }
1✔
201
        }
1✔
202
      },
1✔
203
      "locked": false,
1✔
204
      "author": {
1✔
205
        "user": {
1✔
206
          "name": "user-name",
1✔
207
          "id": 1,
1✔
208
          "displayName": "user-display-name",
1✔
209
          "active": false,
1✔
210
          "slug": "user-slug",
1✔
211
          "type": "NORMAL",
1✔
212
          "links": {
1✔
213
            "self": [
1✔
214
              {
1✔
215
                "href": "link-self"
1✔
216
              }
1✔
217
            ]
1✔
218
          }
1✔
219
        },
1✔
220
        "role": "AUTHOR",
1✔
221
        "approved": false,
1✔
222
        "status": "UNAPPROVED"
1✔
223
      },
1✔
224
      "reviewers": [
1✔
225
        {
1✔
226
          "user": {
1✔
227
            "name": "reviewer-name",
1✔
228
            "emailAddress": "reviewer@email.com",
1✔
229
            "id": 1713,
1✔
230
            "displayName": "reviewer-display-name",
1✔
231
            "active": true,
1✔
232
            "slug": "reviewer-slug",
1✔
233
            "type": "NORMAL",
1✔
234
            "links": {
1✔
235
              "self": [
1✔
236
                {
1✔
237
                  "href": "link-self"
1✔
238
                }
1✔
239
              ]
1✔
240
            }
1✔
241
          },
1✔
242
          "lastReviewedCommit": "2",
1✔
243
          "role": "REVIEWER",
1✔
244
          "approved": true,
1✔
245
          "status": "APPROVED"
1✔
246
        },
1✔
247
        {
1✔
248
          "user": {
1✔
249
            "name": "reveiwer2-name",
1✔
250
            "emailAddress": "reviewer2@email.com",
1✔
251
            "id": 49,
1✔
252
            "displayName": "reviewer2 display name",
1✔
253
            "active": true,
1✔
254
            "slug": "reviewer2-slug",
1✔
255
            "type": "NORMAL",
1✔
256
            "links": {
1✔
257
              "self": [
1✔
258
                {
1✔
259
                  "href": "link-self"
1✔
260
                }
1✔
261
              ]
1✔
262
            }
1✔
263
          },
1✔
264
          "role": "REVIEWER",
1✔
265
          "approved": false,
1✔
266
          "status": "UNAPPROVED"
1✔
267
        }
1✔
268
      ],
1✔
269
      "participants": [],
1✔
270
      "properties": {
1✔
271
        "mergeResult": {
1✔
272
          "outcome": "CONFLICTED",
1✔
273
          "current": true
1✔
274
        },
1✔
275
        "resolvedTaskCount": 0,
1✔
276
        "commentCount": 4,
1✔
277
        "openTaskCount": 0
1✔
278
      },
1✔
279
      "links": {
1✔
280
        "self": [
1✔
281
          {
1✔
282
            "href": "link"
1✔
283
          }
1✔
284
        ]
1✔
285
      }
1✔
286
    }'.
1✔
287

1✔
288
        ^ pullRequest := (NeoJSONReader on: pullRequest readStream) next
1✔
289
]
1✔
290

291
{ #category : #'mock - diffs' }
292
BitBucketApiMock >> diffs [
1✔
293

1✔
294
        ^ diffs
1✔
295
]
1✔
296

297
{ #category : #'mock - diffs' }
298
BitBucketApiMock >> diffs1 [
1✔
299

1✔
300
        | diffs1 |
1✔
301
        diffs1 := '{
1✔
302
  "fromHash": null,
1✔
303
  "toHash": "123",
1✔
304
  "contextLines": 10,
1✔
305
  "whitespace": "SHOW",
1✔
306
  "diffs": [
1✔
307
    {
1✔
308
      "source": {
1✔
309
        "components": [
1✔
310
          "build.gradle"
1✔
311
        ],
1✔
312
        "parent": "",
1✔
313
        "name": "build.gradle",
1✔
314
        "extension": "gradle",
1✔
315
        "toString": "build.gradle"
1✔
316
      },
1✔
317
      "destination": {
1✔
318
        "components": [
1✔
319
          "build.gradle"
1✔
320
        ],
1✔
321
        "parent": "",
1✔
322
        "name": "build.gradle",
1✔
323
        "extension": "gradle",
1✔
324
        "toString": "build.gradle"
1✔
325
      },
1✔
326
      "hunks": [
1✔
327
        {
1✔
328
          "sourceLine": 1,
1✔
329
          "sourceSpan": 14,
1✔
330
          "destinationLine": 1,
1✔
331
          "destinationSpan": 14,
1✔
332
          "segments": [
1✔
333
            {
1✔
334
              "type": "CONTEXT",
1✔
335
              "lines": [
1✔
336
                {
1✔
337
                  "source": 3,
1✔
338
                  "destination": 3,
1✔
339
                  "line": " line",
1✔
340
                  "truncated": false
1✔
341
                }
1✔
342
              ],
1✔
343
              "truncated": false
1✔
344
            },
1✔
345
            {
1✔
346
              "type": "REMOVED",
1✔
347
              "lines": [
1✔
348
                {
1✔
349
                  "source": 4,
1✔
350
                  "destination": 4,
1✔
351
                  "line": "line4",
1✔
352
                  "truncated": false
1✔
353
                }
1✔
354
              ],
1✔
355
              "truncated": false
1✔
356
            },
1✔
357
            {
1✔
358
              "type": "ADDED",
1✔
359
              "lines": [
1✔
360
                {
1✔
361
                  "source": 5,
1✔
362
                  "destination": 4,
1✔
363
                  "line": "line5",
1✔
364
                  "truncated": false
1✔
365
                }
1✔
366
              ],
1✔
367
              "truncated": false
1✔
368
            },
1✔
369
            {
1✔
370
              "type": "CONTEXT",
1✔
371
              "lines": [
1✔
372
                {
1✔
373
                  "source": 14,
1✔
374
                  "destination": 14,
1✔
375
                  "line": "",
1✔
376
                  "truncated": false
1✔
377
                }
1✔
378
              ],
1✔
379
              "truncated": false
1✔
380
            }
1✔
381
          ],
1✔
382
          "truncated": false
1✔
383
        }
1✔
384
      ],
1✔
385
      "truncated": false
1✔
386
    }
1✔
387
  ],
1✔
388
  "truncated": false
1✔
389
}'.
1✔
390

1✔
391
        ^ diffs1 := (NeoJSONReader on: diffs1 readStream) next
1✔
392
]
1✔
393

394
{ #category : #'mock - diffs' }
395
BitBucketApiMock >> diffs: anObject [
1✔
396

1✔
397
        diffs := anObject
1✔
398
]
1✔
399

400
{ #category : #'mock - diffs' }
401
BitBucketApiMock >> diffsNohunks [
1✔
402

1✔
403
        | diffs1 |
1✔
404
        diffs1 := '{
1✔
405
  "fromHash": null,
1✔
406
  "toHash": "123",
1✔
407
  "contextLines": 10,
1✔
408
  "whitespace": "SHOW",
1✔
409
  "diffs": [
1✔
410
      {
1✔
411
      "source": null,
1✔
412
      "destination": {
1✔
413
        "components": [
1✔
414
          "api",
1✔
415
          "api.xlsx"
1✔
416
        ],
1✔
417
        "parent": "api",
1✔
418
        "name": "api.xlsx",
1✔
419
        "extension": "xlsx",
1✔
420
        "toString": "api/api.xlsx"
1✔
421
      },
1✔
422
      "binary": true
1✔
423
    }
1✔
424
  ],
1✔
425
  "truncated": false
1✔
426
}'.
1✔
427

1✔
428
        ^ diffs1 := (NeoJSONReader on: diffs1 readStream) next
1✔
429
]
1✔
430

431
{ #category : #'mock - diffs' }
432
BitBucketApiMock >> diffsWithoutAdded [
1✔
433

1✔
434
        | diffsWithoutAdded |
1✔
435
        diffsWithoutAdded := '{
1✔
436
  "fromHash": null,
1✔
437
  "toHash": "3",
1✔
438
  "contextLines": 10,
1✔
439
  "whitespace": "SHOW",
1✔
440
  "diffs": [
1✔
441
    {
1✔
442
      "source": {
1✔
443
        "components": [
1✔
444
          "build.gradle"
1✔
445
        ],
1✔
446
        "parent": "",
1✔
447
        "name": "build.gradle",
1✔
448
        "extension": "gradle",
1✔
449
        "toString": "build.gradle"
1✔
450
      },
1✔
451
      "destination": {
1✔
452
        "components": [
1✔
453
          "build.gradle"
1✔
454
        ],
1✔
455
        "parent": "",
1✔
456
        "name": "build.gradle",
1✔
457
        "extension": "gradle",
1✔
458
        "toString": "build.gradle"
1✔
459
      },
1✔
460
      "hunks": [
1✔
461
        {
1✔
462
          "sourceLine": 1,
1✔
463
          "sourceSpan": 14,
1✔
464
          "destinationLine": 1,
1✔
465
          "destinationSpan": 14,
1✔
466
          "segments": [
1✔
467
            {
1✔
468
              "type": "CONTEXT",
1✔
469
              "lines": [
1✔
470
                {
1✔
471
                  "source": 1,
1✔
472
                  "destination": 1,
1✔
473
                  "line": "line1",
1✔
474
                  "truncated": false
1✔
475
                },
1✔
476
                {
1✔
477
                  "source": 2,
1✔
478
                  "destination": 2,
1✔
479
                  "line": "line2",
1✔
480
                  "truncated": false
1✔
481
                },
1✔
482
                {
1✔
483
                  "source": 3,
1✔
484
                  "destination": 3,
1✔
485
                  "line": "line3",
1✔
486
                  "truncated": false
1✔
487
                }
1✔
488
              ],
1✔
489
              "truncated": false
1✔
490
            },
1✔
491
            {
1✔
492
              "type": "REMOVED",
1✔
493
              "lines": [
1✔
494
                {
1✔
495
                  "source": 4,
1✔
496
                  "destination": 4,
1✔
497
                  "line": "line4",
1✔
498
                  "truncated": false
1✔
499
                }
1✔
500
              ],
1✔
501
              "truncated": false
1✔
502
            },
1✔
503
            {
1✔
504
              "type": "CONTEXT",
1✔
505
              "lines": [
1✔
506
                {
1✔
507
                  "source": 5,
1✔
508
                  "destination": 5,
1✔
509
                  "line": "",
1✔
510
                  "truncated": false
1✔
511
                }
1✔
512
              ],
1✔
513
              "truncated": false
1✔
514
            }
1✔
515
          ],
1✔
516
          "truncated": false
1✔
517
        }
1✔
518
      ],
1✔
519
      "truncated": false
1✔
520
    }
1✔
521
  ],
1✔
522
  "truncated": false
1✔
523
}'.
1✔
524

1✔
525
        ^ diffsWithoutAdded := (NeoJSONReader on:
1✔
526
                                        diffsWithoutAdded readStream) next
1✔
527
]
1✔
528

529
{ #category : #'mock - diffs' }
530
BitBucketApiMock >> diffsWithoutHunks [
1✔
531

1✔
532
        | diffsWithoutHunks |
1✔
533
        diffsWithoutHunks := '{
1✔
534
  "fromHash": null,
1✔
535
  "toHash": "2",
1✔
536
  "contextLines": 10,
1✔
537
  "whitespace": "SHOW",
1✔
538
  "diffs": [
1✔
539
    {
1✔
540
      "source": {
1✔
541
        "components": [
1✔
542
          "build.gradle"
1✔
543
        ],
1✔
544
        "parent": "",
1✔
545
        "name": "build.gradle",
1✔
546
        "extension": "gradle",
1✔
547
        "toString": "build.gradle"
1✔
548
      },
1✔
549
      "destination": {
1✔
550
        "components": [
1✔
551
          "build.gradle"
1✔
552
        ],
1✔
553
        "parent": "",
1✔
554
        "name": "build.gradle",
1✔
555
        "extension": "gradle",
1✔
556
        "toString": "build.gradle"
1✔
557
      },
1✔
558
          
1✔
559
      "truncated": false
1✔
560
    }
1✔
561
  ],
1✔
562
  "truncated": false
1✔
563
}'.
1✔
564

1✔
565
        ^ diffsWithoutHunks := (NeoJSONReader on:
1✔
566
                                        diffsWithoutHunks readStream) next
1✔
567
]
1✔
568

569
{ #category : #'mock - diffs' }
570
BitBucketApiMock >> diffsWithoutRemoved [
1✔
571

1✔
572
        | diffsWithoutRemoved |
1✔
573
        diffsWithoutRemoved := '{
1✔
574
  "fromHash": null,
1✔
575
  "toHash": "1",
1✔
576
  "contextLines": 10,
1✔
577
  "whitespace": "SHOW",
1✔
578
  "diffs": [
1✔
579
    {
1✔
580
      "source": {
1✔
581
        "components": [
1✔
582
          "build.gradle"
1✔
583
        ],
1✔
584
        "parent": "",
1✔
585
        "name": "build.gradle",
1✔
586
        "extension": "gradle",
1✔
587
        "toString": "build.gradle"
1✔
588
      },
1✔
589
      "destination": {
1✔
590
        "components": [
1✔
591
          "build.gradle"
1✔
592
        ],
1✔
593
        "parent": "",
1✔
594
        "name": "build.gradle",
1✔
595
        "extension": "gradle",
1✔
596
        "toString": "build.gradle"
1✔
597
      },
1✔
598
      "hunks": [
1✔
599
        {
1✔
600
          "sourceLine": 1,
1✔
601
          "sourceSpan": 14,
1✔
602
          "destinationLine": 1,
1✔
603
          "destinationSpan": 14,
1✔
604
          "segments": [
1✔
605
            {
1✔
606
              "type": "CONTEXT",
1✔
607
              "lines": [
1✔
608
                {
1✔
609
                  "source": 3,
1✔
610
                  "destination": 3,
1✔
611
                  "line": " line",
1✔
612
                  "truncated": false
1✔
613
                }
1✔
614
              ],
1✔
615
              "truncated": false
1✔
616
            },
1✔
617
            {
1✔
618
              "type": "ADDED",
1✔
619
              "lines": [
1✔
620
                {
1✔
621
                  "source": 5,
1✔
622
                  "destination": 4,
1✔
623
                  "line": "    test2",
1✔
624
                  "truncated": false
1✔
625
                }
1✔
626
              ],
1✔
627
              "truncated": false
1✔
628
            },
1✔
629
            {
1✔
630
              "type": "CONTEXT",
1✔
631
              "lines": [
1✔
632
                {
1✔
633
                  "source": 6,
1✔
634
                  "destination": 6,
1✔
635
                  "line": "",
1✔
636
                  "truncated": false
1✔
637
                }
1✔
638
              ],
1✔
639
              "truncated": false
1✔
640
            }
1✔
641
          ],
1✔
642
          "truncated": false
1✔
643
        }
1✔
644
      ],
1✔
645
      "truncated": false
1✔
646
    }
1✔
647
  ],
1✔
648
  "truncated": false
1✔
649
}'.
1✔
650

1✔
651
        ^ diffsWithoutRemoved := (NeoJSONReader on:
1✔
652
                                          diffsWithoutRemoved readStream) next
1✔
653
]
1✔
654

655
{ #category : #initialization }
656
BitBucketApiMock >> initialize [
1✔
657

1✔
658
        commitsMock := self commits1.
1✔
659
        diffs := self diffs1.
1✔
660
        userMock := self user1.
1✔
661
        mergeRequests := { self openedMergeRequest }
1✔
662
]
1✔
663

664
{ #category : #'mock - mergeRequests' }
UNCOV
665
BitBucketApiMock >> mergeRequests [
×
UNCOV
666

×
UNCOV
667
        ^ mergeRequests
×
UNCOV
668
]
×
669

670
{ #category : #'mock - mergeRequests' }
671
BitBucketApiMock >> mergeRequests: anObject [
1✔
672

1✔
673
        mergeRequests := anObject
1✔
674
]
1✔
675

676
{ #category : #'mock - mergeRequests' }
677
BitBucketApiMock >> mergedMergeRequest [
1✔
678

1✔
679
        | pullRequest |
1✔
680
        pullRequest := '{
1✔
681
      "id": 539,
1✔
682
      "version": 10,
1✔
683
      "title": "title",
1✔
684
      "state": "MERGED",
1✔
685
      "open": false,
1✔
686
      "closed": true,
1✔
687
                  "createdDate": 1721396425473,
1✔
688
                  "updatedDate": 1721457513310,
1✔
689
                  "closedDate": 1721457513310,
1✔
690
      "fromRef": {
1✔
691
        "id": "refs/heads/wip/1",
1✔
692
        "displayId": "wip/1",
1✔
693
        "latestCommit": "2",
1✔
694
        "repository": {
1✔
695
          "slug": "repoSlug",
1✔
696
          "id": 242,
1✔
697
          "name": "repo-name",
1✔
698
          "scmId": "git",
1✔
699
          "state": "AVAILABLE",
1✔
700
          "statusMessage": "Available",
1✔
701
          "forkable": true,
1✔
702
          "project": {
1✔
703
            "key": "project-key",
1✔
704
            "id": 242,
1✔
705
            "name": "project-name",
1✔
706
            "description": "project description",
1✔
707
            "public": true,
1✔
708
            "type": "NORMAL",
1✔
709
            "links": {
1✔
710
              "self": [
1✔
711
                {
1✔
712
                  "href": "link"
1✔
713
                }
1✔
714
              ]
1✔
715
            }
1✔
716
          },
1✔
717
          "public": false,
1✔
718
          "links": {
1✔
719
            "clone": [
1✔
720
              {
1✔
721
                "href": "clone",
1✔
722
                "name": "ssh"
1✔
723
              },
1✔
724
              {
1✔
725
                "href": "clone",
1✔
726
                "name": "http"
1✔
727
              }
1✔
728
            ],
1✔
729
            "self": [
1✔
730
              {
1✔
731
                "href": "link"
1✔
732
              }
1✔
733
            ]
1✔
734
          }
1✔
735
        }
1✔
736
      },
1✔
737
      "toRef": {
1✔
738
        "id": "refs/heads/develop/trunk",
1✔
739
        "displayId": "develop/trunk",
1✔
740
        "latestCommit": "3",
1✔
741
        "repository": {
1✔
742
          "slug": "repo-slug",
1✔
743
          "id": 242,
1✔
744
          "name": "repo-name",
1✔
745
          "scmId": "git",
1✔
746
          "state": "AVAILABLE",
1✔
747
          "statusMessage": "Available",
1✔
748
          "forkable": true,
1✔
749
          "project": {
1✔
750
            "key": "project-key",
1✔
751
            "id": 242,
1✔
752
            "name": "project-name",
1✔
753
            "description": "description",
1✔
754
            "public": true,
1✔
755
            "type": "NORMAL",
1✔
756
            "links": {
1✔
757
              "self": [
1✔
758
                {
1✔
759
                  "href": "link"
1✔
760
                }
1✔
761
              ]
1✔
762
            }
1✔
763
          },
1✔
764
          "public": false,
1✔
765
          "links": {
1✔
766
            "clone": [
1✔
767
              {
1✔
768
                "href": "link",
1✔
769
                "name": "ssh"
1✔
770
              },
1✔
771
              {
1✔
772
                "href": "link-http",
1✔
773
                "name": "http"
1✔
774
              }
1✔
775
            ],
1✔
776
            "self": [
1✔
777
              {
1✔
778
                "href": "link-self"
1✔
779
              }
1✔
780
            ]
1✔
781
          }
1✔
782
        }
1✔
783
      },
1✔
784
      "locked": false,
1✔
785
      "author": {
1✔
786
        "user": {
1✔
787
          "name": "user-name",
1✔
788
          "id": 1,
1✔
789
          "displayName": "user-display-name",
1✔
790
          "active": false,
1✔
791
          "slug": "user-slug",
1✔
792
          "type": "NORMAL",
1✔
793
          "links": {
1✔
794
            "self": [
1✔
795
              {
1✔
796
                "href": "link-self"
1✔
797
              }
1✔
798
            ]
1✔
799
          }
1✔
800
        },
1✔
801
        "role": "AUTHOR",
1✔
802
        "approved": false,
1✔
803
        "status": "UNAPPROVED"
1✔
804
      },
1✔
805
      "reviewers": [
1✔
806
        {
1✔
807
          "user": {
1✔
808
            "name": "reviewer-name",
1✔
809
            "emailAddress": "reviewer@email.com",
1✔
810
            "id": 1713,
1✔
811
            "displayName": "reviewer-display-name",
1✔
812
            "active": true,
1✔
813
            "slug": "reviewer-slug",
1✔
814
            "type": "NORMAL",
1✔
815
            "links": {
1✔
816
              "self": [
1✔
817
                {
1✔
818
                  "href": "link-self"
1✔
819
                }
1✔
820
              ]
1✔
821
            }
1✔
822
          },
1✔
823
          "lastReviewedCommit": "2",
1✔
824
          "role": "REVIEWER",
1✔
825
          "approved": true,
1✔
826
          "status": "APPROVED"
1✔
827
        },
1✔
828
        {
1✔
829
          "user": {
1✔
830
            "name": "reveiwer2-name",
1✔
831
            "emailAddress": "reviewer2@email.com",
1✔
832
            "id": 49,
1✔
833
            "displayName": "reviewer2 display name",
1✔
834
            "active": true,
1✔
835
            "slug": "reviewer2-slug",
1✔
836
            "type": "NORMAL",
1✔
837
            "links": {
1✔
838
              "self": [
1✔
839
                {
1✔
840
                  "href": "link-self"
1✔
841
                }
1✔
842
              ]
1✔
843
            }
1✔
844
          },
1✔
845
          "role": "REVIEWER",
1✔
846
          "approved": false,
1✔
847
          "status": "UNAPPROVED"
1✔
848
        }
1✔
849
      ],
1✔
850
      "participants": [],
1✔
851
      "properties": {
1✔
852
        "mergeResult": {
1✔
853
          "outcome": "CONFLICTED",
1✔
854
          "current": true
1✔
855
        },
1✔
856
        "resolvedTaskCount": 0,
1✔
857
        "commentCount": 4,
1✔
858
        "openTaskCount": 0
1✔
859
      },
1✔
860
      "links": {
1✔
861
        "self": [
1✔
862
          {
1✔
863
            "href": "link"
1✔
864
          }
1✔
865
        ]
1✔
866
      }
1✔
867
    }'.
1✔
868

1✔
869
        ^ pullRequest := (NeoJSONReader on: pullRequest readStream) next
1✔
870
]
1✔
871

872
{ #category : #'mock - mergeRequests' }
873
BitBucketApiMock >> openedMergeRequest [
1✔
874

1✔
875
        | pullRequest |
1✔
876
        pullRequest := '{
1✔
877
      "id": 539,
1✔
878
      "version": 10,
1✔
879
      "title": "title",
1✔
880
      "state": "OPEN",
1✔
881
      "open": true,
1✔
882
      "closed": false,
1✔
883
      "createdDate": 1709726344893,
1✔
884
      "updatedDate": 1709728944248,
1✔
885
      "fromRef": {
1✔
886
        "id": "refs/heads/wip/1",
1✔
887
        "displayId": "wip/1",
1✔
888
        "latestCommit": "2",
1✔
889
        "repository": {
1✔
890
          "slug": "repoSlug",
1✔
891
          "id": 242,
1✔
892
          "name": "repo-name",
1✔
893
          "scmId": "git",
1✔
894
          "state": "AVAILABLE",
1✔
895
          "statusMessage": "Available",
1✔
896
          "forkable": true,
1✔
897
          "project": {
1✔
898
            "key": "project-key",
1✔
899
            "id": 242,
1✔
900
            "name": "project-name",
1✔
901
            "description": "project description",
1✔
902
            "public": true,
1✔
903
            "type": "NORMAL",
1✔
904
            "links": {
1✔
905
              "self": [
1✔
906
                {
1✔
907
                  "href": "link"
1✔
908
                }
1✔
909
              ]
1✔
910
            }
1✔
911
          },
1✔
912
          "public": false,
1✔
913
          "links": {
1✔
914
            "clone": [
1✔
915
              {
1✔
916
                "href": "clone",
1✔
917
                "name": "ssh"
1✔
918
              },
1✔
919
              {
1✔
920
                "href": "clone",
1✔
921
                "name": "http"
1✔
922
              }
1✔
923
            ],
1✔
924
            "self": [
1✔
925
              {
1✔
926
                "href": "link"
1✔
927
              }
1✔
928
            ]
1✔
929
          }
1✔
930
        }
1✔
931
      },
1✔
932
      "toRef": {
1✔
933
        "id": "refs/heads/develop/trunk",
1✔
934
        "displayId": "develop/trunk",
1✔
935
        "latestCommit": "3",
1✔
936
        "repository": {
1✔
937
          "slug": "repo-slug",
1✔
938
          "id": 242,
1✔
939
          "name": "repo-name",
1✔
940
          "scmId": "git",
1✔
941
          "state": "AVAILABLE",
1✔
942
          "statusMessage": "Available",
1✔
943
          "forkable": true,
1✔
944
          "project": {
1✔
945
            "key": "project-key",
1✔
946
            "id": 242,
1✔
947
            "name": "project-name",
1✔
948
            "description": "description",
1✔
949
            "public": true,
1✔
950
            "type": "NORMAL",
1✔
951
            "links": {
1✔
952
              "self": [
1✔
953
                {
1✔
954
                  "href": "link"
1✔
955
                }
1✔
956
              ]
1✔
957
            }
1✔
958
          },
1✔
959
          "public": false,
1✔
960
          "links": {
1✔
961
            "clone": [
1✔
962
              {
1✔
963
                "href": "link",
1✔
964
                "name": "ssh"
1✔
965
              },
1✔
966
              {
1✔
967
                "href": "link-http",
1✔
968
                "name": "http"
1✔
969
              }
1✔
970
            ],
1✔
971
            "self": [
1✔
972
              {
1✔
973
                "href": "link-self"
1✔
974
              }
1✔
975
            ]
1✔
976
          }
1✔
977
        }
1✔
978
      },
1✔
979
      "locked": false,
1✔
980
      "author": {
1✔
981
        "user": {
1✔
982
          "name": "user-name",
1✔
983
          "id": 1,
1✔
984
          "displayName": "user-display-name",
1✔
985
          "active": false,
1✔
986
          "slug": "user-slug",
1✔
987
          "type": "NORMAL",
1✔
988
          "links": {
1✔
989
            "self": [
1✔
990
              {
1✔
991
                "href": "link-self"
1✔
992
              }
1✔
993
            ]
1✔
994
          }
1✔
995
        },
1✔
996
        "role": "AUTHOR",
1✔
997
        "approved": false,
1✔
998
        "status": "UNAPPROVED"
1✔
999
      },
1✔
1000
      "reviewers": [
1✔
1001
        {
1✔
1002
          "user": {
1✔
1003
            "name": "reviewer-name",
1✔
1004
            "emailAddress": "reviewer@email.com",
1✔
1005
            "id": 1713,
1✔
1006
            "displayName": "reviewer-display-name",
1✔
1007
            "active": true,
1✔
1008
            "slug": "reviewer-slug",
1✔
1009
            "type": "NORMAL",
1✔
1010
            "links": {
1✔
1011
              "self": [
1✔
1012
                {
1✔
1013
                  "href": "link-self"
1✔
1014
                }
1✔
1015
              ]
1✔
1016
            }
1✔
1017
          },
1✔
1018
          "lastReviewedCommit": "2",
1✔
1019
          "role": "REVIEWER",
1✔
1020
          "approved": true,
1✔
1021
          "status": "APPROVED"
1✔
1022
        },
1✔
1023
        {
1✔
1024
          "user": {
1✔
1025
            "name": "reveiwer2-name",
1✔
1026
            "emailAddress": "reviewer2@email.com",
1✔
1027
            "id": 49,
1✔
1028
            "displayName": "reviewer2 display name",
1✔
1029
            "active": true,
1✔
1030
            "slug": "reviewer2-slug",
1✔
1031
            "type": "NORMAL",
1✔
1032
            "links": {
1✔
1033
              "self": [
1✔
1034
                {
1✔
1035
                  "href": "link-self"
1✔
1036
                }
1✔
1037
              ]
1✔
1038
            }
1✔
1039
          },
1✔
1040
          "role": "REVIEWER",
1✔
1041
          "approved": false,
1✔
1042
          "status": "UNAPPROVED"
1✔
1043
        }
1✔
1044
      ],
1✔
1045
      "participants": [],
1✔
1046
      "properties": {
1✔
1047
        "mergeResult": {
1✔
1048
          "outcome": "CONFLICTED",
1✔
1049
          "current": true
1✔
1050
        },
1✔
1051
        "resolvedTaskCount": 0,
1✔
1052
        "commentCount": 4,
1✔
1053
        "openTaskCount": 0
1✔
1054
      },
1✔
1055
      "links": {
1✔
1056
        "self": [
1✔
1057
          {
1✔
1058
            "href": "link"
1✔
1059
          }
1✔
1060
        ]
1✔
1061
      }
1✔
1062
    }'.
1✔
1063

1✔
1064
        ^pullRequest := (NeoJSONReader on: pullRequest readStream) next.
1✔
1065
]
1✔
1066

1067
{ #category : #ressources }
1068
BitBucketApiMock >> projects [
1✔
1069

1✔
1070
        ^BitBucketProjectsMock new
1✔
1071
]
1✔
1072

1073
{ #category : #'mock - projects' }
1074
BitBucketApiMock >> projectsMock [
1✔
1075

1✔
1076
        | projects |
1✔
1077
        projects := '[
1✔
1078
    {
1✔
1079
      "key": "PRJ",
1✔
1080
      "id": 1,
1✔
1081
      "name": "My Cool Project",
1✔
1082
      "description": "The description for my cool project.",
1✔
1083
      "public": true,
1✔
1084
      "type": "NORMAL",
1✔
1085
      "links": {
1✔
1086
        "self": [{"href": "http://link/to/project"}]
1✔
1087
      }
1✔
1088
    }
1✔
1089
  ],
1✔
1090
'.
1✔
1091

1✔
1092
        projects := (NeoJSONReader on: projects readStream) next.
1✔
1093

1✔
1094
        ^ projects
1✔
1095
]
1✔
1096

1097
{ #category : #'mock - mergeRequests' }
1098
BitBucketApiMock >> pullRequestActivities [
1✔
1099

1✔
1100
        | pullRequestActivities |
1✔
1101
        pullRequestActivities := '
1✔
1102
    [{
1✔
1103
      "id": 1,
1✔
1104
      "createdDate": 1720510446734,
1✔
1105
      "user": {
1✔
1106
        "name": "user-name",
1✔
1107
        "emailAddress": "user-name@email.com",
1✔
1108
        "id": 24,
1✔
1109
        "displayName": "user name",
1✔
1110
        "active": true,
1✔
1111
        "slug": "un",
1✔
1112
        "type": "NORMAL",
1✔
1113
        "links": {
1✔
1114
          "self": [
1✔
1115
            {
1✔
1116
              "href": "link"
1✔
1117
            }
1✔
1118
          ]
1✔
1119
        }
1✔
1120
      },
1✔
1121
      "action": "MERGED"
1✔
1122
}]'.
1✔
1123

1✔
1124
        ^ pullRequestActivities := (NeoJSONReader on:
1✔
1125
                                            pullRequestActivities readStream) next
1✔
1126
]
1✔
1127

1128
{ #category : #ressources }
1129
BitBucketApiMock >> pullRequests [
1✔
1130

1✔
1131
        ^ BitbucketPullRequestsMock new mergeRequests: mergeRequests.
1✔
1132
]
1✔
1133

1134
{ #category : #ressources }
1135
BitBucketApiMock >> repositories [
1✔
1136
        ^BitBucketRepositoriesMock new.
1✔
1137
]
1✔
1138

1139
{ #category : #'mock - repositories' }
1140
BitBucketApiMock >> repositoriesMock [
1✔
1141

1✔
1142
        | repos |
1✔
1143
        repos := '[
1✔
1144
    {
1✔
1145
      "slug": "my-repo",
1✔
1146
      "id": 1,
1✔
1147
      "name": "My repo",
1✔
1148
      "scmId": "git",
1✔
1149
      "state": "AVAILABLE",
1✔
1150
      "statusMessage": "Available",
1✔
1151
      "forkable": true,
1✔
1152
      "project": {
1✔
1153
        "key": "PRJ",
1✔
1154
        "id": 1,
1✔
1155
        "name": "My Cool Project",
1✔
1156
        "description": "The description for my cool project.",
1✔
1157
        "public": true,
1✔
1158
        "type": "NORMAL",
1✔
1159
        "links": {
1✔
1160
          "self": [{"href": "http://link/to/project"}]
1✔
1161
        }
1✔
1162
      },
1✔
1163
      "public": true,
1✔
1164
      "links": {
1✔
1165
        "clone": [
1✔
1166
          {"href": "ssh://git@<baseURL>/PRJ/my-repo.git", "name": "ssh"},
1✔
1167
          {"href": "https://<baseURL>/scm/PRJ/my-repo.git", "name": "http"}
1✔
1168
        ],
1✔
1169
        "self": [{"href": "http://link/to/repository"}]
1✔
1170
      }
1✔
1171
    }
1✔
1172
  ],'.
1✔
1173

1✔
1174
        repos := (NeoJSONReader on: repos readStream) next.
1✔
1175

1✔
1176
        ^ repos
1✔
1177
]
1✔
1178

1179
{ #category : #'mock - users' }
1180
BitBucketApiMock >> user1 [
1✔
1181

1✔
1182
        | user1 |
1✔
1183
        user1 := '
1✔
1184
    {
1✔
1185
      "name": "test",
1✔
1186
      "emailAddress": "test@test.com",
1✔
1187
      "id": 1,
1✔
1188
      "displayName": "test test",
1✔
1189
      "active": true,
1✔
1190
      "slug": "test",
1✔
1191
      "type": "NORMAL",
1✔
1192
      "directoryName": "directory",
1✔
1193
      "deletable": false,
1✔
1194
      "lastAuthenticationTimestamp": 1727444943000,
1✔
1195
      "mutableDetails": false,
1✔
1196
      "mutableGroups": true,
1✔
1197
      "links": {
1✔
1198
        "self": [
1✔
1199
          {
1✔
1200
            "href": "test.com"
1✔
1201
          }
1✔
1202
        ]
1✔
1203
      }
1✔
1204
    }
1✔
1205
  '.
1✔
1206

1✔
1207

1✔
1208
        ^ user1 := (NeoJSONReader on: user1 readStream) next
1✔
1209
]
1✔
1210

1211
{ #category : #'mock - users' }
UNCOV
1212
BitBucketApiMock >> user: accountId [
×
UNCOV
1213

×
UNCOV
1214
        | user |
×
UNCOV
1215
        user := '{
×
UNCOV
1216
        "type": "user",
×
UNCOV
1217
        "nickname": "evzijst",
×
UNCOV
1218
        "display_name": "Erik van Zijst",
×
UNCOV
1219
                  "created_on": "12-04-2024",
×
UNCOV
1220
        "uuid": "{d301aafa-d676-4ee0-88be-962be7417567}"
×
UNCOV
1221
   }'.
×
UNCOV
1222

×
UNCOV
1223
        ^ user
×
UNCOV
1224
]
×
1225

1226
{ #category : #'mock - users' }
1227
BitBucketApiMock >> userMock [
1✔
1228

1✔
1229
        ^ userMock
1✔
1230
]
1✔
1231

1232
{ #category : #'mock - users' }
1233
BitBucketApiMock >> userMock: anObject [
1✔
1234

1✔
1235
        userMock := anObject
1✔
1236
]
1✔
1237

1238
{ #category : #ressources }
1239
BitBucketApiMock >> users [
1✔
1240

1✔
1241
        ^ BitbucketUsersMock new userMock: userMock.
1✔
1242
]
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc