Skip to content

Commit

Permalink
Merge pull request #54 from cloudogu/bugfix/location_for_prId
Browse files Browse the repository at this point in the history
Bugfix/location for pr
  • Loading branch information
thoppenheidt authored Feb 25, 2021
2 parents f7334c4 + 69e73a4 commit 01970ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/com/cloudogu/ces/cesbuildlib/SCMManager.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SCMManager implements Serializable {
}

// example: "location: https://some/pr/42" - extract id
return httpResponse.headers.location.split("/")[-1]
return httpResponse.headers.Location.split("/")[-1]
}

boolean updatePullRequest(String repository, String pullRequestId, String title, String description) {
Expand Down
6 changes: 3 additions & 3 deletions test/com/cloudogu/ces/cesbuildlib/SCMManagerTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class SCMManagerTest {

return [
httpCode: '201',
headers: [ location: 'https://a/long/url/with/id/id/12' ]
headers: [ Location: 'https://a/long/url/with/id/id/12' ]
]
})

Expand All @@ -110,7 +110,7 @@ class SCMManagerTest {
void "error on pull request creation makes build unstable"() {
when(httpMock.post(any(), any(), any())).thenReturn([
httpCode: '500',
headers: [ location: 'https://a/long/url/with/id/id/12' ]
headers: [ Location: 'https://a/long/url/with/id/id/12' ]
])

def id = scmm.createPullRequest(repo, 'source', 'target', 'title', 'description')
Expand Down Expand Up @@ -192,7 +192,7 @@ class SCMManagerTest {

return [
httpCode: '201',
headers: [ location: 'https://a/long/url/with/id/id/12' ]
headers: [ Location: 'https://a/long/url/with/id/id/12' ]
]
})

Expand Down

0 comments on commit 01970ee

Please sign in to comment.