Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 15a6e85

Browse filesBrowse files
Added missing test.
1 parent f3c9398 commit 15a6e85
Copy full SHA for 15a6e85

File tree

Expand file treeCollapse file tree

9 files changed

+468
-0
lines changed
Filter options
Expand file treeCollapse file tree

9 files changed

+468
-0
lines changed

‎src/test/java/org/kohsuke/github/GHReleaseTest.java

Copy file name to clipboardExpand all lines: src/test/java/org/kohsuke/github/GHReleaseTest.java
+25Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,29 @@ public void testMakeLatestRelease() throws Exception {
198198
}
199199
}
200200
}
201+
202+
/**
203+
* Tests creation of the release with `generate_release_notes parameter on`.
204+
* @throws Exception if any failure has happened.
205+
*/
206+
@Test
207+
public void testCreateReleaseWithNotes() throws Exception {
208+
GHRepository repo = gitHub.getRepository("hub4j-test-org/testCreateRelease");
209+
210+
String tagName = mockGitHub.getMethodName();
211+
GHRelease release = new GHReleaseBuilder(repo, tagName)
212+
.generateReleaseNotes(true)
213+
.create();
214+
try {
215+
GHRelease releaseCheck = repo.getRelease(release.getId());
216+
217+
assertThat(releaseCheck, notNullValue());
218+
assertThat(releaseCheck.getTagName(), is(tagName));
219+
assertThat(releaseCheck.isPrerelease(), is(false));
220+
assertThat(releaseCheck.getDiscussionUrl(), notNullValue());
221+
} finally {
222+
release.delete();
223+
assertThat(repo.getRelease(release.getId()), nullValue());
224+
}
225+
}
201226
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
{
2+
"id": 375534019,
3+
"node_id": "MDEwOlJlcG9zaXRvcnkzNzU1MzQwMTk=",
4+
"name": "testCreateRelease",
5+
"full_name": "hub4j-test-org/testCreateRelease",
6+
"private": false,
7+
"owner": {
8+
"login": "hub4j-test-org",
9+
"id": 7544739,
10+
"node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=",
11+
"avatar_url": "https://avatars.githubusercontent.com/u/7544739?v=4",
12+
"gravatar_id": "",
13+
"url": "https://api.github.com/users/hub4j-test-org",
14+
"html_url": "https://github.com/hub4j-test-org",
15+
"followers_url": "https://api.github.com/users/hub4j-test-org/followers",
16+
"following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}",
17+
"gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}",
18+
"starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}",
19+
"subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions",
20+
"organizations_url": "https://api.github.com/users/hub4j-test-org/orgs",
21+
"repos_url": "https://api.github.com/users/hub4j-test-org/repos",
22+
"events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}",
23+
"received_events_url": "https://api.github.com/users/hub4j-test-org/received_events",
24+
"type": "Organization",
25+
"site_admin": false
26+
},
27+
"html_url": "https://github.com/hub4j-test-org/testCreateRelease",
28+
"description": null,
29+
"fork": false,
30+
"url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease",
31+
"forks_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/forks",
32+
"keys_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/keys{/key_id}",
33+
"collaborators_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/collaborators{/collaborator}",
34+
"teams_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/teams",
35+
"hooks_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/hooks",
36+
"issue_events_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/issues/events{/number}",
37+
"events_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/events",
38+
"assignees_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/assignees{/user}",
39+
"branches_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/branches{/branch}",
40+
"tags_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/tags",
41+
"blobs_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/git/blobs{/sha}",
42+
"git_tags_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/git/tags{/sha}",
43+
"git_refs_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/git/refs{/sha}",
44+
"trees_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/git/trees{/sha}",
45+
"statuses_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/statuses/{sha}",
46+
"languages_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/languages",
47+
"stargazers_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/stargazers",
48+
"contributors_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/contributors",
49+
"subscribers_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/subscribers",
50+
"subscription_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/subscription",
51+
"commits_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/commits{/sha}",
52+
"git_commits_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/git/commits{/sha}",
53+
"comments_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/comments{/number}",
54+
"issue_comment_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/issues/comments{/number}",
55+
"contents_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/contents/{+path}",
56+
"compare_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/compare/{base}...{head}",
57+
"merges_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/merges",
58+
"archive_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/{archive_format}{/ref}",
59+
"downloads_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/downloads",
60+
"issues_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/issues{/number}",
61+
"pulls_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/pulls{/number}",
62+
"milestones_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/milestones{/number}",
63+
"notifications_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/notifications{?since,all,participating}",
64+
"labels_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/labels{/name}",
65+
"releases_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/releases{/id}",
66+
"deployments_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/deployments",
67+
"created_at": "2021-06-10T01:25:59Z",
68+
"updated_at": "2021-06-10T01:31:14Z",
69+
"pushed_at": "2021-06-10T16:14:27Z",
70+
"git_url": "git://github.com/hub4j-test-org/testCreateRelease.git",
71+
"ssh_url": "git@github.com:hub4j-test-org/testCreateRelease.git",
72+
"clone_url": "https://github.com/hub4j-test-org/testCreateRelease.git",
73+
"svn_url": "https://github.com/hub4j-test-org/testCreateRelease",
74+
"homepage": null,
75+
"size": 11948,
76+
"stargazers_count": 0,
77+
"watchers_count": 0,
78+
"language": "Java",
79+
"has_issues": false,
80+
"has_projects": false,
81+
"has_downloads": true,
82+
"has_wiki": false,
83+
"has_pages": false,
84+
"forks_count": 0,
85+
"mirror_url": null,
86+
"archived": false,
87+
"disabled": false,
88+
"open_issues_count": 0,
89+
"license": {
90+
"key": "mit",
91+
"name": "MIT License",
92+
"spdx_id": "MIT",
93+
"url": "https://api.github.com/licenses/mit",
94+
"node_id": "MDc6TGljZW5zZTEz"
95+
},
96+
"forks": 0,
97+
"open_issues": 0,
98+
"watchers": 0,
99+
"default_branch": "main",
100+
"permissions": {
101+
"admin": true,
102+
"push": true,
103+
"pull": true
104+
},
105+
"temp_clone_token": "",
106+
"allow_squash_merge": true,
107+
"allow_merge_commit": true,
108+
"allow_rebase_merge": true,
109+
"delete_branch_on_merge": false,
110+
"organization": {
111+
"login": "hub4j-test-org",
112+
"id": 7544739,
113+
"node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=",
114+
"avatar_url": "https://avatars.githubusercontent.com/u/7544739?v=4",
115+
"gravatar_id": "",
116+
"url": "https://api.github.com/users/hub4j-test-org",
117+
"html_url": "https://github.com/hub4j-test-org",
118+
"followers_url": "https://api.github.com/users/hub4j-test-org/followers",
119+
"following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}",
120+
"gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}",
121+
"starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}",
122+
"subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions",
123+
"organizations_url": "https://api.github.com/users/hub4j-test-org/orgs",
124+
"repos_url": "https://api.github.com/users/hub4j-test-org/repos",
125+
"events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}",
126+
"received_events_url": "https://api.github.com/users/hub4j-test-org/received_events",
127+
"type": "Organization",
128+
"site_admin": false
129+
},
130+
"network_count": 0,
131+
"subscribers_count": 11
132+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/releases/44460162",
3+
"assets_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/releases/44460162/assets",
4+
"upload_url": "https://uploads.github.com/repos/hub4j-test-org/testCreateRelease/releases/44460162/assets{?name,label}",
5+
"html_url": "https://github.com/hub4j-test-org/testCreateRelease/releases/tag/testCreateSimpleRelease",
6+
"id": 44460162,
7+
"author": {
8+
"login": "jlengrand",
9+
"id": 921666,
10+
"node_id": "MDQ6VXNlcjkyMTY2Ng==",
11+
"avatar_url": "https://avatars.githubusercontent.com/u/921666?v=4",
12+
"gravatar_id": "",
13+
"url": "https://api.github.com/users/jlengrand",
14+
"html_url": "https://github.com/jlengrand",
15+
"followers_url": "https://api.github.com/users/jlengrand/followers",
16+
"following_url": "https://api.github.com/users/jlengrand/following{/other_user}",
17+
"gists_url": "https://api.github.com/users/jlengrand/gists{/gist_id}",
18+
"starred_url": "https://api.github.com/users/jlengrand/starred{/owner}{/repo}",
19+
"subscriptions_url": "https://api.github.com/users/jlengrand/subscriptions",
20+
"organizations_url": "https://api.github.com/users/jlengrand/orgs",
21+
"repos_url": "https://api.github.com/users/jlengrand/repos",
22+
"events_url": "https://api.github.com/users/jlengrand/events{/privacy}",
23+
"received_events_url": "https://api.github.com/users/jlengrand/received_events",
24+
"type": "User",
25+
"site_admin": false
26+
},
27+
"node_id": "MDc6UmVsZWFzZTQ0NDYwMTYy",
28+
"tag_name": "testCreateSimpleRelease",
29+
"target_commitish": "main",
30+
"name": null,
31+
"draft": false,
32+
"prerelease": false,
33+
"created_at": "2021-06-02T21:59:14Z",
34+
"published_at": "2021-06-11T06:56:52Z",
35+
"assets": [],
36+
"tarball_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/tarball/testCreateSimpleRelease",
37+
"zipball_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/zipball/testCreateSimpleRelease",
38+
"body": null,
39+
"discussion_url": "https://github.com/hub4j-test-org/testCreateRelease/discussions/6"
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/releases/44460162",
3+
"assets_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/releases/44460162/assets",
4+
"upload_url": "https://uploads.github.com/repos/hub4j-test-org/testCreateRelease/releases/44460162/assets{?name,label}",
5+
"html_url": "https://github.com/hub4j-test-org/testCreateRelease/releases/tag/testCreateSimpleRelease",
6+
"id": 44460162,
7+
"author": {
8+
"login": "jlengrand",
9+
"id": 921666,
10+
"node_id": "MDQ6VXNlcjkyMTY2Ng==",
11+
"avatar_url": "https://avatars.githubusercontent.com/u/921666?v=4",
12+
"gravatar_id": "",
13+
"url": "https://api.github.com/users/jlengrand",
14+
"html_url": "https://github.com/jlengrand",
15+
"followers_url": "https://api.github.com/users/jlengrand/followers",
16+
"following_url": "https://api.github.com/users/jlengrand/following{/other_user}",
17+
"gists_url": "https://api.github.com/users/jlengrand/gists{/gist_id}",
18+
"starred_url": "https://api.github.com/users/jlengrand/starred{/owner}{/repo}",
19+
"subscriptions_url": "https://api.github.com/users/jlengrand/subscriptions",
20+
"organizations_url": "https://api.github.com/users/jlengrand/orgs",
21+
"repos_url": "https://api.github.com/users/jlengrand/repos",
22+
"events_url": "https://api.github.com/users/jlengrand/events{/privacy}",
23+
"received_events_url": "https://api.github.com/users/jlengrand/received_events",
24+
"type": "User",
25+
"site_admin": false
26+
},
27+
"node_id": "MDc6UmVsZWFzZTQ0NDYwMTYy",
28+
"tag_name": "testCreateReleaseWithNotes",
29+
"target_commitish": "main",
30+
"name": null,
31+
"draft": false,
32+
"prerelease": false,
33+
"created_at": "2021-06-02T21:59:14Z",
34+
"published_at": "2021-06-11T06:56:52Z",
35+
"assets": [],
36+
"tarball_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/tarball/testCreateSimpleRelease",
37+
"zipball_url": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/zipball/testCreateSimpleRelease",
38+
"body": null,
39+
"discussion_url": "https://github.com/hub4j-test-org/testCreateRelease/discussions/6"
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"id": "9662df75-a233-4594-b75e-062a2f61f0b4",
3+
"name": "repos_hub4j-test-org_testcreaterelease",
4+
"request": {
5+
"url": "/repos/hub4j-test-org/testCreateRelease",
6+
"method": "GET",
7+
"headers": {
8+
"Accept": {
9+
"equalTo": "application/vnd.github.v3+json"
10+
}
11+
}
12+
},
13+
"response": {
14+
"status": 200,
15+
"bodyFileName": "1-r_h_testcreaterelease.json",
16+
"headers": {
17+
"Server": "GitHub.com",
18+
"Date": "Fri, 11 Jun 2021 06:56:51 GMT",
19+
"Content-Type": "application/json; charset=utf-8",
20+
"Cache-Control": "private, max-age=60, s-maxage=60",
21+
"Vary": [
22+
"Accept, Authorization, Cookie, X-GitHub-OTP",
23+
"Accept-Encoding, Accept, X-Requested-With"
24+
],
25+
"ETag": "W/\"ef9d3ab50cfe0ffaaf23afcd5bf34b497f69be8ea9cdf2e52817c11ebc845494\"",
26+
"Last-Modified": "Thu, 10 Jun 2021 01:31:14 GMT",
27+
"X-OAuth-Scopes": "admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, repo, user, workflow, write:discussion, write:packages",
28+
"X-Accepted-OAuth-Scopes": "repo",
29+
"X-GitHub-Media-Type": "unknown, github.v3",
30+
"X-RateLimit-Limit": "5000",
31+
"X-RateLimit-Remaining": "4999",
32+
"X-RateLimit-Reset": "1623398211",
33+
"X-RateLimit-Used": "1",
34+
"X-RateLimit-Resource": "core",
35+
"Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
36+
"X-Frame-Options": "deny",
37+
"X-Content-Type-Options": "nosniff",
38+
"X-XSS-Protection": "0",
39+
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
40+
"Content-Security-Policy": "default-src 'none'",
41+
"X-GitHub-Request-Id": "E62F:E96C:32AE84C:33F7832:60C30933"
42+
}
43+
},
44+
"uuid": "9662df75-a233-4594-b75e-062a2f61f0b4",
45+
"persistent": true,
46+
"insertionIndex": 1
47+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"id": "2e081774-790c-4d7b-9f4b-71bad948a411",
3+
"name": "repos_hub4j-test-org_testcreaterelease_releases",
4+
"request": {
5+
"url": "/repos/hub4j-test-org/testCreateRelease/releases",
6+
"method": "POST",
7+
"headers": {
8+
"Accept": {
9+
"equalTo": "application/vnd.github.v3+json"
10+
}
11+
},
12+
"bodyPatterns" : [
13+
{
14+
"matchesJsonPath" : "$.[?(@.generate_release_notes == true)]"
15+
}
16+
]
17+
},
18+
"response": {
19+
"status": 201,
20+
"bodyFileName": "2-r_h_t_releases.json",
21+
"headers": {
22+
"Server": "GitHub.com",
23+
"Date": "Fri, 11 Jun 2021 06:56:52 GMT",
24+
"Content-Type": "application/json; charset=utf-8",
25+
"Cache-Control": "private, max-age=60, s-maxage=60",
26+
"Vary": [
27+
"Accept, Authorization, Cookie, X-GitHub-OTP",
28+
"Accept-Encoding, Accept, X-Requested-With"
29+
],
30+
"ETag": "\"c0ff7f2f2ceb987472055c911610b16469c63e1928f209d5f58045a6e1cf861c\"",
31+
"X-OAuth-Scopes": "admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, repo, user, workflow, write:discussion, write:packages",
32+
"X-Accepted-OAuth-Scopes": "repo",
33+
"X-GitHub-Media-Type": "unknown, github.v3",
34+
"X-RateLimit-Limit": "5000",
35+
"X-RateLimit-Remaining": "4998",
36+
"X-RateLimit-Reset": "1623398211",
37+
"X-RateLimit-Used": "2",
38+
"X-RateLimit-Resource": "core",
39+
"Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
40+
"X-Frame-Options": "deny",
41+
"X-Content-Type-Options": "nosniff",
42+
"X-XSS-Protection": "0",
43+
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
44+
"Content-Security-Policy": "default-src 'none'",
45+
"X-GitHub-Request-Id": "E630:CE80:ED7A93:F2C7E4:60C30933",
46+
"Location": "https://api.github.com/repos/hub4j-test-org/testCreateRelease/releases/44460162"
47+
}
48+
},
49+
"uuid": "2e081774-790c-4d7b-9f4b-71bad948a411",
50+
"persistent": true,
51+
"insertionIndex": 2
52+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"id": "16bc45b2-4a87-46f2-977d-d0cbe7bf10ba",
3+
"name": "repos_hub4j-test-org_testcreaterelease_releases_44460162",
4+
"request": {
5+
"url": "/repos/hub4j-test-org/testCreateRelease/releases/44460162",
6+
"method": "GET",
7+
"headers": {
8+
"Accept": {
9+
"equalTo": "application/vnd.github.v3+json"
10+
}
11+
}
12+
},
13+
"response": {
14+
"status": 200,
15+
"bodyFileName": "3-r_h_t_releases_44460162.json",
16+
"headers": {
17+
"Server": "GitHub.com",
18+
"Date": "Fri, 11 Jun 2021 06:56:52 GMT",
19+
"Content-Type": "application/json; charset=utf-8",
20+
"Cache-Control": "private, max-age=60, s-maxage=60",
21+
"Vary": [
22+
"Accept, Authorization, Cookie, X-GitHub-OTP",
23+
"Accept-Encoding, Accept, X-Requested-With"
24+
],
25+
"ETag": "W/\"c0ff7f2f2ceb987472055c911610b16469c63e1928f209d5f58045a6e1cf861c\"",
26+
"Last-Modified": "Fri, 11 Jun 2021 06:56:52 GMT",
27+
"X-OAuth-Scopes": "admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, repo, user, workflow, write:discussion, write:packages",
28+
"X-Accepted-OAuth-Scopes": "repo",
29+
"X-GitHub-Media-Type": "unknown, github.v3",
30+
"X-RateLimit-Limit": "5000",
31+
"X-RateLimit-Remaining": "4997",
32+
"X-RateLimit-Reset": "1623398211",
33+
"X-RateLimit-Used": "3",
34+
"X-RateLimit-Resource": "core",
35+
"Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
36+
"X-Frame-Options": "deny",
37+
"X-Content-Type-Options": "nosniff",
38+
"X-XSS-Protection": "0",
39+
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
40+
"Content-Security-Policy": "default-src 'none'",
41+
"X-GitHub-Request-Id": "E631:E96A:C62EC6:D5D381:60C30934"
42+
}
43+
},
44+
"uuid": "16bc45b2-4a87-46f2-977d-d0cbe7bf10ba",
45+
"persistent": true,
46+
"scenarioName": "scenario-1-repos-hub4j-test-org-testCreateRelease-releases-44460162",
47+
"requiredScenarioState": "Started",
48+
"newScenarioState": "scenario-1-repos-hub4j-test-org-testCreateRelease-releases-44460162-2",
49+
"insertionIndex": 3
50+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.