1
1
Class {
2
- #name : ' BitBucketApiMock' ,
3
- #superclass : ' Object' ,
2
+ #name : # BitBucketApiMock ,
3
+ #superclass : # Object ,
4
4
#instVars : [
5
5
' userMock' ,
6
6
' commits' ,
7
7
' diffs' ,
8
8
' mergeRequests'
9
9
],
10
- #category : ' BitBucketHealth-Model-Importer-Tests' ,
11
- #package : ' BitBucketHealth-Model-Importer-Tests'
10
+ #category : #' BitBucketHealth-Model-Importer-Tests'
12
11
}
13
12
14
- { #category : ' api - pull-requests' }
13
+ { #category : # ' api - pull-requests' }
15
14
BitBucketApiMock >> activitiesOfPullRequest: pullRequestId inRepoProjectId: repoSlug ofProjectGroupId: projectKey [
16
15
17
16
^ self pullRequestActivities
18
17
]
19
18
20
- { #category : ' accessing' }
19
+ { #category : # accessing }
21
20
BitBucketApiMock >> commit2 [
22
21
23
22
| commits2 |
@@ -49,13 +48,13 @@ BitBucketApiMock >> commit2 [
49
48
^ commits2 := (NeoJSONReader on: commits2 readStream) next
50
49
]
51
50
52
- { #category : ' accessing' }
51
+ { #category : # accessing }
53
52
BitBucketApiMock >> commits [
54
53
55
54
^ commits
56
55
]
57
56
58
- { #category : ' accessing' }
57
+ { #category : # accessing }
59
58
BitBucketApiMock >> commits1 [
60
59
61
60
| commits1 |
@@ -87,19 +86,19 @@ BitBucketApiMock >> commits1 [
87
86
^ commits1 := (NeoJSONReader on: commits1 readStream) next
88
87
]
89
88
90
- { #category : ' accessing' }
89
+ { #category : # accessing }
91
90
BitBucketApiMock >> commits: anObject [
92
91
93
92
commits := anObject
94
93
]
95
94
96
- { #category : ' api - pull-requests' }
95
+ { #category : # ' api - pull-requests' }
97
96
BitBucketApiMock >> commitsOfPullRequest: mergeRequestId ofRepoProjectId: repoSlug inProjectGroupId: projectKey [
98
97
99
98
^ commits
100
99
]
101
100
102
- { #category : ' api - projects' }
101
+ { #category : # ' api - projects' }
103
102
BitBucketApiMock >> commitsOfRepoProjectId: repositorySlug inProjectGroupId: projectKey since: since until: until [
104
103
105
104
^ self commits select: [ :commit |
@@ -111,7 +110,7 @@ BitBucketApiMock >> commitsOfRepoProjectId: repositorySlug inProjectGroupId: pro
111
110
commitDate >= since asDate and : commitDate <= until asDate ]
112
111
]
113
112
114
- { #category : ' accessing' }
113
+ { #category : # accessing }
115
114
BitBucketApiMock >> declinedMergeRequest [
116
115
117
116
| pullRequest |
@@ -307,13 +306,13 @@ BitBucketApiMock >> declinedMergeRequest [
307
306
^ pullRequest := (NeoJSONReader on: pullRequest readStream) next
308
307
]
309
308
310
- { #category : ' accessing' }
309
+ { #category : # accessing }
311
310
BitBucketApiMock >> diffs [
312
311
313
312
^ diffs
314
313
]
315
314
316
- { #category : ' accessing' }
315
+ { #category : # accessing }
317
316
BitBucketApiMock >> diffs1 [
318
317
319
318
| diffs1 |
@@ -410,18 +409,49 @@ BitBucketApiMock >> diffs1 [
410
409
^ diffs1 := (NeoJSONReader on: diffs1 readStream) next
411
410
]
412
411
413
- { #category : ' accessing' }
412
+ { #category : # accessing }
414
413
BitBucketApiMock >> diffs: anObject [
415
414
416
415
diffs := anObject
417
416
]
418
417
419
- { #category : ' api - commits' }
418
+ { #category : #accessing }
419
+ BitBucketApiMock >> diffsNohunks [
420
+
421
+ | diffs1 |
422
+ diffs1 := ' {
423
+ "fromHash": null,
424
+ "toHash": "123",
425
+ "contextLines": 10,
426
+ "whitespace": "SHOW",
427
+ "diffs": [
428
+ {
429
+ "source": null,
430
+ "destination": {
431
+ "components": [
432
+ "api",
433
+ "api.xlsx"
434
+ ],
435
+ "parent": "api",
436
+ "name": "api.xlsx",
437
+ "extension": "xlsx",
438
+ "toString": "api/api.xlsx"
439
+ },
440
+ "binary": true
441
+ }
442
+ ],
443
+ "truncated": false
444
+ }' .
445
+
446
+ ^ diffs1 := (NeoJSONReader on: diffs1 readStream) next
447
+ ]
448
+
449
+ { #category : #' api - commits' }
420
450
BitBucketApiMock >> diffsOfCommit: commitID inRepoProjectId: repositorySlug inProjectGroupId: projectKey [
421
451
^ diffs
422
452
]
423
453
424
- { #category : ' accessing' }
454
+ { #category : # accessing }
425
455
BitBucketApiMock >> diffsWithoutAdded [
426
456
427
457
| diffsWithoutAdded |
@@ -519,7 +549,7 @@ BitBucketApiMock >> diffsWithoutAdded [
519
549
diffsWithoutAdded readStream) next
520
550
]
521
551
522
- { #category : ' accessing' }
552
+ { #category : # accessing }
523
553
BitBucketApiMock >> diffsWithoutHunks [
524
554
525
555
| diffsWithoutHunks |
@@ -559,7 +589,7 @@ BitBucketApiMock >> diffsWithoutHunks [
559
589
diffsWithoutHunks readStream) next
560
590
]
561
591
562
- { #category : ' accessing' }
592
+ { #category : # accessing }
563
593
BitBucketApiMock >> diffsWithoutRemoved [
564
594
565
595
| diffsWithoutRemoved |
@@ -645,7 +675,7 @@ BitBucketApiMock >> diffsWithoutRemoved [
645
675
diffsWithoutRemoved readStream) next
646
676
]
647
677
648
- { #category : ' initialization' }
678
+ { #category : # initialization }
649
679
BitBucketApiMock >> initialize [
650
680
651
681
commits := self commits1.
@@ -654,19 +684,19 @@ BitBucketApiMock >> initialize [
654
684
mergeRequests := { self openedMergeRequest }
655
685
]
656
686
657
- { #category : ' accessing' }
687
+ { #category : # accessing }
658
688
BitBucketApiMock >> mergeRequests [
659
689
660
690
^ mergeRequests
661
691
]
662
692
663
- { #category : ' accessing' }
693
+ { #category : # accessing }
664
694
BitBucketApiMock >> mergeRequests: anObject [
665
695
666
696
mergeRequests := anObject
667
697
]
668
698
669
- { #category : ' accessing' }
699
+ { #category : # accessing }
670
700
BitBucketApiMock >> mergedMergeRequest [
671
701
672
702
| pullRequest |
@@ -862,7 +892,7 @@ BitBucketApiMock >> mergedMergeRequest [
862
892
^ pullRequest := (NeoJSONReader on: pullRequest readStream) next
863
893
]
864
894
865
- { #category : ' accessing' }
895
+ { #category : # accessing }
866
896
BitBucketApiMock >> openedMergeRequest [
867
897
868
898
| pullRequest |
@@ -1057,7 +1087,7 @@ BitBucketApiMock >> openedMergeRequest [
1057
1087
^ pullRequest := (NeoJSONReader on: pullRequest readStream) next.
1058
1088
]
1059
1089
1060
- { #category : ' accessing' }
1090
+ { #category : # accessing }
1061
1091
BitBucketApiMock >> projects [
1062
1092
1063
1093
| projects |
@@ -1081,7 +1111,7 @@ BitBucketApiMock >> projects [
1081
1111
^ projects
1082
1112
]
1083
1113
1084
- { #category : ' accessing' }
1114
+ { #category : # accessing }
1085
1115
BitBucketApiMock >> pullRequestActivities [
1086
1116
1087
1117
| pullRequestActivities |
@@ -1112,13 +1142,13 @@ BitBucketApiMock >> pullRequestActivities [
1112
1142
pullRequestActivities readStream) next
1113
1143
]
1114
1144
1115
- { #category : ' api - pull-requests' }
1145
+ { #category : # ' api - pull-requests' }
1116
1146
BitBucketApiMock >> pullRequestsOfRepoProjectId: repoSlug inProjectGroupId: projectKey since: since until: until [
1117
1147
1118
1148
^ mergeRequests
1119
1149
]
1120
1150
1121
- { #category : ' api - projects' }
1151
+ { #category : # ' api - projects' }
1122
1152
BitBucketApiMock >> repositoryProjectsOfProjectGroupId: projectKey [
1123
1153
1124
1154
| repos |
@@ -1158,7 +1188,7 @@ repos := (NeoJSONReader on: repos readStream) next.
1158
1188
^ repos
1159
1189
]
1160
1190
1161
- { #category : ' accessing' }
1191
+ { #category : # accessing }
1162
1192
BitBucketApiMock >> user1 [
1163
1193
1164
1194
| user1 |
@@ -1190,7 +1220,7 @@ BitBucketApiMock >> user1 [
1190
1220
^ user1 := (NeoJSONReader on: user1 readStream) next
1191
1221
]
1192
1222
1193
- { #category : ' accessing' }
1223
+ { #category : # accessing }
1194
1224
BitBucketApiMock >> user: accountId [
1195
1225
1196
1226
| user |
@@ -1205,19 +1235,19 @@ BitBucketApiMock >> user: accountId [
1205
1235
^ user
1206
1236
]
1207
1237
1208
- { #category : ' accessing' }
1238
+ { #category : # accessing }
1209
1239
BitBucketApiMock >> userMock [
1210
1240
1211
1241
^ userMock
1212
1242
]
1213
1243
1214
- { #category : ' accessing' }
1244
+ { #category : # accessing }
1215
1245
BitBucketApiMock >> userMock: anObject [
1216
1246
1217
1247
userMock := anObject
1218
1248
]
1219
1249
1220
- { #category : ' api - user' }
1250
+ { #category : # ' api - user' }
1221
1251
BitBucketApiMock >> usersByUsername: username [
1222
1252
1223
1253
userMock ifNil: [ ^ Array new ] ifNotNil: [ ^ { userMock }]
0 commit comments