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

moosetechnology / GitProjectHealth / 13374988886

17 Feb 2025 04:42PM UTC coverage: 61.181% (+6.6%) from 54.598%
13374988886

Pull #131

github

web-flow
Merge bcce50bd4 into 5974fca57
Pull Request #131: Revert "Renaming importer"

99 of 325 new or added lines in 15 files covered. (30.46%)

110 existing lines in 7 files now uncovered.

9614 of 15714 relevant lines covered (61.18%)

0.61 hits per line

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

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

13
{ #category : #'api - pull-requests' }
14
BitBucketApiMock >> activitiesOfPullRequest: pullRequestId inRepoProjectId: repoSlug ofProjectGroupId: projectKey [
1✔
15

1✔
16
        ^self pullRequestActivities
1✔
17
]
1✔
18

19
{ #category : #accessing }
20
BitBucketApiMock >> commit2 [
1✔
21

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

1✔
48
        ^ commits2 := (NeoJSONReader on: commits2 readStream) next
1✔
49
]
1✔
50

51
{ #category : #accessing }
52
BitBucketApiMock >> commits [
1✔
53

1✔
54
        ^ commits
1✔
55
]
1✔
56

57
{ #category : #accessing }
58
BitBucketApiMock >> commits1 [
1✔
59

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

1✔
86
        ^ commits1 := (NeoJSONReader on: commits1 readStream) next
1✔
87
]
1✔
88

89
{ #category : #accessing }
90
BitBucketApiMock >> commits: anObject [
1✔
91

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

95
{ #category : #'api - pull-requests' }
96
BitBucketApiMock >> commitsOfPullRequest: mergeRequestId ofRepoProjectId: repoSlug inProjectGroupId: projectKey [
1✔
97

1✔
98
        ^commits
1✔
99
]
1✔
100

101
{ #category : #'api - projects' }
102
BitBucketApiMock >> commitsOfRepoProjectId: repositorySlug inProjectGroupId: projectKey since: since until: until [
1✔
103

1✔
104
        ^ self commits select: [ :commit |
1✔
105
                  | commitDate |
1✔
106
                        
1✔
107
                  commitDate := DateAndTime fromUnixTime:
1✔
108
                                        (commit at: #committerTimestamp) / 1000.
1✔
109
                        
1✔
110
                  commitDate >= since asDate and: commitDate <= until asDate ]
1✔
111
]
1✔
112

113
{ #category : #accessing }
114
BitBucketApiMock >> declinedMergeRequest [
1✔
115

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

1✔
306
        ^ pullRequest := (NeoJSONReader on: pullRequest readStream) next
1✔
307
]
1✔
308

309
{ #category : #accessing }
310
BitBucketApiMock >> diffs [
1✔
311

1✔
312
        ^ diffs
1✔
313
]
1✔
314

315
{ #category : #accessing }
316
BitBucketApiMock >> diffs1 [
1✔
317

1✔
318
        | diffs1 |
1✔
319
        diffs1 := '{
1✔
320
  "fromHash": null,
1✔
321
  "toHash": "123",
1✔
322
  "contextLines": 10,
1✔
323
  "whitespace": "SHOW",
1✔
324
  "diffs": [
1✔
325
    {
1✔
326
      "source": {
1✔
327
        "components": [
1✔
328
          "build.gradle"
1✔
329
        ],
1✔
330
        "parent": "",
1✔
331
        "name": "build.gradle",
1✔
332
        "extension": "gradle",
1✔
333
        "toString": "build.gradle"
1✔
334
      },
1✔
335
      "destination": {
1✔
336
        "components": [
1✔
337
          "build.gradle"
1✔
338
        ],
1✔
339
        "parent": "",
1✔
340
        "name": "build.gradle",
1✔
341
        "extension": "gradle",
1✔
342
        "toString": "build.gradle"
1✔
343
      },
1✔
344
      "hunks": [
1✔
345
        {
1✔
346
          "sourceLine": 1,
1✔
347
          "sourceSpan": 14,
1✔
348
          "destinationLine": 1,
1✔
349
          "destinationSpan": 14,
1✔
350
          "segments": [
1✔
351
            {
1✔
352
              "type": "CONTEXT",
1✔
353
              "lines": [
1✔
354
                {
1✔
355
                  "source": 3,
1✔
356
                  "destination": 3,
1✔
357
                  "line": " line",
1✔
358
                  "truncated": false
1✔
359
                }
1✔
360
              ],
1✔
361
              "truncated": false
1✔
362
            },
1✔
363
            {
1✔
364
              "type": "REMOVED",
1✔
365
              "lines": [
1✔
366
                {
1✔
367
                  "source": 4,
1✔
368
                  "destination": 4,
1✔
369
                  "line": "line4",
1✔
370
                  "truncated": false
1✔
371
                }
1✔
372
              ],
1✔
373
              "truncated": false
1✔
374
            },
1✔
375
            {
1✔
376
              "type": "ADDED",
1✔
377
              "lines": [
1✔
378
                {
1✔
379
                  "source": 5,
1✔
380
                  "destination": 4,
1✔
381
                  "line": "line5",
1✔
382
                  "truncated": false
1✔
383
                }
1✔
384
              ],
1✔
385
              "truncated": false
1✔
386
            },
1✔
387
            {
1✔
388
              "type": "CONTEXT",
1✔
389
              "lines": [
1✔
390
                {
1✔
391
                  "source": 14,
1✔
392
                  "destination": 14,
1✔
393
                  "line": "",
1✔
394
                  "truncated": false
1✔
395
                }
1✔
396
              ],
1✔
397
              "truncated": false
1✔
398
            }
1✔
399
          ],
1✔
400
          "truncated": false
1✔
401
        }
1✔
402
      ],
1✔
403
      "truncated": false
1✔
404
    }
1✔
405
  ],
1✔
406
  "truncated": false
1✔
407
}'.
1✔
408

1✔
409
        ^ diffs1 := (NeoJSONReader on: diffs1 readStream) next
1✔
410
]
1✔
411

412
{ #category : #accessing }
413
BitBucketApiMock >> diffs: anObject [
1✔
414

1✔
415
        diffs := anObject
1✔
416
]
1✔
417

418
{ #category : #accessing }
419
BitBucketApiMock >> diffsNohunks [
1✔
420

1✔
421
        | diffs1 |
1✔
422
        diffs1 := '{
1✔
423
  "fromHash": null,
1✔
424
  "toHash": "123",
1✔
425
  "contextLines": 10,
1✔
426
  "whitespace": "SHOW",
1✔
427
  "diffs": [
1✔
428
      {
1✔
429
      "source": null,
1✔
430
      "destination": {
1✔
431
        "components": [
1✔
432
          "api",
1✔
433
          "api.xlsx"
1✔
434
        ],
1✔
435
        "parent": "api",
1✔
436
        "name": "api.xlsx",
1✔
437
        "extension": "xlsx",
1✔
438
        "toString": "api/api.xlsx"
1✔
439
      },
1✔
440
      "binary": true
1✔
441
    }
1✔
442
  ],
1✔
443
  "truncated": false
1✔
444
}'.
1✔
445

1✔
446
        ^ diffs1 := (NeoJSONReader on: diffs1 readStream) next
1✔
447
]
1✔
448

449
{ #category : #'api - commits' }
450
BitBucketApiMock >> diffsOfCommit: commitID inRepoProjectId: repositorySlug inProjectGroupId: projectKey [
1✔
451
        ^diffs 
1✔
452
]
1✔
453

454
{ #category : #accessing }
455
BitBucketApiMock >> diffsWithoutAdded [
1✔
456

1✔
457
        | diffsWithoutAdded |
1✔
458
        diffsWithoutAdded := '{
1✔
459
  "fromHash": null,
1✔
460
  "toHash": "3",
1✔
461
  "contextLines": 10,
1✔
462
  "whitespace": "SHOW",
1✔
463
  "diffs": [
1✔
464
    {
1✔
465
      "source": {
1✔
466
        "components": [
1✔
467
          "build.gradle"
1✔
468
        ],
1✔
469
        "parent": "",
1✔
470
        "name": "build.gradle",
1✔
471
        "extension": "gradle",
1✔
472
        "toString": "build.gradle"
1✔
473
      },
1✔
474
      "destination": {
1✔
475
        "components": [
1✔
476
          "build.gradle"
1✔
477
        ],
1✔
478
        "parent": "",
1✔
479
        "name": "build.gradle",
1✔
480
        "extension": "gradle",
1✔
481
        "toString": "build.gradle"
1✔
482
      },
1✔
483
      "hunks": [
1✔
484
        {
1✔
485
          "sourceLine": 1,
1✔
486
          "sourceSpan": 14,
1✔
487
          "destinationLine": 1,
1✔
488
          "destinationSpan": 14,
1✔
489
          "segments": [
1✔
490
            {
1✔
491
              "type": "CONTEXT",
1✔
492
              "lines": [
1✔
493
                {
1✔
494
                  "source": 1,
1✔
495
                  "destination": 1,
1✔
496
                  "line": "line1",
1✔
497
                  "truncated": false
1✔
498
                },
1✔
499
                {
1✔
500
                  "source": 2,
1✔
501
                  "destination": 2,
1✔
502
                  "line": "line2",
1✔
503
                  "truncated": false
1✔
504
                },
1✔
505
                {
1✔
506
                  "source": 3,
1✔
507
                  "destination": 3,
1✔
508
                  "line": "line3",
1✔
509
                  "truncated": false
1✔
510
                }
1✔
511
              ],
1✔
512
              "truncated": false
1✔
513
            },
1✔
514
            {
1✔
515
              "type": "REMOVED",
1✔
516
              "lines": [
1✔
517
                {
1✔
518
                  "source": 4,
1✔
519
                  "destination": 4,
1✔
520
                  "line": "line4",
1✔
521
                  "truncated": false
1✔
522
                }
1✔
523
              ],
1✔
524
              "truncated": false
1✔
525
            },
1✔
526
            {
1✔
527
              "type": "CONTEXT",
1✔
528
              "lines": [
1✔
529
                {
1✔
530
                  "source": 5,
1✔
531
                  "destination": 5,
1✔
532
                  "line": "",
1✔
533
                  "truncated": false
1✔
534
                }
1✔
535
              ],
1✔
536
              "truncated": false
1✔
537
            }
1✔
538
          ],
1✔
539
          "truncated": false
1✔
540
        }
1✔
541
      ],
1✔
542
      "truncated": false
1✔
543
    }
1✔
544
  ],
1✔
545
  "truncated": false
1✔
546
}'.
1✔
547

1✔
548
        ^ diffsWithoutAdded := (NeoJSONReader on:
1✔
549
                                        diffsWithoutAdded readStream) next
1✔
550
]
1✔
551

552
{ #category : #accessing }
553
BitBucketApiMock >> diffsWithoutHunks [
1✔
554

1✔
555
        | diffsWithoutHunks |
1✔
556
        diffsWithoutHunks := '{
1✔
557
  "fromHash": null,
1✔
558
  "toHash": "2",
1✔
559
  "contextLines": 10,
1✔
560
  "whitespace": "SHOW",
1✔
561
  "diffs": [
1✔
562
    {
1✔
563
      "source": {
1✔
564
        "components": [
1✔
565
          "build.gradle"
1✔
566
        ],
1✔
567
        "parent": "",
1✔
568
        "name": "build.gradle",
1✔
569
        "extension": "gradle",
1✔
570
        "toString": "build.gradle"
1✔
571
      },
1✔
572
      "destination": {
1✔
573
        "components": [
1✔
574
          "build.gradle"
1✔
575
        ],
1✔
576
        "parent": "",
1✔
577
        "name": "build.gradle",
1✔
578
        "extension": "gradle",
1✔
579
        "toString": "build.gradle"
1✔
580
      },
1✔
581
          
1✔
582
      "truncated": false
1✔
583
    }
1✔
584
  ],
1✔
585
  "truncated": false
1✔
586
}'.
1✔
587

1✔
588
        ^ diffsWithoutHunks := (NeoJSONReader on:
1✔
589
                                        diffsWithoutHunks readStream) next
1✔
590
]
1✔
591

592
{ #category : #accessing }
593
BitBucketApiMock >> diffsWithoutRemoved [
1✔
594

1✔
595
        | diffsWithoutRemoved |
1✔
596
        diffsWithoutRemoved := '{
1✔
597
  "fromHash": null,
1✔
598
  "toHash": "1",
1✔
599
  "contextLines": 10,
1✔
600
  "whitespace": "SHOW",
1✔
601
  "diffs": [
1✔
602
    {
1✔
603
      "source": {
1✔
604
        "components": [
1✔
605
          "build.gradle"
1✔
606
        ],
1✔
607
        "parent": "",
1✔
608
        "name": "build.gradle",
1✔
609
        "extension": "gradle",
1✔
610
        "toString": "build.gradle"
1✔
611
      },
1✔
612
      "destination": {
1✔
613
        "components": [
1✔
614
          "build.gradle"
1✔
615
        ],
1✔
616
        "parent": "",
1✔
617
        "name": "build.gradle",
1✔
618
        "extension": "gradle",
1✔
619
        "toString": "build.gradle"
1✔
620
      },
1✔
621
      "hunks": [
1✔
622
        {
1✔
623
          "sourceLine": 1,
1✔
624
          "sourceSpan": 14,
1✔
625
          "destinationLine": 1,
1✔
626
          "destinationSpan": 14,
1✔
627
          "segments": [
1✔
628
            {
1✔
629
              "type": "CONTEXT",
1✔
630
              "lines": [
1✔
631
                {
1✔
632
                  "source": 3,
1✔
633
                  "destination": 3,
1✔
634
                  "line": " line",
1✔
635
                  "truncated": false
1✔
636
                }
1✔
637
              ],
1✔
638
              "truncated": false
1✔
639
            },
1✔
640
            {
1✔
641
              "type": "ADDED",
1✔
642
              "lines": [
1✔
643
                {
1✔
644
                  "source": 5,
1✔
645
                  "destination": 4,
1✔
646
                  "line": "    test2",
1✔
647
                  "truncated": false
1✔
648
                }
1✔
649
              ],
1✔
650
              "truncated": false
1✔
651
            },
1✔
652
            {
1✔
653
              "type": "CONTEXT",
1✔
654
              "lines": [
1✔
655
                {
1✔
656
                  "source": 6,
1✔
657
                  "destination": 6,
1✔
658
                  "line": "",
1✔
659
                  "truncated": false
1✔
660
                }
1✔
661
              ],
1✔
662
              "truncated": false
1✔
663
            }
1✔
664
          ],
1✔
665
          "truncated": false
1✔
666
        }
1✔
667
      ],
1✔
668
      "truncated": false
1✔
669
    }
1✔
670
  ],
1✔
671
  "truncated": false
1✔
672
}'.
1✔
673

1✔
674
        ^ diffsWithoutRemoved := (NeoJSONReader on:
1✔
675
                                          diffsWithoutRemoved readStream) next
1✔
676
]
1✔
677

678
{ #category : #initialization }
679
BitBucketApiMock >> initialize [
1✔
680

1✔
681
        commits := self commits1.
1✔
682
        diffs := self diffs1.
1✔
683
        userMock := self user1.
1✔
684
        mergeRequests := { self openedMergeRequest }
1✔
685
]
1✔
686

687
{ #category : #accessing }
UNCOV
688
BitBucketApiMock >> mergeRequests [
×
UNCOV
689

×
UNCOV
690
        ^ mergeRequests
×
UNCOV
691
]
×
692

693
{ #category : #accessing }
694
BitBucketApiMock >> mergeRequests: anObject [
1✔
695

1✔
696
        mergeRequests := anObject
1✔
697
]
1✔
698

699
{ #category : #accessing }
700
BitBucketApiMock >> mergedMergeRequest [
1✔
701

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

1✔
892
        ^ pullRequest := (NeoJSONReader on: pullRequest readStream) next
1✔
893
]
1✔
894

895
{ #category : #accessing }
896
BitBucketApiMock >> openedMergeRequest [
1✔
897

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

1✔
1087
        ^pullRequest := (NeoJSONReader on: pullRequest readStream) next.
1✔
1088
]
1✔
1089

1090
{ #category : #accessing }
1091
BitBucketApiMock >> projects [
1✔
1092

1✔
1093
        | projects |
1✔
1094
        projects := '[
1✔
1095
    {
1✔
1096
      "key": "PRJ",
1✔
1097
      "id": 1,
1✔
1098
      "name": "My Cool Project",
1✔
1099
      "description": "The description for my cool project.",
1✔
1100
      "public": true,
1✔
1101
      "type": "NORMAL",
1✔
1102
      "links": {
1✔
1103
        "self": [{"href": "http://link/to/project"}]
1✔
1104
      }
1✔
1105
    }
1✔
1106
  ],
1✔
1107
'.
1✔
1108

1✔
1109
        projects := (NeoJSONReader on: projects readStream) next.
1✔
1110

1✔
1111
        ^ projects
1✔
1112
]
1✔
1113

1114
{ #category : #accessing }
1115
BitBucketApiMock >> pullRequestActivities [
1✔
1116

1✔
1117
        | pullRequestActivities |
1✔
1118
        pullRequestActivities := '
1✔
1119
    [{
1✔
1120
      "id": 1,
1✔
1121
      "createdDate": 1720510446734,
1✔
1122
      "user": {
1✔
1123
        "name": "user-name",
1✔
1124
        "emailAddress": "user-name@email.com",
1✔
1125
        "id": 24,
1✔
1126
        "displayName": "user name",
1✔
1127
        "active": true,
1✔
1128
        "slug": "un",
1✔
1129
        "type": "NORMAL",
1✔
1130
        "links": {
1✔
1131
          "self": [
1✔
1132
            {
1✔
1133
              "href": "link"
1✔
1134
            }
1✔
1135
          ]
1✔
1136
        }
1✔
1137
      },
1✔
1138
      "action": "MERGED"
1✔
1139
}]'.
1✔
1140

1✔
1141
        ^ pullRequestActivities := (NeoJSONReader on:
1✔
1142
                                            pullRequestActivities readStream) next
1✔
1143
]
1✔
1144

1145
{ #category : #'api - pull-requests' }
1146
BitBucketApiMock >> pullRequestsOfRepoProjectId: repoSlug inProjectGroupId: projectKey since: since until: until [
1✔
1147
        
1✔
1148
        ^ mergeRequests
1✔
1149
]
1✔
1150

1151
{ #category : #'api - projects' }
1152
BitBucketApiMock >> repositoryProjectsOfProjectGroupId: projectKey [
1✔
1153

1✔
1154
        | repos |
1✔
1155
        repos := '[
1✔
1156
    {
1✔
1157
      "slug": "my-repo",
1✔
1158
      "id": 1,
1✔
1159
      "name": "My repo",
1✔
1160
      "scmId": "git",
1✔
1161
      "state": "AVAILABLE",
1✔
1162
      "statusMessage": "Available",
1✔
1163
      "forkable": true,
1✔
1164
      "project": {
1✔
1165
        "key": "PRJ",
1✔
1166
        "id": 1,
1✔
1167
        "name": "My Cool Project",
1✔
1168
        "description": "The description for my cool project.",
1✔
1169
        "public": true,
1✔
1170
        "type": "NORMAL",
1✔
1171
        "links": {
1✔
1172
          "self": [{"href": "http://link/to/project"}]
1✔
1173
        }
1✔
1174
      },
1✔
1175
      "public": true,
1✔
1176
      "links": {
1✔
1177
        "clone": [
1✔
1178
          {"href": "ssh://git@<baseURL>/PRJ/my-repo.git", "name": "ssh"},
1✔
1179
          {"href": "https://<baseURL>/scm/PRJ/my-repo.git", "name": "http"}
1✔
1180
        ],
1✔
1181
        "self": [{"href": "http://link/to/repository"}]
1✔
1182
      }
1✔
1183
    }
1✔
1184
  ],'.
1✔
1185

1✔
1186
repos := (NeoJSONReader on: repos readStream) next.
1✔
1187

1✔
1188
^repos
1✔
1189
]
1✔
1190

1191
{ #category : #accessing }
1192
BitBucketApiMock >> user1 [
1✔
1193

1✔
1194
        | user1 |
1✔
1195
        user1 := '
1✔
1196
    {
1✔
1197
      "name": "test",
1✔
1198
      "emailAddress": "test@test.com",
1✔
1199
      "id": 1,
1✔
1200
      "displayName": "test test",
1✔
1201
      "active": true,
1✔
1202
      "slug": "test",
1✔
1203
      "type": "NORMAL",
1✔
1204
      "directoryName": "directory",
1✔
1205
      "deletable": false,
1✔
1206
      "lastAuthenticationTimestamp": 1727444943000,
1✔
1207
      "mutableDetails": false,
1✔
1208
      "mutableGroups": true,
1✔
1209
      "links": {
1✔
1210
        "self": [
1✔
1211
          {
1✔
1212
            "href": "test.com"
1✔
1213
          }
1✔
1214
        ]
1✔
1215
      }
1✔
1216
    }
1✔
1217
  '.
1✔
1218

1✔
1219

1✔
1220
        ^ user1 := (NeoJSONReader on: user1 readStream) next
1✔
1221
]
1✔
1222

1223
{ #category : #accessing }
1224
BitBucketApiMock >> user: accountId [
×
UNCOV
1225

×
UNCOV
1226
        | user |
×
UNCOV
1227
        user := '{
×
UNCOV
1228
        "type": "user",
×
UNCOV
1229
        "nickname": "evzijst",
×
UNCOV
1230
        "display_name": "Erik van Zijst",
×
UNCOV
1231
                  "created_on": "12-04-2024",
×
UNCOV
1232
        "uuid": "{d301aafa-d676-4ee0-88be-962be7417567}"
×
UNCOV
1233
   }'.
×
UNCOV
1234

×
UNCOV
1235
        ^ user
×
UNCOV
1236
]
×
1237

1238
{ #category : #accessing }
1239
BitBucketApiMock >> userMock [
1✔
1240

1✔
1241
        ^ userMock
1✔
1242
]
1✔
1243

1244
{ #category : #accessing }
1245
BitBucketApiMock >> userMock: anObject [
1✔
1246

1✔
1247
        userMock := anObject
1✔
1248
]
1✔
1249

1250
{ #category : #'api - user' }
1251
BitBucketApiMock >> usersByUsername: username [
1✔
1252

1✔
1253
        userMock ifNil: [ ^Array new ] ifNotNil: [ ^{ userMock }]
1✔
1254
]
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