Skip to content

Commit 33467de

Browse files
committed
Formatting and snapshot cleanup
1 parent f3528d9 commit 33467de

13 files changed

+158
-199
lines changed

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

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,24 @@
1111
public class GHOrganizationTest extends AbstractGitHubWireMockTest {
1212

1313
public static final String GITHUB_API_TEST = "github-api-test";
14+
public static final String TEAM_NAME_CREATE = "create-team-test";
1415

1516

17+
@Before
18+
@After
19+
public void cleanUpTeam() throws IOException {
20+
// Cleanup is only needed when proxying
21+
if (!mockGitHub.isUseProxy()) {
22+
return;
23+
}
24+
25+
GHTeam team = gitHubBeforeAfter.getOrganization(GITHUB_API_TEST_ORG).
26+
getTeamByName(TEAM_NAME_CREATE);
27+
if (team != null) {
28+
team.delete();
29+
}
30+
}
31+
1632
@Test
1733
public void testCreateRepository() throws IOException {
1834
cleanupRepository(GITHUB_API_TEST_ORG + '/' + GITHUB_API_TEST);
@@ -58,19 +74,6 @@ public void testInviteUser() throws IOException {
5874
// assertTrue(org.hasMember(user));
5975
}
6076

61-
@Before
62-
public void cleanUpTeam() throws IOException {
63-
// Cleanup is only needed when proxying
64-
if (!mockGitHub.isUseProxy()) {
65-
return;
66-
}
67-
68-
GHTeam team = gitHubBeforeAfter.getOrganization(GITHUB_API_TEST_ORG).
69-
getTeamByName("create-team-test");
70-
if (team != null) {
71-
team.delete();
72-
}
73-
}
7477

7578
@Test
7679
public void testCreateTeamWithRepoAccess() throws IOException {
@@ -80,7 +83,7 @@ public void testCreateTeamWithRepoAccess() throws IOException {
8083
GHRepository repo = org.getRepository(REPO_NAME);
8184

8285
// Create team with access to repository. Check access was granted.
83-
GHTeam team = org.createTeam("create-team-test", GHOrganization.Permission.PUSH, repo);
86+
GHTeam team = org.createTeam(TEAM_NAME_CREATE, GHOrganization.Permission.PUSH, repo);
8487
Assert.assertTrue(team.getRepositories().containsKey(REPO_NAME));
8588
}
8689
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"name": "create-team-test",
3-
"id": 3494908,
4-
"node_id": "MDQ6VGVhbTM0OTQ5MDg=",
3+
"id": 3501817,
4+
"node_id": "MDQ6VGVhbTM1MDE4MTc=",
55
"slug": "create-team-test",
66
"description": null,
77
"privacy": "secret",
8-
"url": "https://api.github.com/teams/3494908",
8+
"url": "https://api.github.com/teams/3501817",
99
"html_url": "https://github.com/orgs/github-api-test-org/teams/create-team-test",
10-
"members_url": "https://api.github.com/teams/3494908/members{/member}",
11-
"repositories_url": "https://api.github.com/teams/3494908/repos",
10+
"members_url": "https://api.github.com/teams/3501817/members{/member}",
11+
"repositories_url": "https://api.github.com/teams/3501817/repos",
1212
"permission": "push",
13-
"created_at": "2019-10-29T04:41:56Z",
14-
"updated_at": "2019-10-29T04:41:56Z",
13+
"created_at": "2019-11-01T16:29:09Z",
14+
"updated_at": "2019-11-01T16:29:09Z",
1515
"members_count": 0,
1616
"repos_count": 1,
1717
"organization": {

src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testCreateTeamWithRepoAccess/__files/orgs_github-api-test-org_teams-839c09cb-fad5-43ee-b026-32b86105c294.json

Lines changed: 0 additions & 67 deletions
This file was deleted.
Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"releases_url": "https://api.github.com/repos/github-api-test-org/github-api/releases{/id}",
6666
"deployments_url": "https://api.github.com/repos/github-api-test-org/github-api/deployments",
6767
"created_at": "2019-09-06T23:26:04Z",
68-
"updated_at": "2019-09-30T22:36:47Z",
68+
"updated_at": "2019-10-30T01:54:39Z",
6969
"pushed_at": "2019-10-21T22:34:49Z",
7070
"git_url": "git://github.com/github-api-test-org/github-api.git",
7171
"ssh_url": "git@github.com:github-api-test-org/github-api.git",
@@ -85,7 +85,7 @@
8585
"mirror_url": null,
8686
"archived": false,
8787
"disabled": false,
88-
"open_issues_count": 1,
88+
"open_issues_count": 0,
8989
"license": {
9090
"key": "mit",
9191
"name": "MIT License",
@@ -94,7 +94,7 @@
9494
"node_id": "MDc6TGljZW5zZTEz"
9595
},
9696
"forks": 0,
97-
"open_issues": 1,
97+
"open_issues": 0,
9898
"watchers": 0,
9999
"default_branch": "master",
100100
"permissions": {
@@ -192,37 +192,37 @@
192192
"releases_url": "https://api.github.com/repos/github-api/github-api/releases{/id}",
193193
"deployments_url": "https://api.github.com/repos/github-api/github-api/deployments",
194194
"created_at": "2010-04-19T04:13:03Z",
195-
"updated_at": "2019-10-28T06:11:20Z",
196-
"pushed_at": "2019-10-26T02:17:30Z",
195+
"updated_at": "2019-11-01T11:49:24Z",
196+
"pushed_at": "2019-11-01T01:49:29Z",
197197
"git_url": "git://github.com/github-api/github-api.git",
198198
"ssh_url": "git@github.com:github-api/github-api.git",
199199
"clone_url": "https://github.com/github-api/github-api.git",
200200
"svn_url": "https://github.com/github-api/github-api",
201201
"homepage": "http://github-api.kohsuke.org/",
202-
"size": 14742,
203-
"stargazers_count": 568,
204-
"watchers_count": 568,
202+
"size": 14820,
203+
"stargazers_count": 571,
204+
"watchers_count": 571,
205205
"language": "Java",
206206
"has_issues": true,
207207
"has_projects": true,
208208
"has_downloads": true,
209209
"has_wiki": true,
210210
"has_pages": true,
211-
"forks_count": 432,
211+
"forks_count": 434,
212212
"mirror_url": null,
213213
"archived": false,
214214
"disabled": false,
215-
"open_issues_count": 64,
215+
"open_issues_count": 66,
216216
"license": {
217217
"key": "mit",
218218
"name": "MIT License",
219219
"spdx_id": "MIT",
220220
"url": "https://api.github.com/licenses/mit",
221221
"node_id": "MDc6TGljZW5zZTEz"
222222
},
223-
"forks": 432,
224-
"open_issues": 64,
225-
"watchers": 568,
223+
"forks": 434,
224+
"open_issues": 66,
225+
"watchers": 571,
226226
"default_branch": "master"
227227
},
228228
"source": {
@@ -292,39 +292,39 @@
292292
"releases_url": "https://api.github.com/repos/github-api/github-api/releases{/id}",
293293
"deployments_url": "https://api.github.com/repos/github-api/github-api/deployments",
294294
"created_at": "2010-04-19T04:13:03Z",
295-
"updated_at": "2019-10-28T06:11:20Z",
296-
"pushed_at": "2019-10-26T02:17:30Z",
295+
"updated_at": "2019-11-01T11:49:24Z",
296+
"pushed_at": "2019-11-01T01:49:29Z",
297297
"git_url": "git://github.com/github-api/github-api.git",
298298
"ssh_url": "git@github.com:github-api/github-api.git",
299299
"clone_url": "https://github.com/github-api/github-api.git",
300300
"svn_url": "https://github.com/github-api/github-api",
301301
"homepage": "http://github-api.kohsuke.org/",
302-
"size": 14742,
303-
"stargazers_count": 568,
304-
"watchers_count": 568,
302+
"size": 14820,
303+
"stargazers_count": 571,
304+
"watchers_count": 571,
305305
"language": "Java",
306306
"has_issues": true,
307307
"has_projects": true,
308308
"has_downloads": true,
309309
"has_wiki": true,
310310
"has_pages": true,
311-
"forks_count": 432,
311+
"forks_count": 434,
312312
"mirror_url": null,
313313
"archived": false,
314314
"disabled": false,
315-
"open_issues_count": 64,
315+
"open_issues_count": 66,
316316
"license": {
317317
"key": "mit",
318318
"name": "MIT License",
319319
"spdx_id": "MIT",
320320
"url": "https://api.github.com/licenses/mit",
321321
"node_id": "MDc6TGljZW5zZTEz"
322322
},
323-
"forks": 432,
324-
"open_issues": 64,
325-
"watchers": 568,
323+
"forks": 434,
324+
"open_issues": 66,
325+
"watchers": 571,
326326
"default_branch": "master"
327327
},
328-
"network_count": 432,
328+
"network_count": 434,
329329
"subscribers_count": 0
330330
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"releases_url": "https://api.github.com/repos/github-api-test-org/github-api/releases{/id}",
6767
"deployments_url": "https://api.github.com/repos/github-api-test-org/github-api/deployments",
6868
"created_at": "2019-09-06T23:26:04Z",
69-
"updated_at": "2019-09-30T22:36:47Z",
69+
"updated_at": "2019-10-30T01:54:39Z",
7070
"pushed_at": "2019-10-21T22:34:49Z",
7171
"git_url": "git://github.com/github-api-test-org/github-api.git",
7272
"ssh_url": "git@github.com:github-api-test-org/github-api.git",
@@ -86,7 +86,7 @@
8686
"mirror_url": null,
8787
"archived": false,
8888
"disabled": false,
89-
"open_issues_count": 1,
89+
"open_issues_count": 0,
9090
"license": {
9191
"key": "mit",
9292
"name": "MIT License",
@@ -95,7 +95,7 @@
9595
"node_id": "MDc6TGljZW5zZTEz"
9696
},
9797
"forks": 0,
98-
"open_issues": 1,
98+
"open_issues": 0,
9999
"watchers": 0,
100100
"default_branch": "master",
101101
"permissions": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"login": "bitwiseman",
3+
"id": 1958953,
4+
"node_id": "MDQ6VXNlcjE5NTg5NTM=",
5+
"avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4",
6+
"gravatar_id": "",
7+
"url": "https://api.github.com/users/bitwiseman",
8+
"html_url": "https://github.com/bitwiseman",
9+
"followers_url": "https://api.github.com/users/bitwiseman/followers",
10+
"following_url": "https://api.github.com/users/bitwiseman/following{/other_user}",
11+
"gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}",
12+
"starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}",
13+
"subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions",
14+
"organizations_url": "https://api.github.com/users/bitwiseman/orgs",
15+
"repos_url": "https://api.github.com/users/bitwiseman/repos",
16+
"events_url": "https://api.github.com/users/bitwiseman/events{/privacy}",
17+
"received_events_url": "https://api.github.com/users/bitwiseman/received_events",
18+
"type": "User",
19+
"site_admin": false,
20+
"name": "Liam Newman",
21+
"company": "Cloudbees, Inc.",
22+
"blog": "",
23+
"location": "Seattle, WA, USA",
24+
"email": "bitwiseman@gmail.com",
25+
"hireable": null,
26+
"bio": "https://twitter.com/bitwiseman",
27+
"public_repos": 170,
28+
"public_gists": 7,
29+
"followers": 139,
30+
"following": 9,
31+
"created_at": "2012-07-11T20:38:33Z",
32+
"updated_at": "2019-09-24T19:32:29Z",
33+
"private_gists": 7,
34+
"total_private_repos": 9,
35+
"owned_private_repos": 0,
36+
"disk_usage": 33697,
37+
"collaborators": 0,
38+
"two_factor_authentication": true,
39+
"plan": {
40+
"name": "free",
41+
"space": 976562499,
42+
"collaborators": 0,
43+
"private_repos": 10000
44+
}
45+
}

0 commit comments

Comments
 (0)