Skip to content

Commit 3b58fbc

Browse files
test "target_url"
1 parent 55e589b commit 3b58fbc

2 files changed

Lines changed: 212 additions & 0 deletions

File tree

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,14 @@ public void status() throws Exception {
471471
assertThat(event.getState(), is(GHCommitState.SUCCESS));
472472
assertThat(event.getCommit().getSHA1(), is("9049f1265b7d61be4a8904a9a27120d2064dab3b"));
473473
assertThat(event.getRepository().getOwner().getLogin(), is("baxterthehacker"));
474+
assertNull(event.getTargetUrl());
475+
}
476+
477+
@Test
478+
public void status2() throws Exception {
479+
GHEventPayload.Status event = GitHub.offline()
480+
.parseEventPayload(payload.asReader(), GHEventPayload.Status.class);
481+
assertThat(event.getTargetUrl(), is("https://www.wikipedia.org/"));
474482
}
475483

476484
// TODO implement support classes and write test
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
{
2+
"id": 214015194,
3+
"sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b",
4+
"name": "baxterthehacker/public-repo",
5+
"target_url": "https://www.wikipedia.org/",
6+
"context": "default",
7+
"description": "status description",
8+
"state": "success",
9+
"commit": {
10+
"sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b",
11+
"commit": {
12+
"author": {
13+
"name": "baxterthehacker",
14+
"email": "baxterthehacker@users.noreply.github.com",
15+
"date": "2015-05-05T23:40:12Z"
16+
},
17+
"committer": {
18+
"name": "baxterthehacker",
19+
"email": "baxterthehacker@users.noreply.github.com",
20+
"date": "2015-05-05T23:40:12Z"
21+
},
22+
"message": "Initial commit",
23+
"tree": {
24+
"sha": "02b49ad0ba4f1acd9f06531b21e16a4ac5d341d0",
25+
"url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees/02b49ad0ba4f1acd9f06531b21e16a4ac5d341d0"
26+
},
27+
"url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits/9049f1265b7d61be4a8904a9a27120d2064dab3b",
28+
"comment_count": 1
29+
},
30+
"url": "https://api.github.com/repos/baxterthehacker/public-repo/commits/9049f1265b7d61be4a8904a9a27120d2064dab3b",
31+
"html_url": "https://github.com/baxterthehacker/public-repo/commit/9049f1265b7d61be4a8904a9a27120d2064dab3b",
32+
"comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits/9049f1265b7d61be4a8904a9a27120d2064dab3b/comments",
33+
"author": {
34+
"login": "baxterthehacker",
35+
"id": 6752317,
36+
"avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3",
37+
"gravatar_id": "",
38+
"url": "https://api.github.com/users/baxterthehacker",
39+
"html_url": "https://github.com/baxterthehacker",
40+
"followers_url": "https://api.github.com/users/baxterthehacker/followers",
41+
"following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}",
42+
"gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}",
43+
"starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}",
44+
"subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions",
45+
"organizations_url": "https://api.github.com/users/baxterthehacker/orgs",
46+
"repos_url": "https://api.github.com/users/baxterthehacker/repos",
47+
"events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}",
48+
"received_events_url": "https://api.github.com/users/baxterthehacker/received_events",
49+
"type": "User",
50+
"site_admin": false
51+
},
52+
"committer": {
53+
"login": "baxterthehacker",
54+
"id": 6752317,
55+
"avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3",
56+
"gravatar_id": "",
57+
"url": "https://api.github.com/users/baxterthehacker",
58+
"html_url": "https://github.com/baxterthehacker",
59+
"followers_url": "https://api.github.com/users/baxterthehacker/followers",
60+
"following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}",
61+
"gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}",
62+
"starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}",
63+
"subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions",
64+
"organizations_url": "https://api.github.com/users/baxterthehacker/orgs",
65+
"repos_url": "https://api.github.com/users/baxterthehacker/repos",
66+
"events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}",
67+
"received_events_url": "https://api.github.com/users/baxterthehacker/received_events",
68+
"type": "User",
69+
"site_admin": false
70+
},
71+
"parents": []
72+
},
73+
"branches": [
74+
{
75+
"name": "master",
76+
"commit": {
77+
"sha": "9049f1265b7d61be4a8904a9a27120d2064dab3b",
78+
"url": "https://api.github.com/repos/baxterthehacker/public-repo/commits/9049f1265b7d61be4a8904a9a27120d2064dab3b"
79+
}
80+
},
81+
{
82+
"name": "changes",
83+
"commit": {
84+
"sha": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c",
85+
"url": "https://api.github.com/repos/baxterthehacker/public-repo/commits/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c"
86+
}
87+
},
88+
{
89+
"name": "gh-pages",
90+
"commit": {
91+
"sha": "b11bb7545ac14abafc6191a0481b0d961e7793c6",
92+
"url": "https://api.github.com/repos/baxterthehacker/public-repo/commits/b11bb7545ac14abafc6191a0481b0d961e7793c6"
93+
}
94+
}
95+
],
96+
"created_at": "2015-05-05T23:40:39Z",
97+
"updated_at": "2015-05-05T23:40:39Z",
98+
"repository": {
99+
"id": 35129377,
100+
"name": "public-repo",
101+
"full_name": "baxterthehacker/public-repo",
102+
"owner": {
103+
"login": "baxterthehacker",
104+
"id": 6752317,
105+
"avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3",
106+
"gravatar_id": "",
107+
"url": "https://api.github.com/users/baxterthehacker",
108+
"html_url": "https://github.com/baxterthehacker",
109+
"followers_url": "https://api.github.com/users/baxterthehacker/followers",
110+
"following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}",
111+
"gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}",
112+
"starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}",
113+
"subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions",
114+
"organizations_url": "https://api.github.com/users/baxterthehacker/orgs",
115+
"repos_url": "https://api.github.com/users/baxterthehacker/repos",
116+
"events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}",
117+
"received_events_url": "https://api.github.com/users/baxterthehacker/received_events",
118+
"type": "User",
119+
"site_admin": false
120+
},
121+
"private": false,
122+
"html_url": "https://github.com/baxterthehacker/public-repo",
123+
"description": "",
124+
"fork": false,
125+
"url": "https://api.github.com/repos/baxterthehacker/public-repo",
126+
"forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks",
127+
"keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}",
128+
"collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}",
129+
"teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams",
130+
"hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks",
131+
"issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}",
132+
"events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events",
133+
"assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}",
134+
"branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}",
135+
"tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags",
136+
"blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}",
137+
"git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}",
138+
"git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}",
139+
"trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}",
140+
"statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}",
141+
"languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages",
142+
"stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers",
143+
"contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors",
144+
"subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers",
145+
"subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription",
146+
"commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}",
147+
"git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}",
148+
"comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}",
149+
"issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}",
150+
"contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}",
151+
"compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}",
152+
"merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges",
153+
"archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}",
154+
"downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads",
155+
"issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}",
156+
"pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}",
157+
"milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}",
158+
"notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}",
159+
"labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}",
160+
"releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}",
161+
"created_at": "2015-05-05T23:40:12Z",
162+
"updated_at": "2015-05-05T23:40:30Z",
163+
"pushed_at": "2015-05-05T23:40:39Z",
164+
"git_url": "git://github.com/baxterthehacker/public-repo.git",
165+
"ssh_url": "git@github.com:baxterthehacker/public-repo.git",
166+
"clone_url": "https://github.com/baxterthehacker/public-repo.git",
167+
"svn_url": "https://github.com/baxterthehacker/public-repo",
168+
"homepage": null,
169+
"size": 0,
170+
"stargazers_count": 0,
171+
"watchers_count": 0,
172+
"language": null,
173+
"has_issues": true,
174+
"has_downloads": true,
175+
"has_wiki": true,
176+
"has_pages": true,
177+
"forks_count": 0,
178+
"mirror_url": null,
179+
"open_issues_count": 2,
180+
"forks": 0,
181+
"open_issues": 2,
182+
"watchers": 0,
183+
"default_branch": "master"
184+
},
185+
"sender": {
186+
"login": "baxterthehacker",
187+
"id": 6752317,
188+
"avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3",
189+
"gravatar_id": "",
190+
"url": "https://api.github.com/users/baxterthehacker",
191+
"html_url": "https://github.com/baxterthehacker",
192+
"followers_url": "https://api.github.com/users/baxterthehacker/followers",
193+
"following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}",
194+
"gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}",
195+
"starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}",
196+
"subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions",
197+
"organizations_url": "https://api.github.com/users/baxterthehacker/orgs",
198+
"repos_url": "https://api.github.com/users/baxterthehacker/repos",
199+
"events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}",
200+
"received_events_url": "https://api.github.com/users/baxterthehacker/received_events",
201+
"type": "User",
202+
"site_admin": false
203+
}
204+
}

0 commit comments

Comments
 (0)