Skip to content

Commit 6953e2d

Browse files
committed
Add Wiremock files for checkNonExistentAuthor test
1 parent ada9b49 commit 6953e2d

File tree

9 files changed

+687
-4
lines changed

9 files changed

+687
-4
lines changed

src/test/java/org/kohsuke/github/GHPullRequestTest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ public void getUserTest() throws IOException {
545545
}
546546

547547
@Test
548-
public void checkNonExistentReviewer() throws IOException, NullPointerException {
548+
public void checkNonExistentReviewer() throws IOException {
549549
// PR id is based on https://github.com/sahansera/TestRepo/pull/1
550550
final GHPullRequest pullRequest = getRepository().getPullRequest(1);
551551
final Optional<GHPullRequestReview> review = pullRequest.listReviews().toList().stream().findFirst();
@@ -557,10 +557,11 @@ public void checkNonExistentReviewer() throws IOException, NullPointerException
557557
}
558558

559559
@Test
560-
public void checkNonExistentUser() throws IOException {
561-
final GHRepository repository = getRepository();
562-
final GHPullRequest pullRequest = repository.getPullRequest(2);
560+
public void checkNonExistentAuthor() throws IOException {
561+
// PR id is based on https://github.com/sahansera/TestRepo/pull/2
562+
final GHPullRequest pullRequest = getRepository().getPullRequest(2);
563563

564+
assertThat(pullRequest.getUser(), is(notNullValue()));
564565
assertThat(pullRequest.getUser().login, is("ghost"));
565566
}
566567

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"login": "hub4j-test-org",
3+
"id": 2032296,
4+
"node_id": "MDQ6VXNlcjIwMzIyOTY=",
5+
"avatar_url": "https://avatars.githubusercontent.com/u/2032296?v=4",
6+
"gravatar_id": "",
7+
"url": "https://api.github.com/users/hub4j-test-org",
8+
"html_url": "https://github.com/hub4j-test-org",
9+
"followers_url": "https://api.github.com/users/hub4j-test-org/followers",
10+
"following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}",
11+
"gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}",
12+
"starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}",
13+
"subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions",
14+
"organizations_url": "https://api.github.com/users/hub4j-test-org/orgs",
15+
"repos_url": "https://api.github.com/users/hub4j-test-org/repos",
16+
"events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}",
17+
"received_events_url": "https://api.github.com/users/hub4j-test-org/received_events",
18+
"type": "User"
19+
}
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
{
2+
"id": 423321524,
3+
"node_id": "R_kgDOGTtftA",
4+
"name": "github-api",
5+
"full_name": "hub4j-test-org/github-api",
6+
"private": false,
7+
"owner": {
8+
"login": "hub4j-test-org",
9+
"id": 2032296,
10+
"node_id": "MDQ6VXNlcjIwMzIyOTY=",
11+
"avatar_url": "https://avatars.githubusercontent.com/u/2032296?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": "User",
25+
"site_admin": true
26+
},
27+
"html_url": "https://github.com/hub4j-test-org/github-api",
28+
"description": "Recreating an issue",
29+
"fork": false,
30+
"url": "https://api.github.com/repos/hub4j-test-org/github-api",
31+
"forks_url": "https://api.github.com/repos/hub4j-test-org/github-api/forks",
32+
"keys_url": "https://api.github.com/repos/hub4j-test-org/github-api/keys{/key_id}",
33+
"collaborators_url": "https://api.github.com/repos/hub4j-test-org/github-api/collaborators{/collaborator}",
34+
"teams_url": "https://api.github.com/repos/hub4j-test-org/github-api/teams",
35+
"hooks_url": "https://api.github.com/repos/hub4j-test-org/github-api/hooks",
36+
"issue_events_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/events{/number}",
37+
"events_url": "https://api.github.com/repos/hub4j-test-org/github-api/events",
38+
"assignees_url": "https://api.github.com/repos/hub4j-test-org/github-api/assignees{/user}",
39+
"branches_url": "https://api.github.com/repos/hub4j-test-org/github-api/branches{/branch}",
40+
"tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/tags",
41+
"blobs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/blobs{/sha}",
42+
"git_tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/tags{/sha}",
43+
"git_refs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/refs{/sha}",
44+
"trees_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/trees{/sha}",
45+
"statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/{sha}",
46+
"languages_url": "https://api.github.com/repos/hub4j-test-org/github-api/languages",
47+
"stargazers_url": "https://api.github.com/repos/hub4j-test-org/github-api/stargazers",
48+
"contributors_url": "https://api.github.com/repos/hub4j-test-org/github-api/contributors",
49+
"subscribers_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscribers",
50+
"subscription_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscription",
51+
"commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/commits{/sha}",
52+
"git_commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/commits{/sha}",
53+
"comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/comments{/number}",
54+
"issue_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments{/number}",
55+
"contents_url": "https://api.github.com/repos/hub4j-test-org/github-api/contents/{+path}",
56+
"compare_url": "https://api.github.com/repos/hub4j-test-org/github-api/compare/{base}...{head}",
57+
"merges_url": "https://api.github.com/repos/hub4j-test-org/github-api/merges",
58+
"archive_url": "https://api.github.com/repos/hub4j-test-org/github-api/{archive_format}{/ref}",
59+
"downloads_url": "https://api.github.com/repos/hub4j-test-org/github-api/downloads",
60+
"issues_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues{/number}",
61+
"pulls_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls{/number}",
62+
"milestones_url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones{/number}",
63+
"notifications_url": "https://api.github.com/repos/hub4j-test-org/github-api/notifications{?since,all,participating}",
64+
"labels_url": "https://api.github.com/repos/hub4j-test-org/github-api/labels{/name}",
65+
"releases_url": "https://api.github.com/repos/hub4j-test-org/github-api/releases{/id}",
66+
"deployments_url": "https://api.github.com/repos/hub4j-test-org/github-api/deployments",
67+
"created_at": "2021-11-01T03:08:27Z",
68+
"updated_at": "2021-11-01T03:09:57Z",
69+
"pushed_at": "2021-11-08T13:29:40Z",
70+
"git_url": "git://github.com/hub4j-test-org/github-api.git",
71+
"ssh_url": "git@github.com:hub4j-test-org/github-api.git",
72+
"clone_url": "https://github.com/hub4j-test-org/github-api.git",
73+
"svn_url": "https://github.com/hub4j-test-org/github-api",
74+
"homepage": null,
75+
"size": 2,
76+
"stargazers_count": 0,
77+
"watchers_count": 0,
78+
"language": null,
79+
"has_issues": true,
80+
"has_projects": true,
81+
"has_downloads": true,
82+
"has_wiki": true,
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": null,
90+
"allow_forking": true,
91+
"is_template": false,
92+
"topics": [],
93+
"visibility": "public",
94+
"forks": 0,
95+
"open_issues": 0,
96+
"watchers": 0,
97+
"default_branch": "main",
98+
"permissions": {
99+
"admin": true,
100+
"maintain": true,
101+
"push": true,
102+
"triage": 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+
"allow_auto_merge": false,
110+
"delete_branch_on_merge": false,
111+
"allow_update_branch": false,
112+
"network_count": 0,
113+
"subscribers_count": 1
114+
}

0 commit comments

Comments
 (0)