-
Notifications
You must be signed in to change notification settings - Fork 502
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3150 from jduval87/main
Handle null value in bitbucket API response for repository
- Loading branch information
Showing
2 changed files
with
55 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,28 @@ class BitbucketApiAlgTest extends CatsEffectSuite with Http4sDsl[MockEff] { | |
} | ||
}""" | ||
) | ||
case GET -> Root / "repositories" / "null-parenthood" / "base.g8" => | ||
Ok( | ||
json"""{ | ||
"name": "base.g8", | ||
"mainbranch": { | ||
"type": "branch", | ||
"name": "master" | ||
}, | ||
"owner": { | ||
"nickname": "fthomas" | ||
}, | ||
"links": { | ||
"clone": [ | ||
{ | ||
"href": "https://[email protected]/fthomas/base.g8.git", | ||
"name": "https" | ||
} | ||
] | ||
}, | ||
"parent": null | ||
}""" | ||
) | ||
case GET -> Root / "repositories" / "scala-steward" / "base.g8" => | ||
Ok( | ||
json"""{ | ||
|
@@ -248,6 +270,13 @@ class BitbucketApiAlgTest extends CatsEffectSuite with Http4sDsl[MockEff] { | |
assertIO(repoOut, parent) | ||
} | ||
|
||
test("createForkOrGetRepo without forking - handle null parent") { | ||
val repoOut = bitbucketApiAlg | ||
.createForkOrGetRepo(Repo("null-parenthood", "base.g8"), doNotFork = true) | ||
.runA(state) | ||
assertIO(repoOut, parent) | ||
} | ||
|
||
test("createForkOrGetRepoWithBranch") { | ||
bitbucketApiAlg | ||
.createForkOrGetRepoWithBranch(repo, doNotFork = false) | ||
|