From b20c2babec12b80f2991f6dd007e79ffd73d5f51 Mon Sep 17 00:00:00 2001 From: Martin van Zijl Date: Mon, 17 Dec 2018 10:04:42 +1300 Subject: [PATCH 1/8] Added support for projects. Fixes issue #425 --- .../org/kohsuke/github/GHOrganization.java | 39 +++++ .../java/org/kohsuke/github/GHProject.java | 159 ++++++++++++++++++ .../java/org/kohsuke/github/GHRepository.java | 38 +++++ src/main/java/org/kohsuke/github/GitHub.java | 4 + .../java/org/kohsuke/github/Previews.java | 19 +++ 5 files changed, 259 insertions(+) create mode 100644 src/main/java/org/kohsuke/github/GHProject.java diff --git a/src/main/java/org/kohsuke/github/GHOrganization.java b/src/main/java/org/kohsuke/github/GHOrganization.java index e5ce68e26b..b3680b9cf5 100644 --- a/src/main/java/org/kohsuke/github/GHOrganization.java +++ b/src/main/java/org/kohsuke/github/GHOrganization.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; +import static org.kohsuke.github.Previews.INERTIA; /** * @author Kohsuke Kawaguchi @@ -193,6 +194,44 @@ public void conceal(GHUser u) throws IOException { root.retrieve().method("DELETE").to("/orgs/" + login + "/public_members/" + u.getLogin(), null); } + /** + * Returns the projects for this organization. + * @param status The status filter (all, open or closed). + */ + public PagedIterable listProjects(final GHProject.ProjectStateFilter status) throws IOException { + return new PagedIterable() { + public PagedIterator _iterator(int pageSize) { + return new PagedIterator(root.retrieve().withPreview(INERTIA) + .with("state", status) + .asIterator(String.format("/orgs/%s/projects", login), GHProject[].class, pageSize)) { + @Override + protected void wrapUp(GHProject[] page) { + for (GHProject c : page) + c.wrap(root); + } + }; + } + }; + } + + /** + * Returns all open projects for the organization. + */ + public PagedIterable listProjects() throws IOException { + return listProjects(GHProject.ProjectStateFilter.OPEN); + } + + /** + * Creates a project for the organization. + */ + public GHProject createProject(String name, String body) throws IOException { + return root.retrieve().method("POST") + .withPreview(INERTIA) + .with("name", name) + .with("body", body) + .to(String.format("/orgs/%s/projects", login), GHProject.class).wrap(root); + } + public enum Permission { ADMIN, PUSH, PULL } /** diff --git a/src/main/java/org/kohsuke/github/GHProject.java b/src/main/java/org/kohsuke/github/GHProject.java new file mode 100644 index 0000000000..17129b146e --- /dev/null +++ b/src/main/java/org/kohsuke/github/GHProject.java @@ -0,0 +1,159 @@ +/* + * The MIT License + * + * Copyright 2018 Martin van Zijl. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.kohsuke.github; + +import java.io.IOException; +import java.net.URL; +import static org.kohsuke.github.Previews.INERTIA; + +/** + * A GitHub project. + * @see https://developer.github.com/v3/projects/ + * @author Martin van Zijl + */ +public class GHProject extends GHObject { + private GitHub root; + private GHRepository owner; + + private String owner_url; + private String html_url; + private String columns_url; + private String node_id; + private String name; + private String body; + private int number; + private String state; + private GHUser creator; + + @Override + public URL getHtmlUrl() throws IOException { + return GitHub.parseURL(html_url); + } + + public GitHub getRoot() { + return root; + } + + public GHRepository getOwner() { + return owner; + } + + public String getOwner_url() { + return owner_url; + } + + public String getHtml_url() { + return html_url; + } + + public String getColumns_url() { + return columns_url; + } + + public String getNode_id() { + return node_id; + } + + public String getName() { + return name; + } + + public String getBody() { + return body; + } + + public int getNumber() { + return number; + } + + public String getState() { + return state; + } + + public GHUser getCreator() { + return creator; + } + + public GHProject wrap(GHRepository repo) { + this.owner = repo; + this.root = repo.root; + return this; + } + + public GHProject wrap(GitHub root) { + this.root = root; + return this; + } + + private void edit(String key, Object value) throws IOException { + new Requester(root).withPreview(INERTIA)._with(key, value).method("PATCH").to(getApiRoute()); + } + + protected String getApiRoute() { + return "/projects/" + id; + } + + public void setName(String name) throws IOException { + edit("name", name); + } + + public void setBody(String body) throws IOException { + edit("body", body); + } + + public enum ProjectState { + OPEN, + CLOSED + } + + public void setState(ProjectState state) throws IOException { + edit("state", state.toString().toLowerCase()); + } + + public static enum ProjectStateFilter { + ALL, + OPEN, + CLOSED + } + + /** + * Set the permission level that all members of the project's organization will have on this project. + * Only applicable for organization-owned projects. + */ + public void setOrganizationPermission(GHPermissionType permission) throws IOException { + edit("organization_permission", permission.toString().toLowerCase()); + } + + /** + * Sets visibility of the project within the organization. + * Only applicable for organization-owned projects. + */ + public void setPublic(boolean isPublic) throws IOException { + edit("public", isPublic); + } + + public void delete() throws IOException { + new Requester(root).withPreview(INERTIA).method("DELETE").to(getApiRoute()); + } +} \ No newline at end of file diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index b42f9e5fb3..39f14ab5c2 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -1646,6 +1646,44 @@ public boolean equals(Object obj) { } } + /** + * Create a project for this repository. + */ + public GHProject createProject(String name, String body) throws IOException { + return root.retrieve().method("POST") + .withPreview(INERTIA) + .with("name", name) + .with("body", body) + .to(getApiTailUrl("projects"), GHProject.class).wrap(this); + } + + /** + * Returns the projects for this repository. + * @param status The status filter (all, open or closed). + */ + public PagedIterable listProjects(final GHProject.ProjectStateFilter status) throws IOException { + return new PagedIterable() { + public PagedIterator _iterator(int pageSize) { + return new PagedIterator(root.retrieve().withPreview(INERTIA) + .with("state", status) + .asIterator(getApiTailUrl("projects"), GHProject[].class, pageSize)) { + @Override + protected void wrapUp(GHProject[] page) { + for (GHProject c : page) + c.wrap(GHRepository.this); + } + }; + } + }; + } + + /** + * Returns open projects for this repository. + */ + public PagedIterable listProjects() throws IOException { + return listProjects(GHProject.ProjectStateFilter.OPEN); + } + /** * Render a Markdown document. * diff --git a/src/main/java/org/kohsuke/github/GitHub.java b/src/main/java/org/kohsuke/github/GitHub.java index 23973f3546..6f6a9944fb 100644 --- a/src/main/java/org/kohsuke/github/GitHub.java +++ b/src/main/java/org/kohsuke/github/GitHub.java @@ -745,6 +745,10 @@ public boolean isCredentialValid() { return user; } + public GHProject getProject(long id) throws IOException { + return retrieve().withPreview(INERTIA).to("/projects/"+id,GHProject.class).wrap(this); + } + private static class GHApiInfo { private String rate_limit_url; diff --git a/src/main/java/org/kohsuke/github/Previews.java b/src/main/java/org/kohsuke/github/Previews.java index d99743f8e7..eef2149acb 100644 --- a/src/main/java/org/kohsuke/github/Previews.java +++ b/src/main/java/org/kohsuke/github/Previews.java @@ -36,6 +36,25 @@ * @see GitHub API Previews */ static final String ZZZAX = "application/vnd.github.zzzax-preview+json"; + + /** + * Manage projects + * + * @see GitHub API Previews + */ + static final String INERTIA = "application/vnd.github.inertia-preview+json"; + + /** + * Manage integrations through the API + * + * @see GitHub API Previews + */ static final String MACHINE_MAN = "application/vnd.github.machine-man-preview+json"; + + /** + * Owners of GitHub Apps can now uninstall an app using the Apps API + * + * @see GitHub API Previews + */ static final String GAMBIT = "application/vnd.github.gambit-preview+json"; } From fc0871111124dbd2fcf11dc783e0f7f0d07f57c1 Mon Sep 17 00:00:00 2001 From: Gunnar Skjold Date: Wed, 31 Jul 2019 11:51:25 +0200 Subject: [PATCH 2/8] Expanded GHProject with columns and cards. Also added tests for projects, columns and cards --- .../java/org/kohsuke/github/GHProject.java | 62 ++++++--- .../org/kohsuke/github/GHProjectCard.java | 123 ++++++++++++++++++ .../org/kohsuke/github/GHProjectColumn.java | 104 +++++++++++++++ src/main/java/org/kohsuke/github/GitHub.java | 36 +++-- .../org/kohsuke/github/GHProjectCardTest.java | 99 ++++++++++++++ .../kohsuke/github/GHProjectColumnTest.java | 67 ++++++++++ .../org/kohsuke/github/GHProjectTest.java | 80 ++++++++++++ 7 files changed, 536 insertions(+), 35 deletions(-) create mode 100644 src/main/java/org/kohsuke/github/GHProjectCard.java create mode 100644 src/main/java/org/kohsuke/github/GHProjectColumn.java create mode 100644 src/test/java/org/kohsuke/github/GHProjectCardTest.java create mode 100644 src/test/java/org/kohsuke/github/GHProjectColumnTest.java create mode 100644 src/test/java/org/kohsuke/github/GHProjectTest.java diff --git a/src/main/java/org/kohsuke/github/GHProject.java b/src/main/java/org/kohsuke/github/GHProject.java index 17129b146e..457cc17713 100644 --- a/src/main/java/org/kohsuke/github/GHProject.java +++ b/src/main/java/org/kohsuke/github/GHProject.java @@ -23,8 +23,11 @@ */ package org.kohsuke.github; +import java.io.FileNotFoundException; import java.io.IOException; import java.net.URL; +import java.util.Locale; + import static org.kohsuke.github.Previews.INERTIA; /** @@ -33,12 +36,11 @@ * @author Martin van Zijl */ public class GHProject extends GHObject { - private GitHub root; - private GHRepository owner; + protected GitHub root; + protected GHObject owner; private String owner_url; private String html_url; - private String columns_url; private String node_id; private String name; private String body; @@ -55,20 +57,25 @@ public GitHub getRoot() { return root; } - public GHRepository getOwner() { + public GHObject getOwner() throws IOException { + if(owner == null) { + try { + if(owner_url.contains("/orgs/")) { + owner = root.retrieve().to(getOwnerUrl().getPath(), GHOrganization.class).wrapUp(root); + } else if(owner_url.contains("/users/")) { + owner = root.retrieve().to(getOwnerUrl().getPath(), GHUser.class).wrapUp(root); + } else if(owner_url.contains("/repos/")) { + owner = root.retrieve().to(getOwnerUrl().getPath(), GHRepository.class).wrap(root); + } + } catch (FileNotFoundException e) { + return null; + } + } return owner; } - public String getOwner_url() { - return owner_url; - } - - public String getHtml_url() { - return html_url; - } - - public String getColumns_url() { - return columns_url; + public URL getOwnerUrl() { + return GitHub.parseURL(owner_url); } public String getNode_id() { @@ -87,8 +94,8 @@ public int getNumber() { return number; } - public String getState() { - return state; + public ProjectState getState() { + return Enum.valueOf(ProjectState.class, state.toUpperCase(Locale.ENGLISH)); } public GHUser getCreator() { @@ -156,4 +163,27 @@ public void setPublic(boolean isPublic) throws IOException { public void delete() throws IOException { new Requester(root).withPreview(INERTIA).method("DELETE").to(getApiRoute()); } + + public PagedIterable listColumns() throws IOException { + final GHProject project = this; + return new PagedIterable() { + public PagedIterator _iterator(int pageSize) { + return new PagedIterator(root.retrieve().withPreview(INERTIA) + .asIterator(String.format("/projects/%d/columns", id), GHProjectColumn[].class, pageSize)) { + @Override + protected void wrapUp(GHProjectColumn[] page) { + for (GHProjectColumn c : page) + c.wrap(project); + } + }; + } + }; + } + + public GHProjectColumn createColumn(String name) throws IOException { + return root.retrieve().method("POST") + .withPreview(INERTIA) + .with("name", name) + .to(String.format("/projects/%d/columns", id), GHProjectColumn.class).wrap(this); + } } \ No newline at end of file diff --git a/src/main/java/org/kohsuke/github/GHProjectCard.java b/src/main/java/org/kohsuke/github/GHProjectCard.java new file mode 100644 index 0000000000..d6fb97cd87 --- /dev/null +++ b/src/main/java/org/kohsuke/github/GHProjectCard.java @@ -0,0 +1,123 @@ +package org.kohsuke.github; + +import org.apache.commons.lang3.StringUtils; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.net.URL; + +import static org.kohsuke.github.Previews.INERTIA; + +/** + * @author Gunnar Skjold + */ +public class GHProjectCard extends GHObject { + private GitHub root; + private GHProject project; + private GHProjectColumn column; + + private String note; + private GHUser creator; + private String content_url, project_url, column_url; + private boolean archived; + + public URL getHtmlUrl() throws IOException { + return null; + } + + public GHProjectCard wrap(GitHub root) { + this.root = root; + return this; + } + + public GHProjectCard wrap(GHProjectColumn column) { + this.column = column; + this.project = column.project; + this.root = column.root; + return this; + } + + public GitHub getRoot() { + return root; + } + + public GHProject getProject() throws IOException { + if(project == null) { + try { + project = root.retrieve().to(getProjectUrl().getPath(), GHProject.class).wrap(root); + } catch (FileNotFoundException e) { + return null; + } + } + return project; + } + + public GHProjectColumn getColumn() throws IOException { + if(column == null) { + try { + column = root.retrieve().to(getColumnUrl().getPath(), GHProjectColumn.class).wrap(root); + } catch (FileNotFoundException e) { + return null; + } + } + return column; + } + + public GHIssue getContent() throws IOException { + if(StringUtils.isEmpty(content_url)) + return null; + try { + if(content_url.contains("/pulls")) { + return root.retrieve().to(getContentUrl().getPath(), GHPullRequest.class).wrap(root); + } else { + return root.retrieve().to(getContentUrl().getPath(), GHIssue.class).wrap(root); + } + } catch (FileNotFoundException e) { + return null; + } + } + + public String getNote() { + return note; + } + + public GHUser getCreator() { + return creator; + } + + public URL getContentUrl() { + return GitHub.parseURL(content_url); + } + + public URL getProjectUrl() { + return GitHub.parseURL(project_url); + } + + public URL getColumnUrl() { + return GitHub.parseURL(column_url); + } + + public boolean isArchived() { + return archived; + } + + public void setNote(String note) throws IOException { + edit("note", note); + } + + public void setArchived(boolean archived) throws IOException { + edit("archived", archived); + } + + private void edit(String key, Object value) throws IOException { + new Requester(root).withPreview(INERTIA)._with(key, value).method("PATCH").to(getApiRoute()); + } + + protected String getApiRoute() { + return String.format("/projects/columns/cards/%d", id); + } + + public void delete() throws IOException { + new Requester(root).withPreview(INERTIA).method("DELETE").to(getApiRoute()); + } +} diff --git a/src/main/java/org/kohsuke/github/GHProjectColumn.java b/src/main/java/org/kohsuke/github/GHProjectColumn.java new file mode 100644 index 0000000000..01aeab530c --- /dev/null +++ b/src/main/java/org/kohsuke/github/GHProjectColumn.java @@ -0,0 +1,104 @@ +package org.kohsuke.github; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.net.URL; + +import static org.kohsuke.github.Previews.INERTIA; + +/** + * @author Gunnar Skjold + */ +public class GHProjectColumn extends GHObject { + protected GitHub root; + protected GHProject project; + + private String name; + private String project_url; + + @Override + public URL getHtmlUrl() throws IOException { + return null; + } + + public GHProjectColumn wrap(GitHub root) { + this.root = root; + return this; + } + + public GHProjectColumn wrap(GHProject project) { + this.project = project; + this.root = project.root; + return this; + } + + public GitHub getRoot() { + return root; + } + + public GHProject getProject() throws IOException { + if(project == null) { + try { + project = root.retrieve().to(getProjectUrl().getPath(), GHProject.class).wrap(root); + } catch (FileNotFoundException e) { + return null; + } + } + return project; + } + + public String getName() { + return name; + } + + public URL getProjectUrl() { + return GitHub.parseURL(project_url); + } + + public void setName(String name) throws IOException { + edit("name", name); + } + + private void edit(String key, Object value) throws IOException { + new Requester(root).withPreview(INERTIA)._with(key, value).method("PATCH").to(getApiRoute()); + } + + protected String getApiRoute() { + return String.format("/projects/columns/%d", id); + } + + public void delete() throws IOException { + new Requester(root).withPreview(INERTIA).method("DELETE").to(getApiRoute()); + } + + public PagedIterable listCards() throws IOException { + final GHProjectColumn column = this; + return new PagedIterable() { + public PagedIterator _iterator(int pageSize) { + return new PagedIterator(root.retrieve().withPreview(INERTIA) + .asIterator(String.format("/projects/columns/%d/cards", id), GHProjectCard[].class, pageSize)) { + @Override + protected void wrapUp(GHProjectCard[] page) { + for (GHProjectCard c : page) + c.wrap(column); + } + }; + } + }; + } + + public GHProjectCard createCard(String note) throws IOException { + return root.retrieve().method("POST") + .withPreview(INERTIA) + .with("note", note) + .to(String.format("/projects/columns/%d/cards", id), GHProjectCard.class).wrap(this); + } + + public GHProjectCard createCard(GHIssue issue) throws IOException { + return root.retrieve().method("POST") + .withPreview(INERTIA) + .with("content_type", issue instanceof GHPullRequest ? "PullRequest" : "Issue") + .with("content_id", issue.getId()) + .to(String.format("/projects/columns/%d/cards", id), GHProjectCard.class).wrap(this); + } +} diff --git a/src/main/java/org/kohsuke/github/GitHub.java b/src/main/java/org/kohsuke/github/GitHub.java index 6f6a9944fb..8bd42ce84a 100644 --- a/src/main/java/org/kohsuke/github/GitHub.java +++ b/src/main/java/org/kohsuke/github/GitHub.java @@ -34,33 +34,23 @@ import javax.annotation.CheckForNull; import javax.annotation.Nonnull; -import java.io.ByteArrayInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.Reader; +import java.io.*; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.Arrays; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TimeZone; +import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.logging.Logger; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.*; -import static java.net.HttpURLConnection.*; -import static java.util.logging.Level.*; -import static org.kohsuke.github.Previews.*; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.ANY; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static java.net.HttpURLConnection.HTTP_UNAUTHORIZED; +import static java.util.logging.Level.FINE; +import static org.kohsuke.github.Previews.DRAX; +import static org.kohsuke.github.Previews.INERTIA; /** * Root of the GitHub API. @@ -746,7 +736,15 @@ public boolean isCredentialValid() { } public GHProject getProject(long id) throws IOException { - return retrieve().withPreview(INERTIA).to("/projects/"+id,GHProject.class).wrap(this); + return retrieve().withPreview(INERTIA).to("/projects/"+id, GHProject.class).wrap(this); + } + + public GHProjectColumn getProjectColumn(long id) throws IOException { + return retrieve().withPreview(INERTIA).to("/projects/columns/"+id, GHProjectColumn.class).wrap(this); + } + + public GHProjectCard getProjectCard(long id) throws IOException { + return retrieve().withPreview(INERTIA).to("/projects/columns/cards/"+id, GHProjectCard.class).wrap(this); } private static class GHApiInfo { diff --git a/src/test/java/org/kohsuke/github/GHProjectCardTest.java b/src/test/java/org/kohsuke/github/GHProjectCardTest.java new file mode 100644 index 0000000000..8131f763bb --- /dev/null +++ b/src/test/java/org/kohsuke/github/GHProjectCardTest.java @@ -0,0 +1,99 @@ +package org.kohsuke.github; + +import org.junit.After; +import org.junit.Assert; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.io.IOException; + +/** + * @author Gunnar Skjold + */ +public class GHProjectCardTest extends AbstractGitHubApiTestBase { + private GHOrganization org; + private GHProject project; + private GHProjectColumn column; + private GHProjectCard card; + + @Override public void setUp() throws Exception { + super.setUp(); + org = gitHub.getOrganization("github-api-test-org"); + project = org.createProject("test-project", "This is a test project"); + column = project.createColumn("column-one"); + card = column.createCard("This is a card"); + } + + @Test + public void testCreatedCard() { + Assert.assertEquals("This is a card", card.getNote()); + Assert.assertFalse(card.isArchived()); + } + + @Test + public void testEditCardNote() throws IOException { + card.setNote("New note"); + card = gitHub.getProjectCard(card.getId()); + Assert.assertEquals("New note", card.getNote()); + Assert.assertFalse(card.isArchived()); + } + + @Test + public void testArchiveCard() throws IOException { + card.setArchived(true); + card = gitHub.getProjectCard(card.getId()); + Assert.assertEquals("This is a card", card.getNote()); + Assert.assertTrue(card.isArchived()); + } + + @Test + public void testCreateCardFromIssue() throws IOException { + GHRepository repo = org.createRepository("repo-for-project-card").create(); + try { + GHIssue issue = repo.createIssue("new-issue").body("With body").create(); + GHProjectCard card = column.createCard(issue); + Assert.assertEquals(issue.getUrl(), card.getContentUrl()); + } finally { + repo.delete(); + } + } + + @Test + public void testDeleteCard() throws IOException { + card.delete(); + try { + card = gitHub.getProjectCard(card.getId()); + Assert.assertNull(card); + } catch (FileNotFoundException e) { + card = null; + } + } + + @After + public void after() throws IOException { + if(card != null) { + try { + card.delete(); + card = null; + } catch (FileNotFoundException e) { + card = null; + } + } + if(column != null) { + try { + column.delete(); + column = null; + } catch (FileNotFoundException e) { + column = null; + } + } + if(project != null) { + try { + project.delete(); + project = null; + } catch (FileNotFoundException e) { + project = null; + } + } + } +} diff --git a/src/test/java/org/kohsuke/github/GHProjectColumnTest.java b/src/test/java/org/kohsuke/github/GHProjectColumnTest.java new file mode 100644 index 0000000000..27e8460b23 --- /dev/null +++ b/src/test/java/org/kohsuke/github/GHProjectColumnTest.java @@ -0,0 +1,67 @@ +package org.kohsuke.github; + +import org.junit.After; +import org.junit.Assert; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.io.IOException; + +/** + * @author Gunnar Skjold + */ +public class GHProjectColumnTest extends AbstractGitHubApiTestBase { + private GHProject project; + private GHProjectColumn column; + + @Override public void setUp() throws Exception { + super.setUp(); + project = gitHub + .getOrganization("github-api-test-org") + .createProject("test-project", "This is a test project"); + column = project.createColumn("column-one"); + } + + @Test + public void testCreatedColumn() { + Assert.assertEquals("column-one", column.getName()); + } + + @Test + public void testEditColumnName() throws IOException { + column.setName("new-name"); + column = gitHub.getProjectColumn(column.getId()); + Assert.assertEquals("new-name", column.getName()); + } + + @Test + public void testDeleteColumn() throws IOException { + column.delete(); + try { + column = gitHub.getProjectColumn(column.getId()); + Assert.assertNull(column); + } catch (FileNotFoundException e) { + column = null; + } + } + + @After + public void after() throws IOException { + if(column != null) { + try { + column.delete(); + column = null; + } catch (FileNotFoundException e) { + column = null; + } + } + if(project != null) { + try { + project.delete(); + project = null; + } catch (FileNotFoundException e) { + project = null; + } + } + } +} diff --git a/src/test/java/org/kohsuke/github/GHProjectTest.java b/src/test/java/org/kohsuke/github/GHProjectTest.java new file mode 100644 index 0000000000..b5e1aef122 --- /dev/null +++ b/src/test/java/org/kohsuke/github/GHProjectTest.java @@ -0,0 +1,80 @@ +package org.kohsuke.github; + +import org.junit.After; +import org.junit.Assert; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.io.IOException; + +/** + * @author Gunnar Skjold + */ +public class GHProjectTest extends AbstractGitHubApiTestBase { + private GHProject project; + + @Override public void setUp() throws Exception { + super.setUp(); + project = gitHub + .getOrganization("github-api-test-org") + .createProject("test-project", "This is a test project"); + } + + @Test + public void testCreatedProject() { + Assert.assertNotNull(project); + Assert.assertEquals("test-project", project.getName()); + Assert.assertEquals("This is a test project", project.getBody()); + Assert.assertEquals(GHProject.ProjectState.OPEN, project.getState()); + } + + @Test + public void testEditProjectName() throws IOException { + project.setName("new-name"); + project = gitHub.getProject(project.getId()); + Assert.assertEquals("new-name", project.getName()); + Assert.assertEquals("This is a test project", project.getBody()); + Assert.assertEquals(GHProject.ProjectState.OPEN, project.getState()); + } + + @Test + public void testEditProjectBody() throws IOException { + project.setBody("New body"); + project = gitHub.getProject(project.getId()); + Assert.assertEquals("test-project", project.getName()); + Assert.assertEquals("New body", project.getBody()); + Assert.assertEquals(GHProject.ProjectState.OPEN, project.getState()); + } + + @Test + public void testEditProjectState() throws IOException { + project.setState(GHProject.ProjectState.CLOSED); + project = gitHub.getProject(project.getId()); + Assert.assertEquals("test-project", project.getName()); + Assert.assertEquals("This is a test project", project.getBody()); + Assert.assertEquals(GHProject.ProjectState.CLOSED, project.getState()); + } + + @Test + public void testDeleteProject() throws IOException { + project.delete(); + try { + project = gitHub.getProject(project.getId()); + Assert.assertNull(project); + } catch (FileNotFoundException e) { + project = null; + } + } + + @After + public void after() throws IOException { + if(project != null) { + try { + project.delete(); + project = null; + } catch (FileNotFoundException e) { + project = null; + } + } + } +} From 5cc88a00752b1ca8a57531085fa449d666562190 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Fri, 4 Oct 2019 10:08:49 -0700 Subject: [PATCH 3/8] WireMock Project Tests --- src/main/java/org/kohsuke/github/GitHub.java | 2 +- .../org/kohsuke/github/GHProjectCardTest.java | 56 ++++---- .../kohsuke/github/GHProjectColumnTest.java | 41 +++--- .../org/kohsuke/github/GHProjectTest.java | 27 ++-- ...-8a33ed8f-a98f-47af-a4e7-a30928da2e70.json | 41 ++++++ ...-b659e68a-af69-4413-a2fa-602524428990.json | 36 +++++ ...-3be146c4-9f97-4b2d-9951-16dd86ec334f.json | 10 ++ ...-45bdd9f0-5efe-43c3-b01f-130894549d0d.json | 31 +++++ ...-75b0d2d0-bf80-4ffe-bb43-a39a48abf2ac.json | 31 +++++ ...-97fd6c7d-30b2-4036-9d02-b3be29a2c045.json | 31 +++++ ...-0c7200e4-cdc5-45a5-997a-d7b8568751cf.json | 45 +++++++ .../orgs_github-api-test-org-2-8a33ed.json | 43 ++++++ ...github-api-test-org_projects-3-b659e6.json | 50 +++++++ .../projects_3312444_columns-4-3be146.json | 50 +++++++ ...ojects_columns_6706801_cards-5-45bdd9.json | 50 +++++++ ...jects_columns_cards_27353270-6-97fd6c.json | 49 +++++++ ...jects_columns_cards_27353270-7-75b0d2.json | 42 ++++++ .../mappings/user-1-0c7200.json | 43 ++++++ ...-2cd47524-8e16-4b6b-aedd-d8dbfbfe5aa9.json | 41 ++++++ ...-bac54b7b-af26-4015-85d1-97d981800e06.json | 36 +++++ ...-c2d81922-c3f6-41b3-b109-de8cfe1452a6.json | 124 ++++++++++++++++++ ...-5b504083-4657-4d27-aaff-54f97a361d7a.json | 10 ++ ...-6458c399-0897-43a0-a869-f43a56e32cae.json | 32 +++++ ...-e6d34d34-6779-4c36-83e1-b783989750c3.json | 31 +++++ ...-29d82e53-34b8-4443-bddd-fdd14726484d.json | 45 +++++++ ...-b9c4ba1f-224e-4e78-85ca-b1ac911fdd4e.json | 45 +++++++ .../orgs_github-api-test-org-2-2cd475.json | 43 ++++++ ...github-api-test-org_projects-3-bac54b.json | 50 +++++++ ...gs_github-api-test-org_repos-6-c2d819.json | 50 +++++++ .../projects_3312449_columns-4-5b5040.json | 50 +++++++ ...ojects_columns_6706803_cards-5-e6d34d.json | 50 +++++++ ...ojects_columns_6706803_cards-8-6458c3.json | 50 +++++++ ...st-org_repo-for-project-card-9-372cc0.json | 35 +++++ ...repo-for-project-card_issues-7-29d82e.json | 50 +++++++ .../mappings/user-1-b9c4ba.json | 43 ++++++ ...-a73c2760-fcb1-4ad6-a379-508ae8bd6a92.json | 41 ++++++ ...-fd95c811-2dc4-458b-a18f-72b93e2cfac7.json | 36 +++++ ...-264f75eb-2b63-4727-9470-21079137ecf4.json | 10 ++ ...-0a15ceb0-700f-41b0-8a07-ac04dcdcd13f.json | 31 +++++ ...-80e34816-e0ac-422b-807b-bc8c1f2bd313.json | 45 +++++++ .../orgs_github-api-test-org-2-a73c27.json | 43 ++++++ ...github-api-test-org_projects-3-fd95c8.json | 50 +++++++ .../projects_3312442_columns-4-264f75.json | 50 +++++++ ...ojects_columns_6706799_cards-5-0a15ce.json | 50 +++++++ .../mappings/user-1-80e348.json | 43 ++++++ ...-467a3990-86b4-4c0f-9d2a-e51630e548f6.json | 41 ++++++ ...-491fbbf4-d8d0-433d-9ec6-162fa95ad792.json | 36 +++++ ...-f80b3261-cf13-4bcf-82b7-19a1425cbe78.json | 10 ++ ...-aad1d69e-1823-41cc-9cb0-fac06faa77c3.json | 31 +++++ ...-c2f32bbc-aa66-407b-a3e3-4533d04dd4b0.json | 45 +++++++ .../orgs_github-api-test-org-2-467a39.json | 43 ++++++ ...github-api-test-org_projects-3-491fbb.json | 50 +++++++ .../projects_3312447_columns-4-f80b32.json | 50 +++++++ ...ojects_columns_6706802_cards-5-aad1d6.json | 50 +++++++ ...jects_columns_cards_27353272-6-e93cbd.json | 35 +++++ ...jects_columns_cards_27353272-7-a7094f.json | 36 +++++ .../mappings/user-1-c2f32b.json | 43 ++++++ ...-049038eb-8cc8-4480-b0e9-62a6bb55f112.json | 41 ++++++ ...-68e871e2-343e-47b7-aa45-b613ef9f8bc0.json | 36 +++++ ...-1de47f2e-9018-4a4f-9dad-0ee29614aa4e.json | 10 ++ ...-695ce51a-3df9-4aea-b10d-471d3ff856b8.json | 31 +++++ ...-62a0d7cf-0c8a-4f96-8c00-c48aeaab4a6f.json | 31 +++++ ...-93c5d233-0602-432f-a6a1-784506a19fe0.json | 31 +++++ ...-355d682a-6ab6-4af5-be72-d00bf6403051.json | 45 +++++++ .../orgs_github-api-test-org-2-049038.json | 43 ++++++ ...github-api-test-org_projects-3-68e871.json | 50 +++++++ .../projects_3312443_columns-4-1de47f.json | 50 +++++++ ...ojects_columns_6706800_cards-5-695ce5.json | 50 +++++++ ...jects_columns_cards_27353267-6-62a0d7.json | 49 +++++++ ...jects_columns_cards_27353267-7-93c5d2.json | 42 ++++++ .../mappings/user-1-355d68.json | 43 ++++++ ...-7feb4202-bd04-498e-a28c-fd9df44d8fc8.json | 41 ++++++ ...-42bd7d98-f969-40ce-bb9a-1586c556569d.json | 36 +++++ ...-eb58635e-11b9-461d-8868-6ece3733f962.json | 10 ++ ...-ff30f972-21ad-40ee-aa60-c006643154d2.json | 45 +++++++ .../orgs_github-api-test-org-2-7feb42.json | 43 ++++++ ...github-api-test-org_projects-3-42bd7d.json | 50 +++++++ .../projects_3312440_columns-4-eb5863.json | 50 +++++++ .../mappings/user-1-ff30f9.json | 43 ++++++ ...-f4a0595a-a719-4b21-bf67-f12d67bac972.json | 41 ++++++ ...-bfb7de93-74a1-48dc-a74a-ba06cee9e764.json | 36 +++++ ...-fb6e53a0-db62-4037-8f0b-3511e79bea93.json | 10 ++ ...-f818b667-7eed-4efb-9719-ea27f8d05b59.json | 45 +++++++ .../orgs_github-api-test-org-2-f4a059.json | 43 ++++++ ...github-api-test-org_projects-3-bfb7de.json | 50 +++++++ .../projects_3312441_columns-4-fb6e53.json | 50 +++++++ .../projects_columns_6706794-5-8c0cae.json | 35 +++++ .../projects_columns_6706794-6-112e1e.json | 36 +++++ .../mappings/user-1-f818b6.json | 43 ++++++ ...-eb0425ef-7f2e-4b3a-a7f7-53cef5d5647b.json | 41 ++++++ ...-97b70b32-45f4-419f-87d0-f15a2c004196.json | 36 +++++ ...-082ed3d1-bea6-48fc-8e61-a63c4d0db977.json | 10 ++ ...-1cfa5ddf-74f4-4a95-aaf2-c8149c7d1c17.json | 10 ++ ...-85f35660-6579-4bea-af53-b636239dd5cd.json | 10 ++ ...-e21e45b0-f34c-473e-9454-cb601fb759b9.json | 45 +++++++ .../orgs_github-api-test-org-2-eb0425.json | 43 ++++++ ...github-api-test-org_projects-3-97b70b.json | 50 +++++++ .../projects_3312439_columns-4-082ed3.json | 50 +++++++ .../projects_columns_6706791-5-85f356.json | 49 +++++++ .../projects_columns_6706791-6-1cfa5d.json | 42 ++++++ .../mappings/user-1-e21e45.json | 43 ++++++ ...-713f01eb-4f07-4f02-89fe-e7560ed08e11.json | 41 ++++++ ...-e5afd90e-d2ac-4e83-800d-a680bc27c9ed.json | 36 +++++ ...-a9a3d26a-4c87-4ebf-9609-48b2120173b7.json | 45 +++++++ .../orgs_github-api-test-org-2-713f01.json | 43 ++++++ ...github-api-test-org_projects-3-e5afd9.json | 50 +++++++ .../mappings/user-1-a9a3d2.json | 43 ++++++ ...-c3024047-fc8f-443f-a2b4-810324f889b4.json | 41 ++++++ ...-daa6c228-6e0f-4398-a6d2-2d114f986e93.json | 36 +++++ ...-9cb86722-7ae5-46b2-8598-59567e17ed99.json | 45 +++++++ .../orgs_github-api-test-org-2-c30240.json | 43 ++++++ ...github-api-test-org_projects-3-daa6c2.json | 50 +++++++ .../mappings/projects_3312437-4-f50762.json | 35 +++++ .../mappings/projects_3312437-5-8b8e6f.json | 36 +++++ .../mappings/user-1-9cb867.json | 43 ++++++ ...-2e39c772-c889-44d1-bf15-5248ad194202.json | 41 ++++++ ...-08231b0e-288f-49fa-aa2b-9456449d2cfd.json | 36 +++++ ...-004d3495-63b2-40e7-a864-10d175a59756.json | 36 +++++ ...-76e0c251-b1df-4f18-8a01-77a7bbc15474.json | 36 +++++ ...-b2b1262a-1678-4080-af72-92346bb25688.json | 45 +++++++ .../orgs_github-api-test-org-2-2e39c7.json | 43 ++++++ ...github-api-test-org_projects-3-08231b.json | 50 +++++++ .../mappings/projects_3312435-4-004d34.json | 49 +++++++ .../mappings/projects_3312435-5-76e0c2.json | 42 ++++++ .../mappings/user-1-b2b126.json | 43 ++++++ ...-e3d87fca-b817-4dfb-b80f-99eebaabba08.json | 41 ++++++ ...-6a0a4669-8d74-4fa9-92c0-0fa428078637.json | 36 +++++ ...-20ac7f07-9e2b-47dd-801c-67974592a3b9.json | 36 +++++ ...-6c28d544-7193-4c9d-93a8-5c4bd20af717.json | 36 +++++ ...-115e6194-ffb3-4129-8f7b-ad60f5fff91a.json | 45 +++++++ .../orgs_github-api-test-org-2-e3d87f.json | 43 ++++++ ...github-api-test-org_projects-3-6a0a46.json | 50 +++++++ .../mappings/projects_3312436-4-20ac7f.json | 49 +++++++ .../mappings/projects_3312436-5-6c28d5.json | 42 ++++++ .../mappings/user-1-115e61.json | 43 ++++++ ...-a522b55e-f089-4a29-a55e-33f0744eca1a.json | 41 ++++++ ...-ee429eb6-b010-4916-91af-3ce0976426dd.json | 36 +++++ ...-55b16b4e-924d-4cf7-9113-fbc644011a44.json | 36 +++++ ...-715884a8-0610-43b5-9379-01ac91168ec0.json | 36 +++++ ...-f7605e5c-c728-4af9-baca-a6e1266d1b4a.json | 45 +++++++ .../orgs_github-api-test-org-2-a522b5.json | 43 ++++++ ...github-api-test-org_projects-3-ee429e.json | 50 +++++++ .../mappings/projects_3312433-4-55b16b.json | 49 +++++++ .../mappings/projects_3312433-5-715884.json | 42 ++++++ .../mappings/user-1-f7605e.json | 43 ++++++ 145 files changed, 5817 insertions(+), 53 deletions(-) create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/orgs_github-api-test-org-8a33ed8f-a98f-47af-a4e7-a30928da2e70.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/orgs_github-api-test-org_projects-b659e68a-af69-4413-a2fa-602524428990.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/projects_3312444_columns-3be146c4-9f97-4b2d-9951-16dd86ec334f.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/projects_columns_6706801_cards-45bdd9f0-5efe-43c3-b01f-130894549d0d.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/projects_columns_cards_27353270-75b0d2d0-bf80-4ffe-bb43-a39a48abf2ac.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/projects_columns_cards_27353270-97fd6c7d-30b2-4036-9d02-b3be29a2c045.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/user-0c7200e4-cdc5-45a5-997a-d7b8568751cf.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/orgs_github-api-test-org-2-8a33ed.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/orgs_github-api-test-org_projects-3-b659e6.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/projects_3312444_columns-4-3be146.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/projects_columns_6706801_cards-5-45bdd9.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/projects_columns_cards_27353270-6-97fd6c.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/projects_columns_cards_27353270-7-75b0d2.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/user-1-0c7200.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/orgs_github-api-test-org-2cd47524-8e16-4b6b-aedd-d8dbfbfe5aa9.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/orgs_github-api-test-org_projects-bac54b7b-af26-4015-85d1-97d981800e06.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/orgs_github-api-test-org_repos-c2d81922-c3f6-41b3-b109-de8cfe1452a6.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/projects_3312449_columns-5b504083-4657-4d27-aaff-54f97a361d7a.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/projects_columns_6706803_cards-6458c399-0897-43a0-a869-f43a56e32cae.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/projects_columns_6706803_cards-e6d34d34-6779-4c36-83e1-b783989750c3.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/repos_github-api-test-org_repo-for-project-card_issues-29d82e53-34b8-4443-bddd-fdd14726484d.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/user-b9c4ba1f-224e-4e78-85ca-b1ac911fdd4e.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/orgs_github-api-test-org-2-2cd475.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/orgs_github-api-test-org_projects-3-bac54b.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/orgs_github-api-test-org_repos-6-c2d819.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/projects_3312449_columns-4-5b5040.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/projects_columns_6706803_cards-5-e6d34d.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/projects_columns_6706803_cards-8-6458c3.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/repos_github-api-test-org_repo-for-project-card-9-372cc0.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/repos_github-api-test-org_repo-for-project-card_issues-7-29d82e.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/user-1-b9c4ba.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/__files/orgs_github-api-test-org-a73c2760-fcb1-4ad6-a379-508ae8bd6a92.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/__files/orgs_github-api-test-org_projects-fd95c811-2dc4-458b-a18f-72b93e2cfac7.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/__files/projects_3312442_columns-264f75eb-2b63-4727-9470-21079137ecf4.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/__files/projects_columns_6706799_cards-0a15ceb0-700f-41b0-8a07-ac04dcdcd13f.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/__files/user-80e34816-e0ac-422b-807b-bc8c1f2bd313.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/mappings/orgs_github-api-test-org-2-a73c27.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/mappings/orgs_github-api-test-org_projects-3-fd95c8.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/mappings/projects_3312442_columns-4-264f75.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/mappings/projects_columns_6706799_cards-5-0a15ce.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/mappings/user-1-80e348.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/__files/orgs_github-api-test-org-467a3990-86b4-4c0f-9d2a-e51630e548f6.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/__files/orgs_github-api-test-org_projects-491fbbf4-d8d0-433d-9ec6-162fa95ad792.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/__files/projects_3312447_columns-f80b3261-cf13-4bcf-82b7-19a1425cbe78.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/__files/projects_columns_6706802_cards-aad1d69e-1823-41cc-9cb0-fac06faa77c3.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/__files/user-c2f32bbc-aa66-407b-a3e3-4533d04dd4b0.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/orgs_github-api-test-org-2-467a39.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/orgs_github-api-test-org_projects-3-491fbb.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/projects_3312447_columns-4-f80b32.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/projects_columns_6706802_cards-5-aad1d6.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/projects_columns_cards_27353272-6-e93cbd.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/projects_columns_cards_27353272-7-a7094f.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/user-1-c2f32b.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/orgs_github-api-test-org-049038eb-8cc8-4480-b0e9-62a6bb55f112.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/orgs_github-api-test-org_projects-68e871e2-343e-47b7-aa45-b613ef9f8bc0.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/projects_3312443_columns-1de47f2e-9018-4a4f-9dad-0ee29614aa4e.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/projects_columns_6706800_cards-695ce51a-3df9-4aea-b10d-471d3ff856b8.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/projects_columns_cards_27353267-62a0d7cf-0c8a-4f96-8c00-c48aeaab4a6f.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/projects_columns_cards_27353267-93c5d233-0602-432f-a6a1-784506a19fe0.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/user-355d682a-6ab6-4af5-be72-d00bf6403051.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/orgs_github-api-test-org-2-049038.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/orgs_github-api-test-org_projects-3-68e871.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/projects_3312443_columns-4-1de47f.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/projects_columns_6706800_cards-5-695ce5.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/projects_columns_cards_27353267-6-62a0d7.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/projects_columns_cards_27353267-7-93c5d2.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/user-1-355d68.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/__files/orgs_github-api-test-org-7feb4202-bd04-498e-a28c-fd9df44d8fc8.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/__files/orgs_github-api-test-org_projects-42bd7d98-f969-40ce-bb9a-1586c556569d.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/__files/projects_3312440_columns-eb58635e-11b9-461d-8868-6ece3733f962.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/__files/user-ff30f972-21ad-40ee-aa60-c006643154d2.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/mappings/orgs_github-api-test-org-2-7feb42.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/mappings/orgs_github-api-test-org_projects-3-42bd7d.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/mappings/projects_3312440_columns-4-eb5863.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/mappings/user-1-ff30f9.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/__files/orgs_github-api-test-org-f4a0595a-a719-4b21-bf67-f12d67bac972.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/__files/orgs_github-api-test-org_projects-bfb7de93-74a1-48dc-a74a-ba06cee9e764.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/__files/projects_3312441_columns-fb6e53a0-db62-4037-8f0b-3511e79bea93.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/__files/user-f818b667-7eed-4efb-9719-ea27f8d05b59.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/orgs_github-api-test-org-2-f4a059.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/orgs_github-api-test-org_projects-3-bfb7de.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/projects_3312441_columns-4-fb6e53.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/projects_columns_6706794-5-8c0cae.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/projects_columns_6706794-6-112e1e.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/user-1-f818b6.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/orgs_github-api-test-org-eb0425ef-7f2e-4b3a-a7f7-53cef5d5647b.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/orgs_github-api-test-org_projects-97b70b32-45f4-419f-87d0-f15a2c004196.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/projects_3312439_columns-082ed3d1-bea6-48fc-8e61-a63c4d0db977.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/projects_columns_6706791-1cfa5ddf-74f4-4a95-aaf2-c8149c7d1c17.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/projects_columns_6706791-85f35660-6579-4bea-af53-b636239dd5cd.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/user-e21e45b0-f34c-473e-9454-cb601fb759b9.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/orgs_github-api-test-org-2-eb0425.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/orgs_github-api-test-org_projects-3-97b70b.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/projects_3312439_columns-4-082ed3.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/projects_columns_6706791-5-85f356.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/projects_columns_6706791-6-1cfa5d.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/user-1-e21e45.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/__files/orgs_github-api-test-org-713f01eb-4f07-4f02-89fe-e7560ed08e11.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/__files/orgs_github-api-test-org_projects-e5afd90e-d2ac-4e83-800d-a680bc27c9ed.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/__files/user-a9a3d26a-4c87-4ebf-9609-48b2120173b7.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/mappings/orgs_github-api-test-org-2-713f01.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/mappings/orgs_github-api-test-org_projects-3-e5afd9.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/mappings/user-1-a9a3d2.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/__files/orgs_github-api-test-org-c3024047-fc8f-443f-a2b4-810324f889b4.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/__files/orgs_github-api-test-org_projects-daa6c228-6e0f-4398-a6d2-2d114f986e93.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/__files/user-9cb86722-7ae5-46b2-8598-59567e17ed99.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/mappings/orgs_github-api-test-org-2-c30240.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/mappings/orgs_github-api-test-org_projects-3-daa6c2.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/mappings/projects_3312437-4-f50762.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/mappings/projects_3312437-5-8b8e6f.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/mappings/user-1-9cb867.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/__files/orgs_github-api-test-org-2e39c772-c889-44d1-bf15-5248ad194202.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/__files/orgs_github-api-test-org_projects-08231b0e-288f-49fa-aa2b-9456449d2cfd.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/__files/projects_3312435-004d3495-63b2-40e7-a864-10d175a59756.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/__files/projects_3312435-76e0c251-b1df-4f18-8a01-77a7bbc15474.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/__files/user-b2b1262a-1678-4080-af72-92346bb25688.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/mappings/orgs_github-api-test-org-2-2e39c7.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/mappings/orgs_github-api-test-org_projects-3-08231b.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/mappings/projects_3312435-4-004d34.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/mappings/projects_3312435-5-76e0c2.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/mappings/user-1-b2b126.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/__files/orgs_github-api-test-org-e3d87fca-b817-4dfb-b80f-99eebaabba08.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/__files/orgs_github-api-test-org_projects-6a0a4669-8d74-4fa9-92c0-0fa428078637.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/__files/projects_3312436-20ac7f07-9e2b-47dd-801c-67974592a3b9.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/__files/projects_3312436-6c28d544-7193-4c9d-93a8-5c4bd20af717.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/__files/user-115e6194-ffb3-4129-8f7b-ad60f5fff91a.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/mappings/orgs_github-api-test-org-2-e3d87f.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/mappings/orgs_github-api-test-org_projects-3-6a0a46.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/mappings/projects_3312436-4-20ac7f.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/mappings/projects_3312436-5-6c28d5.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/mappings/user-1-115e61.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/__files/orgs_github-api-test-org-a522b55e-f089-4a29-a55e-33f0744eca1a.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/__files/orgs_github-api-test-org_projects-ee429eb6-b010-4916-91af-3ce0976426dd.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/__files/projects_3312433-55b16b4e-924d-4cf7-9113-fbc644011a44.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/__files/projects_3312433-715884a8-0610-43b5-9379-01ac91168ec0.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/__files/user-f7605e5c-c728-4af9-baca-a6e1266d1b4a.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/mappings/orgs_github-api-test-org-2-a522b5.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/mappings/orgs_github-api-test-org_projects-3-ee429e.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/mappings/projects_3312433-4-55b16b.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/mappings/projects_3312433-5-715884.json create mode 100644 src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/mappings/user-1-f7605e.json diff --git a/src/main/java/org/kohsuke/github/GitHub.java b/src/main/java/org/kohsuke/github/GitHub.java index 8bd42ce84a..ec32863904 100644 --- a/src/main/java/org/kohsuke/github/GitHub.java +++ b/src/main/java/org/kohsuke/github/GitHub.java @@ -49,8 +49,8 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; import static java.net.HttpURLConnection.HTTP_UNAUTHORIZED; import static java.util.logging.Level.FINE; -import static org.kohsuke.github.Previews.DRAX; import static org.kohsuke.github.Previews.INERTIA; +import static org.kohsuke.github.Previews.MACHINE_MAN; /** * Root of the GitHub API. diff --git a/src/test/java/org/kohsuke/github/GHProjectCardTest.java b/src/test/java/org/kohsuke/github/GHProjectCardTest.java index 8131f763bb..a8add9b460 100644 --- a/src/test/java/org/kohsuke/github/GHProjectCardTest.java +++ b/src/test/java/org/kohsuke/github/GHProjectCardTest.java @@ -2,6 +2,7 @@ import org.junit.After; import org.junit.Assert; +import org.junit.Before; import org.junit.Test; import java.io.FileNotFoundException; @@ -10,15 +11,15 @@ /** * @author Gunnar Skjold */ -public class GHProjectCardTest extends AbstractGitHubApiTestBase { +public class GHProjectCardTest extends AbstractGitHubApiWireMockTest { private GHOrganization org; private GHProject project; private GHProjectColumn column; private GHProjectCard card; - @Override public void setUp() throws Exception { - super.setUp(); - org = gitHub.getOrganization("github-api-test-org"); + @Before + public void setUp() throws Exception { + org = gitHub.getOrganization(GITHUB_API_TEST_ORG); project = org.createProject("test-project", "This is a test project"); column = project.createColumn("column-one"); card = column.createCard("This is a card"); @@ -71,28 +72,35 @@ public void testDeleteCard() throws IOException { @After public void after() throws IOException { - if(card != null) { - try { - card.delete(); - card = null; - } catch (FileNotFoundException e) { - card = null; + if(githubApi.isUseProxy()) { + if (card != null) { + card = gitHubBeforeAfter.getProjectCard(card.getId()); + try { + card.delete(); + card = null; + } catch (FileNotFoundException e) { + card = null; + } } - } - if(column != null) { - try { - column.delete(); - column = null; - } catch (FileNotFoundException e) { - column = null; + if (column != null) { + column = gitHubBeforeAfter + .getProjectColumn(column.getId()); + try { + column.delete(); + column = null; + } catch (FileNotFoundException e) { + column = null; + } } - } - if(project != null) { - try { - project.delete(); - project = null; - } catch (FileNotFoundException e) { - project = null; + if (project != null) { + project = gitHubBeforeAfter + .getProject(project.getId()); + try { + project.delete(); + project = null; + } catch (FileNotFoundException e) { + project = null; + } } } } diff --git a/src/test/java/org/kohsuke/github/GHProjectColumnTest.java b/src/test/java/org/kohsuke/github/GHProjectColumnTest.java index 27e8460b23..fe105191b8 100644 --- a/src/test/java/org/kohsuke/github/GHProjectColumnTest.java +++ b/src/test/java/org/kohsuke/github/GHProjectColumnTest.java @@ -2,6 +2,7 @@ import org.junit.After; import org.junit.Assert; +import org.junit.Before; import org.junit.Test; import java.io.FileNotFoundException; @@ -10,14 +11,14 @@ /** * @author Gunnar Skjold */ -public class GHProjectColumnTest extends AbstractGitHubApiTestBase { +public class GHProjectColumnTest extends AbstractGitHubApiWireMockTest { private GHProject project; private GHProjectColumn column; - @Override public void setUp() throws Exception { - super.setUp(); + @Before + public void setUp() throws Exception { project = gitHub - .getOrganization("github-api-test-org") + .getOrganization(GITHUB_API_TEST_ORG) .createProject("test-project", "This is a test project"); column = project.createColumn("column-one"); } @@ -47,20 +48,26 @@ public void testDeleteColumn() throws IOException { @After public void after() throws IOException { - if(column != null) { - try { - column.delete(); - column = null; - } catch (FileNotFoundException e) { - column = null; + if(githubApi.isUseProxy()) { + if (column != null) { + column = gitHubBeforeAfter + .getProjectColumn(column.getId()); + try { + column.delete(); + column = null; + } catch (FileNotFoundException e) { + column = null; + } } - } - if(project != null) { - try { - project.delete(); - project = null; - } catch (FileNotFoundException e) { - project = null; + if (project != null) { + project = gitHubBeforeAfter + .getProject(project.getId()); + try { + project.delete(); + project = null; + } catch (FileNotFoundException e) { + project = null; + } } } } diff --git a/src/test/java/org/kohsuke/github/GHProjectTest.java b/src/test/java/org/kohsuke/github/GHProjectTest.java index b5e1aef122..97329cebaa 100644 --- a/src/test/java/org/kohsuke/github/GHProjectTest.java +++ b/src/test/java/org/kohsuke/github/GHProjectTest.java @@ -2,6 +2,7 @@ import org.junit.After; import org.junit.Assert; +import org.junit.Before; import org.junit.Test; import java.io.FileNotFoundException; @@ -10,14 +11,14 @@ /** * @author Gunnar Skjold */ -public class GHProjectTest extends AbstractGitHubApiTestBase { +public class GHProjectTest extends AbstractGitHubApiWireMockTest { private GHProject project; - @Override public void setUp() throws Exception { - super.setUp(); + @Before + public void setUp() throws Exception { project = gitHub - .getOrganization("github-api-test-org") - .createProject("test-project", "This is a test project"); + .getOrganization(GITHUB_API_TEST_ORG) + .createProject("test-project", "This is a test project"); } @Test @@ -68,12 +69,16 @@ public void testDeleteProject() throws IOException { @After public void after() throws IOException { - if(project != null) { - try { - project.delete(); - project = null; - } catch (FileNotFoundException e) { - project = null; + if (githubApi.isUseProxy()) { + if (project != null) { + project = gitHubBeforeAfter + .getProject(project.getId()); + try { + project.delete(); + project = null; + } catch (FileNotFoundException e) { + project = null; + } } } } diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/orgs_github-api-test-org-8a33ed8f-a98f-47af-a4e7-a30928da2e70.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/orgs_github-api-test-org-8a33ed8f-a98f-47af-a4e7-a30928da2e70.json new file mode 100644 index 0000000000..d4c06c4749 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/orgs_github-api-test-org-8a33ed8f-a98f-47af-a4e7-a30928da2e70.json @@ -0,0 +1,41 @@ +{ + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/github-api-test-org", + "repos_url": "https://api.github.com/orgs/github-api-test-org/repos", + "events_url": "https://api.github.com/orgs/github-api-test-org/events", + "hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks", + "issues_url": "https://api.github.com/orgs/github-api-test-org/issues", + "members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/github-api-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 9, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/github-api-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 132, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 4, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/orgs_github-api-test-org_projects-b659e68a-af69-4413-a2fa-602524428990.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/orgs_github-api-test-org_projects-b659e68a-af69-4413-a2fa-602524428990.json new file mode 100644 index 0000000000..06acfcdc1a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/orgs_github-api-test-org_projects-b659e68a-af69-4413-a2fa-602524428990.json @@ -0,0 +1,36 @@ +{ + "owner_url": "https://api.github.com/orgs/github-api-test-org", + "url": "https://api.github.com/projects/3312444", + "html_url": "https://github.com/orgs/github-api-test-org/projects/29", + "columns_url": "https://api.github.com/projects/3312444/columns", + "id": 3312444, + "node_id": "MDc6UHJvamVjdDMzMTI0NDQ=", + "name": "test-project", + "body": "This is a test project", + "number": 29, + "state": "open", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:25:02Z", + "updated_at": "2019-10-04T17:25:02Z", + "organization_permission": "write", + "private": true +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/projects_3312444_columns-3be146c4-9f97-4b2d-9951-16dd86ec334f.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/projects_3312444_columns-3be146c4-9f97-4b2d-9951-16dd86ec334f.json new file mode 100644 index 0000000000..77eddc66fa --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/projects_3312444_columns-3be146c4-9f97-4b2d-9951-16dd86ec334f.json @@ -0,0 +1,10 @@ +{ + "url": "https://api.github.com/projects/columns/6706801", + "project_url": "https://api.github.com/projects/3312444", + "cards_url": "https://api.github.com/projects/columns/6706801/cards", + "id": 6706801, + "node_id": "MDEzOlByb2plY3RDb2x1bW42NzA2ODAx", + "name": "column-one", + "created_at": "2019-10-04T17:25:04Z", + "updated_at": "2019-10-04T17:25:04Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/projects_columns_6706801_cards-45bdd9f0-5efe-43c3-b01f-130894549d0d.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/projects_columns_6706801_cards-45bdd9f0-5efe-43c3-b01f-130894549d0d.json new file mode 100644 index 0000000000..a0e0256b15 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/projects_columns_6706801_cards-45bdd9f0-5efe-43c3-b01f-130894549d0d.json @@ -0,0 +1,31 @@ +{ + "url": "https://api.github.com/projects/columns/cards/27353270", + "project_url": "https://api.github.com/projects/3312444", + "id": 27353270, + "node_id": "MDExOlByb2plY3RDYXJkMjczNTMyNzA=", + "note": "This is a card", + "archived": false, + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:25:04Z", + "updated_at": "2019-10-04T17:25:04Z", + "column_url": "https://api.github.com/projects/columns/6706801" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/projects_columns_cards_27353270-75b0d2d0-bf80-4ffe-bb43-a39a48abf2ac.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/projects_columns_cards_27353270-75b0d2d0-bf80-4ffe-bb43-a39a48abf2ac.json new file mode 100644 index 0000000000..76e1c0889f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/projects_columns_cards_27353270-75b0d2d0-bf80-4ffe-bb43-a39a48abf2ac.json @@ -0,0 +1,31 @@ +{ + "url": "https://api.github.com/projects/columns/cards/27353270", + "project_url": "https://api.github.com/projects/3312444", + "id": 27353270, + "node_id": "MDExOlByb2plY3RDYXJkMjczNTMyNzA=", + "note": "This is a card", + "archived": true, + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:25:04Z", + "updated_at": "2019-10-04T17:25:04Z", + "column_url": "https://api.github.com/projects/columns/6706801" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/projects_columns_cards_27353270-97fd6c7d-30b2-4036-9d02-b3be29a2c045.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/projects_columns_cards_27353270-97fd6c7d-30b2-4036-9d02-b3be29a2c045.json new file mode 100644 index 0000000000..76e1c0889f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/projects_columns_cards_27353270-97fd6c7d-30b2-4036-9d02-b3be29a2c045.json @@ -0,0 +1,31 @@ +{ + "url": "https://api.github.com/projects/columns/cards/27353270", + "project_url": "https://api.github.com/projects/3312444", + "id": 27353270, + "node_id": "MDExOlByb2plY3RDYXJkMjczNTMyNzA=", + "note": "This is a card", + "archived": true, + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:25:04Z", + "updated_at": "2019-10-04T17:25:04Z", + "column_url": "https://api.github.com/projects/columns/6706801" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/user-0c7200e4-cdc5-45a5-997a-d7b8568751cf.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/user-0c7200e4-cdc5-45a5-997a-d7b8568751cf.json new file mode 100644 index 0000000000..41fc9e3d00 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/__files/user-0c7200e4-cdc5-45a5-997a-d7b8568751cf.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 168, + "public_gists": 4, + "followers": 136, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/orgs_github-api-test-org-2-8a33ed.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/orgs_github-api-test-org-2-8a33ed.json new file mode 100644 index 0000000000..0fad4ad0c7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/orgs_github-api-test-org-2-8a33ed.json @@ -0,0 +1,43 @@ +{ + "id": "8a33ed8f-a98f-47af-a4e7-a30928da2e70", + "name": "orgs_github-api-test-org", + "request": { + "url": "/orgs/github-api-test-org", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org-8a33ed8f-a98f-47af-a4e7-a30928da2e70.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:02 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4631", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"9f594020395ec69662bd8dc1ceecdc09\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FED3:9576:937E69:B04FBA:5D97806E" + } + }, + "uuid": "8a33ed8f-a98f-47af-a4e7-a30928da2e70", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/orgs_github-api-test-org_projects-3-b659e6.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/orgs_github-api-test-org_projects-3-b659e6.json new file mode 100644 index 0000000000..38d50bdddf --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/orgs_github-api-test-org_projects-3-b659e6.json @@ -0,0 +1,50 @@ +{ + "id": "b659e68a-af69-4413-a2fa-602524428990", + "name": "orgs_github-api-test-org_projects", + "request": { + "url": "/orgs/github-api-test-org/projects", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"test-project\",\"body\":\"This is a test project\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "orgs_github-api-test-org_projects-b659e68a-af69-4413-a2fa-602524428990.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:02 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4630", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"0352b24f63b26aa9d39c6249d1fe1c9d\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/3312444", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FED3:9576:937E80:B04FDD:5D97806E" + } + }, + "uuid": "b659e68a-af69-4413-a2fa-602524428990", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/projects_3312444_columns-4-3be146.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/projects_3312444_columns-4-3be146.json new file mode 100644 index 0000000000..c772215c9d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/projects_3312444_columns-4-3be146.json @@ -0,0 +1,50 @@ +{ + "id": "3be146c4-9f97-4b2d-9951-16dd86ec334f", + "name": "projects_3312444_columns", + "request": { + "url": "/projects/3312444/columns", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"column-one\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "projects_3312444_columns-3be146c4-9f97-4b2d-9951-16dd86ec334f.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:04 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4629", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"8a5a130f59bb6cf0ede0418db5a2ca39\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/columns/6706801", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FED3:9576:937E9D:B05000:5D97806E" + } + }, + "uuid": "3be146c4-9f97-4b2d-9951-16dd86ec334f", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/projects_columns_6706801_cards-5-45bdd9.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/projects_columns_6706801_cards-5-45bdd9.json new file mode 100644 index 0000000000..16a7772f38 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/projects_columns_6706801_cards-5-45bdd9.json @@ -0,0 +1,50 @@ +{ + "id": "45bdd9f0-5efe-43c3-b01f-130894549d0d", + "name": "projects_columns_6706801_cards", + "request": { + "url": "/projects/columns/6706801/cards", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"note\":\"This is a card\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "projects_columns_6706801_cards-45bdd9f0-5efe-43c3-b01f-130894549d0d.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:04 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4628", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"d2c60751e9be05289aec1483ae32d09f\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/columns/cards/27353270", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FED3:9576:937F08:B0507E:5D978070" + } + }, + "uuid": "45bdd9f0-5efe-43c3-b01f-130894549d0d", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/projects_columns_cards_27353270-6-97fd6c.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/projects_columns_cards_27353270-6-97fd6c.json new file mode 100644 index 0000000000..e8b2dcd02b --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/projects_columns_cards_27353270-6-97fd6c.json @@ -0,0 +1,49 @@ +{ + "id": "97fd6c7d-30b2-4036-9d02-b3be29a2c045", + "name": "projects_columns_cards_27353270", + "request": { + "url": "/projects/columns/cards/27353270", + "method": "PATCH", + "bodyPatterns": [ + { + "equalToJson": "{\"archived\":true}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "projects_columns_cards_27353270-97fd6c7d-30b2-4036-9d02-b3be29a2c045.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:05 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4627", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"ffc5b693f27764f98ac96f98a71de68b\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FED3:9576:937F1A:B05094:5D978070" + } + }, + "uuid": "97fd6c7d-30b2-4036-9d02-b3be29a2c045", + "persistent": true, + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/projects_columns_cards_27353270-7-75b0d2.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/projects_columns_cards_27353270-7-75b0d2.json new file mode 100644 index 0000000000..f823dcfb6d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/projects_columns_cards_27353270-7-75b0d2.json @@ -0,0 +1,42 @@ +{ + "id": "75b0d2d0-bf80-4ffe-bb43-a39a48abf2ac", + "name": "projects_columns_cards_27353270", + "request": { + "url": "/projects/columns/cards/27353270", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "projects_columns_cards_27353270-75b0d2d0-bf80-4ffe-bb43-a39a48abf2ac.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:05 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4626", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"ffc5b693f27764f98ac96f98a71de68b\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "read:org, repo", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FED3:9576:937F27:B050A1:5D978071" + } + }, + "uuid": "75b0d2d0-bf80-4ffe-bb43-a39a48abf2ac", + "persistent": true, + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/user-1-0c7200.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/user-1-0c7200.json new file mode 100644 index 0000000000..f658bec9c8 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testArchiveCard/mappings/user-1-0c7200.json @@ -0,0 +1,43 @@ +{ + "id": "0c7200e4-cdc5-45a5-997a-d7b8568751cf", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-0c7200e4-cdc5-45a5-997a-d7b8568751cf.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:02 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4633", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FED3:9576:937E51:B04FAD:5D97806D" + } + }, + "uuid": "0c7200e4-cdc5-45a5-997a-d7b8568751cf", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/orgs_github-api-test-org-2cd47524-8e16-4b6b-aedd-d8dbfbfe5aa9.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/orgs_github-api-test-org-2cd47524-8e16-4b6b-aedd-d8dbfbfe5aa9.json new file mode 100644 index 0000000000..d4c06c4749 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/orgs_github-api-test-org-2cd47524-8e16-4b6b-aedd-d8dbfbfe5aa9.json @@ -0,0 +1,41 @@ +{ + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/github-api-test-org", + "repos_url": "https://api.github.com/orgs/github-api-test-org/repos", + "events_url": "https://api.github.com/orgs/github-api-test-org/events", + "hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks", + "issues_url": "https://api.github.com/orgs/github-api-test-org/issues", + "members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/github-api-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 9, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/github-api-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 132, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 4, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/orgs_github-api-test-org_projects-bac54b7b-af26-4015-85d1-97d981800e06.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/orgs_github-api-test-org_projects-bac54b7b-af26-4015-85d1-97d981800e06.json new file mode 100644 index 0000000000..8e1d50d6ca --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/orgs_github-api-test-org_projects-bac54b7b-af26-4015-85d1-97d981800e06.json @@ -0,0 +1,36 @@ +{ + "owner_url": "https://api.github.com/orgs/github-api-test-org", + "url": "https://api.github.com/projects/3312449", + "html_url": "https://github.com/orgs/github-api-test-org/projects/31", + "columns_url": "https://api.github.com/projects/3312449/columns", + "id": 3312449, + "node_id": "MDc6UHJvamVjdDMzMTI0NDk=", + "name": "test-project", + "body": "This is a test project", + "number": 31, + "state": "open", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:25:11Z", + "updated_at": "2019-10-04T17:25:11Z", + "organization_permission": "write", + "private": true +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/orgs_github-api-test-org_repos-c2d81922-c3f6-41b3-b109-de8cfe1452a6.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/orgs_github-api-test-org_repos-c2d81922-c3f6-41b3-b109-de8cfe1452a6.json new file mode 100644 index 0000000000..45f2fedc15 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/orgs_github-api-test-org_repos-c2d81922-c3f6-41b3-b109-de8cfe1452a6.json @@ -0,0 +1,124 @@ +{ + "id": 212868194, + "node_id": "MDEwOlJlcG9zaXRvcnkyMTI4NjgxOTQ=", + "name": "repo-for-project-card", + "full_name": "github-api-test-org/repo-for-project-card", + "private": false, + "owner": { + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api-test-org", + "html_url": "https://github.com/github-api-test-org", + "followers_url": "https://api.github.com/users/github-api-test-org/followers", + "following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/github-api-test-org/orgs", + "repos_url": "https://api.github.com/users/github-api-test-org/repos", + "events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/github-api-test-org/repo-for-project-card", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card", + "forks_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/forks", + "keys_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/teams", + "hooks_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/hooks", + "issue_events_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/events", + "assignees_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/tags", + "blobs_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/languages", + "stargazers_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/stargazers", + "contributors_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/contributors", + "subscribers_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/subscribers", + "subscription_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/subscription", + "commits_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/merges", + "archive_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/downloads", + "issues_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/deployments", + "created_at": "2019-10-04T17:25:12Z", + "updated_at": "2019-10-04T17:25:12Z", + "pushed_at": "2019-10-04T17:25:13Z", + "git_url": "git://github.com/github-api-test-org/repo-for-project-card.git", + "ssh_url": "git@github.com:github-api-test-org/repo-for-project-card.git", + "clone_url": "https://github.com/github-api-test-org/repo-for-project-card.git", + "svn_url": "https://github.com/github-api-test-org/repo-for-project-card", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api-test-org", + "html_url": "https://github.com/github-api-test-org", + "followers_url": "https://api.github.com/users/github-api-test-org/followers", + "following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/github-api-test-org/orgs", + "repos_url": "https://api.github.com/users/github-api-test-org/repos", + "events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 0, + "subscribers_count": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/projects_3312449_columns-5b504083-4657-4d27-aaff-54f97a361d7a.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/projects_3312449_columns-5b504083-4657-4d27-aaff-54f97a361d7a.json new file mode 100644 index 0000000000..f011da95b1 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/projects_3312449_columns-5b504083-4657-4d27-aaff-54f97a361d7a.json @@ -0,0 +1,10 @@ +{ + "url": "https://api.github.com/projects/columns/6706803", + "project_url": "https://api.github.com/projects/3312449", + "cards_url": "https://api.github.com/projects/columns/6706803/cards", + "id": 6706803, + "node_id": "MDEzOlByb2plY3RDb2x1bW42NzA2ODAz", + "name": "column-one", + "created_at": "2019-10-04T17:25:11Z", + "updated_at": "2019-10-04T17:25:11Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/projects_columns_6706803_cards-6458c399-0897-43a0-a869-f43a56e32cae.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/projects_columns_6706803_cards-6458c399-0897-43a0-a869-f43a56e32cae.json new file mode 100644 index 0000000000..f1baadb19a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/projects_columns_6706803_cards-6458c399-0897-43a0-a869-f43a56e32cae.json @@ -0,0 +1,32 @@ +{ + "url": "https://api.github.com/projects/columns/cards/27353276", + "project_url": "https://api.github.com/projects/3312449", + "id": 27353276, + "node_id": "MDExOlByb2plY3RDYXJkMjczNTMyNzY=", + "note": null, + "archived": false, + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:25:14Z", + "updated_at": "2019-10-04T17:25:14Z", + "column_url": "https://api.github.com/projects/columns/6706803", + "content_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/issues/1" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/projects_columns_6706803_cards-e6d34d34-6779-4c36-83e1-b783989750c3.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/projects_columns_6706803_cards-e6d34d34-6779-4c36-83e1-b783989750c3.json new file mode 100644 index 0000000000..2e66145ee5 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/projects_columns_6706803_cards-e6d34d34-6779-4c36-83e1-b783989750c3.json @@ -0,0 +1,31 @@ +{ + "url": "https://api.github.com/projects/columns/cards/27353274", + "project_url": "https://api.github.com/projects/3312449", + "id": 27353274, + "node_id": "MDExOlByb2plY3RDYXJkMjczNTMyNzQ=", + "note": "This is a card", + "archived": false, + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:25:11Z", + "updated_at": "2019-10-04T17:25:11Z", + "column_url": "https://api.github.com/projects/columns/6706803" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/repos_github-api-test-org_repo-for-project-card_issues-29d82e53-34b8-4443-bddd-fdd14726484d.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/repos_github-api-test-org_repo-for-project-card_issues-29d82e53-34b8-4443-bddd-fdd14726484d.json new file mode 100644 index 0000000000..47a1b67868 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/repos_github-api-test-org_repo-for-project-card_issues-29d82e53-34b8-4443-bddd-fdd14726484d.json @@ -0,0 +1,45 @@ +{ + "url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/issues/1", + "repository_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card", + "labels_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/issues/1/labels{/name}", + "comments_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/issues/1/comments", + "events_url": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/issues/1/events", + "html_url": "https://github.com/github-api-test-org/repo-for-project-card/issues/1", + "id": 502754474, + "node_id": "MDU6SXNzdWU1MDI3NTQ0NzQ=", + "number": 1, + "title": "new-issue", + "user": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2019-10-04T17:25:13Z", + "updated_at": "2019-10-04T17:25:13Z", + "closed_at": null, + "author_association": "MEMBER", + "body": "With body", + "closed_by": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/user-b9c4ba1f-224e-4e78-85ca-b1ac911fdd4e.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/user-b9c4ba1f-224e-4e78-85ca-b1ac911fdd4e.json new file mode 100644 index 0000000000..41fc9e3d00 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/__files/user-b9c4ba1f-224e-4e78-85ca-b1ac911fdd4e.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 168, + "public_gists": 4, + "followers": 136, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/orgs_github-api-test-org-2-2cd475.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/orgs_github-api-test-org-2-2cd475.json new file mode 100644 index 0000000000..73bf97872f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/orgs_github-api-test-org-2-2cd475.json @@ -0,0 +1,43 @@ +{ + "id": "2cd47524-8e16-4b6b-aedd-d8dbfbfe5aa9", + "name": "orgs_github-api-test-org", + "request": { + "url": "/orgs/github-api-test-org", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org-2cd47524-8e16-4b6b-aedd-d8dbfbfe5aa9.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:10 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4605", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"9f594020395ec69662bd8dc1ceecdc09\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEDA:67D5:142032B:183BE8A:5D978076" + } + }, + "uuid": "2cd47524-8e16-4b6b-aedd-d8dbfbfe5aa9", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/orgs_github-api-test-org_projects-3-bac54b.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/orgs_github-api-test-org_projects-3-bac54b.json new file mode 100644 index 0000000000..2bccbc254c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/orgs_github-api-test-org_projects-3-bac54b.json @@ -0,0 +1,50 @@ +{ + "id": "bac54b7b-af26-4015-85d1-97d981800e06", + "name": "orgs_github-api-test-org_projects", + "request": { + "url": "/orgs/github-api-test-org/projects", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"test-project\",\"body\":\"This is a test project\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "orgs_github-api-test-org_projects-bac54b7b-af26-4015-85d1-97d981800e06.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:11 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4604", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"d1d461a75278bbbb1a08d18225aed84e\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/3312449", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEDA:67D5:1420357:183BEDA:5D978076" + } + }, + "uuid": "bac54b7b-af26-4015-85d1-97d981800e06", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/orgs_github-api-test-org_repos-6-c2d819.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/orgs_github-api-test-org_repos-6-c2d819.json new file mode 100644 index 0000000000..4ea2da06b9 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/orgs_github-api-test-org_repos-6-c2d819.json @@ -0,0 +1,50 @@ +{ + "id": "c2d81922-c3f6-41b3-b109-de8cfe1452a6", + "name": "orgs_github-api-test-org_repos", + "request": { + "url": "/orgs/github-api-test-org/repos", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"repo-for-project-card\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "orgs_github-api-test-org_repos-c2d81922-c3f6-41b3-b109-de8cfe1452a6.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:13 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4601", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"ff15f221184e2f39f88faf88098794e9\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "public_repo, repo", + "Location": "https://api.github.com/repos/github-api-test-org/repo-for-project-card", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEDA:67D5:14203DE:183BF9A:5D978078" + } + }, + "uuid": "c2d81922-c3f6-41b3-b109-de8cfe1452a6", + "persistent": true, + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/projects_3312449_columns-4-5b5040.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/projects_3312449_columns-4-5b5040.json new file mode 100644 index 0000000000..51a874a0ac --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/projects_3312449_columns-4-5b5040.json @@ -0,0 +1,50 @@ +{ + "id": "5b504083-4657-4d27-aaff-54f97a361d7a", + "name": "projects_3312449_columns", + "request": { + "url": "/projects/3312449/columns", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"column-one\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "projects_3312449_columns-5b504083-4657-4d27-aaff-54f97a361d7a.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:11 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4603", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"6d8f989a5dec185be871918f7ec4d50c\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/columns/6706803", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEDA:67D5:142037F:183BF13:5D978077" + } + }, + "uuid": "5b504083-4657-4d27-aaff-54f97a361d7a", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/projects_columns_6706803_cards-5-e6d34d.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/projects_columns_6706803_cards-5-e6d34d.json new file mode 100644 index 0000000000..d9606fbcf1 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/projects_columns_6706803_cards-5-e6d34d.json @@ -0,0 +1,50 @@ +{ + "id": "e6d34d34-6779-4c36-83e1-b783989750c3", + "name": "projects_columns_6706803_cards", + "request": { + "url": "/projects/columns/6706803/cards", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"note\":\"This is a card\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "projects_columns_6706803_cards-e6d34d34-6779-4c36-83e1-b783989750c3.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:12 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4602", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"0d7f40e0e039f508cb3b99df2bde0ed3\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/columns/cards/27353274", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEDA:67D5:142039F:183BF3D:5D978077" + } + }, + "uuid": "e6d34d34-6779-4c36-83e1-b783989750c3", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/projects_columns_6706803_cards-8-6458c3.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/projects_columns_6706803_cards-8-6458c3.json new file mode 100644 index 0000000000..1df22db0d0 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/projects_columns_6706803_cards-8-6458c3.json @@ -0,0 +1,50 @@ +{ + "id": "6458c399-0897-43a0-a869-f43a56e32cae", + "name": "projects_columns_6706803_cards", + "request": { + "url": "/projects/columns/6706803/cards", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"content_type\":\"Issue\",\"content_id\":502754474}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "projects_columns_6706803_cards-6458c399-0897-43a0-a869-f43a56e32cae.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:14 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4599", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"05e36deeaf8f3f5a1cf0deac806488b7\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/columns/cards/27353276", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEDA:67D5:142046E:183C033:5D978079" + } + }, + "uuid": "6458c399-0897-43a0-a869-f43a56e32cae", + "persistent": true, + "insertionIndex": 8 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/repos_github-api-test-org_repo-for-project-card-9-372cc0.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/repos_github-api-test-org_repo-for-project-card-9-372cc0.json new file mode 100644 index 0000000000..cbf2c659e7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/repos_github-api-test-org_repo-for-project-card-9-372cc0.json @@ -0,0 +1,35 @@ +{ + "id": "372cc0cc-75fb-42cf-8deb-21fbd656909f", + "name": "repos_github-api-test-org_repo-for-project-card", + "request": { + "url": "/repos/github-api-test-org/repo-for-project-card", + "method": "DELETE" + }, + "response": { + "status": 204, + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:14 GMT", + "Server": "GitHub.com", + "Status": "204 No Content", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4598", + "X-RateLimit-Reset": "1570212957", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "delete_repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "Vary": "Accept-Encoding", + "X-GitHub-Request-Id": "FEDA:67D5:14204A5:183C079:5D97807A" + } + }, + "uuid": "372cc0cc-75fb-42cf-8deb-21fbd656909f", + "persistent": true, + "insertionIndex": 9 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/repos_github-api-test-org_repo-for-project-card_issues-7-29d82e.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/repos_github-api-test-org_repo-for-project-card_issues-7-29d82e.json new file mode 100644 index 0000000000..3031b1252e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/repos_github-api-test-org_repo-for-project-card_issues-7-29d82e.json @@ -0,0 +1,50 @@ +{ + "id": "29d82e53-34b8-4443-bddd-fdd14726484d", + "name": "repos_github-api-test-org_repo-for-project-card_issues", + "request": { + "url": "/repos/github-api-test-org/repo-for-project-card/issues", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"assignees\":[],\"title\":\"new-issue\",\"body\":\"With body\",\"labels\":[]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_github-api-test-org_repo-for-project-card_issues-29d82e53-34b8-4443-bddd-fdd14726484d.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:13 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4600", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"0d7123758265ea6286208deab2079438\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "Location": "https://api.github.com/repos/github-api-test-org/repo-for-project-card/issues/1", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEDA:67D5:1420438:183BFF5:5D978079" + } + }, + "uuid": "29d82e53-34b8-4443-bddd-fdd14726484d", + "persistent": true, + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/user-1-b9c4ba.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/user-1-b9c4ba.json new file mode 100644 index 0000000000..a10ce254be --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreateCardFromIssue/mappings/user-1-b9c4ba.json @@ -0,0 +1,43 @@ +{ + "id": "b9c4ba1f-224e-4e78-85ca-b1ac911fdd4e", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-b9c4ba1f-224e-4e78-85ca-b1ac911fdd4e.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:10 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4607", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEDA:67D5:14202ED:183BE79:5D978076" + } + }, + "uuid": "b9c4ba1f-224e-4e78-85ca-b1ac911fdd4e", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/__files/orgs_github-api-test-org-a73c2760-fcb1-4ad6-a379-508ae8bd6a92.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/__files/orgs_github-api-test-org-a73c2760-fcb1-4ad6-a379-508ae8bd6a92.json new file mode 100644 index 0000000000..d4c06c4749 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/__files/orgs_github-api-test-org-a73c2760-fcb1-4ad6-a379-508ae8bd6a92.json @@ -0,0 +1,41 @@ +{ + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/github-api-test-org", + "repos_url": "https://api.github.com/orgs/github-api-test-org/repos", + "events_url": "https://api.github.com/orgs/github-api-test-org/events", + "hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks", + "issues_url": "https://api.github.com/orgs/github-api-test-org/issues", + "members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/github-api-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 9, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/github-api-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 132, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 4, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/__files/orgs_github-api-test-org_projects-fd95c811-2dc4-458b-a18f-72b93e2cfac7.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/__files/orgs_github-api-test-org_projects-fd95c811-2dc4-458b-a18f-72b93e2cfac7.json new file mode 100644 index 0000000000..a6b6c3d720 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/__files/orgs_github-api-test-org_projects-fd95c811-2dc4-458b-a18f-72b93e2cfac7.json @@ -0,0 +1,36 @@ +{ + "owner_url": "https://api.github.com/orgs/github-api-test-org", + "url": "https://api.github.com/projects/3312442", + "html_url": "https://github.com/orgs/github-api-test-org/projects/27", + "columns_url": "https://api.github.com/projects/3312442/columns", + "id": 3312442, + "node_id": "MDc6UHJvamVjdDMzMTI0NDI=", + "name": "test-project", + "body": "This is a test project", + "number": 27, + "state": "open", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:24:55Z", + "updated_at": "2019-10-04T17:24:55Z", + "organization_permission": "write", + "private": true +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/__files/projects_3312442_columns-264f75eb-2b63-4727-9470-21079137ecf4.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/__files/projects_3312442_columns-264f75eb-2b63-4727-9470-21079137ecf4.json new file mode 100644 index 0000000000..232f45cd97 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/__files/projects_3312442_columns-264f75eb-2b63-4727-9470-21079137ecf4.json @@ -0,0 +1,10 @@ +{ + "url": "https://api.github.com/projects/columns/6706799", + "project_url": "https://api.github.com/projects/3312442", + "cards_url": "https://api.github.com/projects/columns/6706799/cards", + "id": 6706799, + "node_id": "MDEzOlByb2plY3RDb2x1bW42NzA2Nzk5", + "name": "column-one", + "created_at": "2019-10-04T17:24:55Z", + "updated_at": "2019-10-04T17:24:55Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/__files/projects_columns_6706799_cards-0a15ceb0-700f-41b0-8a07-ac04dcdcd13f.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/__files/projects_columns_6706799_cards-0a15ceb0-700f-41b0-8a07-ac04dcdcd13f.json new file mode 100644 index 0000000000..398fcdc1fd --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/__files/projects_columns_6706799_cards-0a15ceb0-700f-41b0-8a07-ac04dcdcd13f.json @@ -0,0 +1,31 @@ +{ + "url": "https://api.github.com/projects/columns/cards/27353264", + "project_url": "https://api.github.com/projects/3312442", + "id": 27353264, + "node_id": "MDExOlByb2plY3RDYXJkMjczNTMyNjQ=", + "note": "This is a card", + "archived": false, + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:24:56Z", + "updated_at": "2019-10-04T17:24:56Z", + "column_url": "https://api.github.com/projects/columns/6706799" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/__files/user-80e34816-e0ac-422b-807b-bc8c1f2bd313.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/__files/user-80e34816-e0ac-422b-807b-bc8c1f2bd313.json new file mode 100644 index 0000000000..41fc9e3d00 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/__files/user-80e34816-e0ac-422b-807b-bc8c1f2bd313.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 168, + "public_gists": 4, + "followers": 136, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/mappings/orgs_github-api-test-org-2-a73c27.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/mappings/orgs_github-api-test-org-2-a73c27.json new file mode 100644 index 0000000000..ea8de8733e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/mappings/orgs_github-api-test-org-2-a73c27.json @@ -0,0 +1,43 @@ +{ + "id": "a73c2760-fcb1-4ad6-a379-508ae8bd6a92", + "name": "orgs_github-api-test-org", + "request": { + "url": "/orgs/github-api-test-org", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org-a73c2760-fcb1-4ad6-a379-508ae8bd6a92.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:55 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4657", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"9f594020395ec69662bd8dc1ceecdc09\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FECA:67D5:141FD27:183B741:5D978066" + } + }, + "uuid": "a73c2760-fcb1-4ad6-a379-508ae8bd6a92", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/mappings/orgs_github-api-test-org_projects-3-fd95c8.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/mappings/orgs_github-api-test-org_projects-3-fd95c8.json new file mode 100644 index 0000000000..bfa5be1748 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/mappings/orgs_github-api-test-org_projects-3-fd95c8.json @@ -0,0 +1,50 @@ +{ + "id": "fd95c811-2dc4-458b-a18f-72b93e2cfac7", + "name": "orgs_github-api-test-org_projects", + "request": { + "url": "/orgs/github-api-test-org/projects", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"test-project\",\"body\":\"This is a test project\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "orgs_github-api-test-org_projects-fd95c811-2dc4-458b-a18f-72b93e2cfac7.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:55 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4656", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"8483e57ecc662f52cb6cd664af324822\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/3312442", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FECA:67D5:141FD33:183B786:5D978067" + } + }, + "uuid": "fd95c811-2dc4-458b-a18f-72b93e2cfac7", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/mappings/projects_3312442_columns-4-264f75.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/mappings/projects_3312442_columns-4-264f75.json new file mode 100644 index 0000000000..9f33f5f512 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/mappings/projects_3312442_columns-4-264f75.json @@ -0,0 +1,50 @@ +{ + "id": "264f75eb-2b63-4727-9470-21079137ecf4", + "name": "projects_3312442_columns", + "request": { + "url": "/projects/3312442/columns", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"column-one\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "projects_3312442_columns-264f75eb-2b63-4727-9470-21079137ecf4.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:56 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4655", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"1f426f1160a962a9db803541783fa38f\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/columns/6706799", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FECA:67D5:141FD56:183B7AF:5D978067" + } + }, + "uuid": "264f75eb-2b63-4727-9470-21079137ecf4", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/mappings/projects_columns_6706799_cards-5-0a15ce.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/mappings/projects_columns_6706799_cards-5-0a15ce.json new file mode 100644 index 0000000000..242057e527 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/mappings/projects_columns_6706799_cards-5-0a15ce.json @@ -0,0 +1,50 @@ +{ + "id": "0a15ceb0-700f-41b0-8a07-ac04dcdcd13f", + "name": "projects_columns_6706799_cards", + "request": { + "url": "/projects/columns/6706799/cards", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"note\":\"This is a card\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "projects_columns_6706799_cards-0a15ceb0-700f-41b0-8a07-ac04dcdcd13f.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:56 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4654", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"29deaf737002d2e2c98e6667fd9c03a6\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/columns/cards/27353264", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FECA:67D5:141FD76:183B7D1:5D978068" + } + }, + "uuid": "0a15ceb0-700f-41b0-8a07-ac04dcdcd13f", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/mappings/user-1-80e348.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/mappings/user-1-80e348.json new file mode 100644 index 0000000000..b518648eae --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testCreatedCard/mappings/user-1-80e348.json @@ -0,0 +1,43 @@ +{ + "id": "80e34816-e0ac-422b-807b-bc8c1f2bd313", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-80e34816-e0ac-422b-807b-bc8c1f2bd313.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:54 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4659", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FECA:67D5:141FCEE:183B730:5D978066" + } + }, + "uuid": "80e34816-e0ac-422b-807b-bc8c1f2bd313", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/__files/orgs_github-api-test-org-467a3990-86b4-4c0f-9d2a-e51630e548f6.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/__files/orgs_github-api-test-org-467a3990-86b4-4c0f-9d2a-e51630e548f6.json new file mode 100644 index 0000000000..d4c06c4749 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/__files/orgs_github-api-test-org-467a3990-86b4-4c0f-9d2a-e51630e548f6.json @@ -0,0 +1,41 @@ +{ + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/github-api-test-org", + "repos_url": "https://api.github.com/orgs/github-api-test-org/repos", + "events_url": "https://api.github.com/orgs/github-api-test-org/events", + "hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks", + "issues_url": "https://api.github.com/orgs/github-api-test-org/issues", + "members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/github-api-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 9, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/github-api-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 132, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 4, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/__files/orgs_github-api-test-org_projects-491fbbf4-d8d0-433d-9ec6-162fa95ad792.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/__files/orgs_github-api-test-org_projects-491fbbf4-d8d0-433d-9ec6-162fa95ad792.json new file mode 100644 index 0000000000..8f72fd9edc --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/__files/orgs_github-api-test-org_projects-491fbbf4-d8d0-433d-9ec6-162fa95ad792.json @@ -0,0 +1,36 @@ +{ + "owner_url": "https://api.github.com/orgs/github-api-test-org", + "url": "https://api.github.com/projects/3312447", + "html_url": "https://github.com/orgs/github-api-test-org/projects/30", + "columns_url": "https://api.github.com/projects/3312447/columns", + "id": 3312447, + "node_id": "MDc6UHJvamVjdDMzMTI0NDc=", + "name": "test-project", + "body": "This is a test project", + "number": 30, + "state": "open", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:25:07Z", + "updated_at": "2019-10-04T17:25:07Z", + "organization_permission": "write", + "private": true +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/__files/projects_3312447_columns-f80b3261-cf13-4bcf-82b7-19a1425cbe78.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/__files/projects_3312447_columns-f80b3261-cf13-4bcf-82b7-19a1425cbe78.json new file mode 100644 index 0000000000..a9ed214c99 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/__files/projects_3312447_columns-f80b3261-cf13-4bcf-82b7-19a1425cbe78.json @@ -0,0 +1,10 @@ +{ + "url": "https://api.github.com/projects/columns/6706802", + "project_url": "https://api.github.com/projects/3312447", + "cards_url": "https://api.github.com/projects/columns/6706802/cards", + "id": 6706802, + "node_id": "MDEzOlByb2plY3RDb2x1bW42NzA2ODAy", + "name": "column-one", + "created_at": "2019-10-04T17:25:08Z", + "updated_at": "2019-10-04T17:25:08Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/__files/projects_columns_6706802_cards-aad1d69e-1823-41cc-9cb0-fac06faa77c3.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/__files/projects_columns_6706802_cards-aad1d69e-1823-41cc-9cb0-fac06faa77c3.json new file mode 100644 index 0000000000..b83285598a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/__files/projects_columns_6706802_cards-aad1d69e-1823-41cc-9cb0-fac06faa77c3.json @@ -0,0 +1,31 @@ +{ + "url": "https://api.github.com/projects/columns/cards/27353272", + "project_url": "https://api.github.com/projects/3312447", + "id": 27353272, + "node_id": "MDExOlByb2plY3RDYXJkMjczNTMyNzI=", + "note": "This is a card", + "archived": false, + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:25:08Z", + "updated_at": "2019-10-04T17:25:08Z", + "column_url": "https://api.github.com/projects/columns/6706802" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/__files/user-c2f32bbc-aa66-407b-a3e3-4533d04dd4b0.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/__files/user-c2f32bbc-aa66-407b-a3e3-4533d04dd4b0.json new file mode 100644 index 0000000000..41fc9e3d00 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/__files/user-c2f32bbc-aa66-407b-a3e3-4533d04dd4b0.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 168, + "public_gists": 4, + "followers": 136, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/orgs_github-api-test-org-2-467a39.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/orgs_github-api-test-org-2-467a39.json new file mode 100644 index 0000000000..9735900cbb --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/orgs_github-api-test-org-2-467a39.json @@ -0,0 +1,43 @@ +{ + "id": "467a3990-86b4-4c0f-9d2a-e51630e548f6", + "name": "orgs_github-api-test-org", + "request": { + "url": "/orgs/github-api-test-org", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org-467a3990-86b4-4c0f-9d2a-e51630e548f6.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:07 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4617", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"9f594020395ec69662bd8dc1ceecdc09\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FED7:6B2E:1EAC0FC:24478BC:5D978072" + } + }, + "uuid": "467a3990-86b4-4c0f-9d2a-e51630e548f6", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/orgs_github-api-test-org_projects-3-491fbb.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/orgs_github-api-test-org_projects-3-491fbb.json new file mode 100644 index 0000000000..7a6a9d21c7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/orgs_github-api-test-org_projects-3-491fbb.json @@ -0,0 +1,50 @@ +{ + "id": "491fbbf4-d8d0-433d-9ec6-162fa95ad792", + "name": "orgs_github-api-test-org_projects", + "request": { + "url": "/orgs/github-api-test-org/projects", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"test-project\",\"body\":\"This is a test project\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "orgs_github-api-test-org_projects-491fbbf4-d8d0-433d-9ec6-162fa95ad792.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:07 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4616", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"eb4cbb2bed76b2e9609e23e1b2eec231\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/3312447", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FED7:6B2E:1EAC115:2447957:5D978073" + } + }, + "uuid": "491fbbf4-d8d0-433d-9ec6-162fa95ad792", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/projects_3312447_columns-4-f80b32.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/projects_3312447_columns-4-f80b32.json new file mode 100644 index 0000000000..00601f8e79 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/projects_3312447_columns-4-f80b32.json @@ -0,0 +1,50 @@ +{ + "id": "f80b3261-cf13-4bcf-82b7-19a1425cbe78", + "name": "projects_3312447_columns", + "request": { + "url": "/projects/3312447/columns", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"column-one\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "projects_3312447_columns-f80b3261-cf13-4bcf-82b7-19a1425cbe78.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:08 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4615", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"926a8e0ba7900d031f98b6d037504662\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/columns/6706802", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FED7:6B2E:1EAC164:244799C:5D978073" + } + }, + "uuid": "f80b3261-cf13-4bcf-82b7-19a1425cbe78", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/projects_columns_6706802_cards-5-aad1d6.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/projects_columns_6706802_cards-5-aad1d6.json new file mode 100644 index 0000000000..0fc7328b04 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/projects_columns_6706802_cards-5-aad1d6.json @@ -0,0 +1,50 @@ +{ + "id": "aad1d69e-1823-41cc-9cb0-fac06faa77c3", + "name": "projects_columns_6706802_cards", + "request": { + "url": "/projects/columns/6706802/cards", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"note\":\"This is a card\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "projects_columns_6706802_cards-aad1d69e-1823-41cc-9cb0-fac06faa77c3.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:08 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4614", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"44c27a1ce11e5684b7e6315c800f2b3d\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/columns/cards/27353272", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FED7:6B2E:1EAC194:24479DE:5D978074" + } + }, + "uuid": "aad1d69e-1823-41cc-9cb0-fac06faa77c3", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/projects_columns_cards_27353272-6-e93cbd.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/projects_columns_cards_27353272-6-e93cbd.json new file mode 100644 index 0000000000..cc142c50b0 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/projects_columns_cards_27353272-6-e93cbd.json @@ -0,0 +1,35 @@ +{ + "id": "e93cbdb3-bfef-4942-864a-2dedbfee68ad", + "name": "projects_columns_cards_27353272", + "request": { + "url": "/projects/columns/cards/27353272", + "method": "DELETE" + }, + "response": { + "status": 204, + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:08 GMT", + "Server": "GitHub.com", + "Status": "204 No Content", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4613", + "X-RateLimit-Reset": "1570212957", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "Vary": "Accept-Encoding", + "X-GitHub-Request-Id": "FED7:6B2E:1EAC1C8:2447A1F:5D978074" + } + }, + "uuid": "e93cbdb3-bfef-4942-864a-2dedbfee68ad", + "persistent": true, + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/projects_columns_cards_27353272-7-a7094f.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/projects_columns_cards_27353272-7-a7094f.json new file mode 100644 index 0000000000..9a9c9eef7a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/projects_columns_cards_27353272-7-a7094f.json @@ -0,0 +1,36 @@ +{ + "id": "a7094f87-0e11-4dd6-b1ea-1dfe4db61aee", + "name": "projects_columns_cards_27353272", + "request": { + "url": "/projects/columns/cards/27353272", + "method": "GET" + }, + "response": { + "status": 404, + "body": "{\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3/projects/cards/#get-a-project-card\"}", + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:08 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "404 Not Found", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4612", + "X-RateLimit-Reset": "1570212957", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FED7:6B2E:1EAC1E9:2447A47:5D978074" + } + }, + "uuid": "a7094f87-0e11-4dd6-b1ea-1dfe4db61aee", + "persistent": true, + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/user-1-c2f32b.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/user-1-c2f32b.json new file mode 100644 index 0000000000..27af7e3a3e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testDeleteCard/mappings/user-1-c2f32b.json @@ -0,0 +1,43 @@ +{ + "id": "c2f32bbc-aa66-407b-a3e3-4533d04dd4b0", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-c2f32bbc-aa66-407b-a3e3-4533d04dd4b0.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:25:06 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4619", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FED7:6B2E:1EAC06D:2447893:5D978072" + } + }, + "uuid": "c2f32bbc-aa66-407b-a3e3-4533d04dd4b0", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/orgs_github-api-test-org-049038eb-8cc8-4480-b0e9-62a6bb55f112.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/orgs_github-api-test-org-049038eb-8cc8-4480-b0e9-62a6bb55f112.json new file mode 100644 index 0000000000..d4c06c4749 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/orgs_github-api-test-org-049038eb-8cc8-4480-b0e9-62a6bb55f112.json @@ -0,0 +1,41 @@ +{ + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/github-api-test-org", + "repos_url": "https://api.github.com/orgs/github-api-test-org/repos", + "events_url": "https://api.github.com/orgs/github-api-test-org/events", + "hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks", + "issues_url": "https://api.github.com/orgs/github-api-test-org/issues", + "members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/github-api-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 9, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/github-api-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 132, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 4, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/orgs_github-api-test-org_projects-68e871e2-343e-47b7-aa45-b613ef9f8bc0.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/orgs_github-api-test-org_projects-68e871e2-343e-47b7-aa45-b613ef9f8bc0.json new file mode 100644 index 0000000000..ad949b86df --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/orgs_github-api-test-org_projects-68e871e2-343e-47b7-aa45-b613ef9f8bc0.json @@ -0,0 +1,36 @@ +{ + "owner_url": "https://api.github.com/orgs/github-api-test-org", + "url": "https://api.github.com/projects/3312443", + "html_url": "https://github.com/orgs/github-api-test-org/projects/28", + "columns_url": "https://api.github.com/projects/3312443/columns", + "id": 3312443, + "node_id": "MDc6UHJvamVjdDMzMTI0NDM=", + "name": "test-project", + "body": "This is a test project", + "number": 28, + "state": "open", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:24:58Z", + "updated_at": "2019-10-04T17:24:58Z", + "organization_permission": "write", + "private": true +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/projects_3312443_columns-1de47f2e-9018-4a4f-9dad-0ee29614aa4e.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/projects_3312443_columns-1de47f2e-9018-4a4f-9dad-0ee29614aa4e.json new file mode 100644 index 0000000000..e9fdff9a44 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/projects_3312443_columns-1de47f2e-9018-4a4f-9dad-0ee29614aa4e.json @@ -0,0 +1,10 @@ +{ + "url": "https://api.github.com/projects/columns/6706800", + "project_url": "https://api.github.com/projects/3312443", + "cards_url": "https://api.github.com/projects/columns/6706800/cards", + "id": 6706800, + "node_id": "MDEzOlByb2plY3RDb2x1bW42NzA2ODAw", + "name": "column-one", + "created_at": "2019-10-04T17:24:58Z", + "updated_at": "2019-10-04T17:24:58Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/projects_columns_6706800_cards-695ce51a-3df9-4aea-b10d-471d3ff856b8.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/projects_columns_6706800_cards-695ce51a-3df9-4aea-b10d-471d3ff856b8.json new file mode 100644 index 0000000000..df17defa08 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/projects_columns_6706800_cards-695ce51a-3df9-4aea-b10d-471d3ff856b8.json @@ -0,0 +1,31 @@ +{ + "url": "https://api.github.com/projects/columns/cards/27353267", + "project_url": "https://api.github.com/projects/3312443", + "id": 27353267, + "node_id": "MDExOlByb2plY3RDYXJkMjczNTMyNjc=", + "note": "This is a card", + "archived": false, + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:24:59Z", + "updated_at": "2019-10-04T17:24:59Z", + "column_url": "https://api.github.com/projects/columns/6706800" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/projects_columns_cards_27353267-62a0d7cf-0c8a-4f96-8c00-c48aeaab4a6f.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/projects_columns_cards_27353267-62a0d7cf-0c8a-4f96-8c00-c48aeaab4a6f.json new file mode 100644 index 0000000000..6953abdec5 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/projects_columns_cards_27353267-62a0d7cf-0c8a-4f96-8c00-c48aeaab4a6f.json @@ -0,0 +1,31 @@ +{ + "url": "https://api.github.com/projects/columns/cards/27353267", + "project_url": "https://api.github.com/projects/3312443", + "id": 27353267, + "node_id": "MDExOlByb2plY3RDYXJkMjczNTMyNjc=", + "note": "New note", + "archived": false, + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:24:59Z", + "updated_at": "2019-10-04T17:24:59Z", + "column_url": "https://api.github.com/projects/columns/6706800" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/projects_columns_cards_27353267-93c5d233-0602-432f-a6a1-784506a19fe0.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/projects_columns_cards_27353267-93c5d233-0602-432f-a6a1-784506a19fe0.json new file mode 100644 index 0000000000..6953abdec5 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/projects_columns_cards_27353267-93c5d233-0602-432f-a6a1-784506a19fe0.json @@ -0,0 +1,31 @@ +{ + "url": "https://api.github.com/projects/columns/cards/27353267", + "project_url": "https://api.github.com/projects/3312443", + "id": 27353267, + "node_id": "MDExOlByb2plY3RDYXJkMjczNTMyNjc=", + "note": "New note", + "archived": false, + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:24:59Z", + "updated_at": "2019-10-04T17:24:59Z", + "column_url": "https://api.github.com/projects/columns/6706800" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/user-355d682a-6ab6-4af5-be72-d00bf6403051.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/user-355d682a-6ab6-4af5-be72-d00bf6403051.json new file mode 100644 index 0000000000..41fc9e3d00 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/__files/user-355d682a-6ab6-4af5-be72-d00bf6403051.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 168, + "public_gists": 4, + "followers": 136, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/orgs_github-api-test-org-2-049038.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/orgs_github-api-test-org-2-049038.json new file mode 100644 index 0000000000..31c00194ca --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/orgs_github-api-test-org-2-049038.json @@ -0,0 +1,43 @@ +{ + "id": "049038eb-8cc8-4480-b0e9-62a6bb55f112", + "name": "orgs_github-api-test-org", + "request": { + "url": "/orgs/github-api-test-org", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org-049038eb-8cc8-4480-b0e9-62a6bb55f112.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:58 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4645", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"9f594020395ec69662bd8dc1ceecdc09\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FECE:9576:937D7E:B04EA7:5D97806A" + } + }, + "uuid": "049038eb-8cc8-4480-b0e9-62a6bb55f112", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/orgs_github-api-test-org_projects-3-68e871.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/orgs_github-api-test-org_projects-3-68e871.json new file mode 100644 index 0000000000..d215b10a94 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/orgs_github-api-test-org_projects-3-68e871.json @@ -0,0 +1,50 @@ +{ + "id": "68e871e2-343e-47b7-aa45-b613ef9f8bc0", + "name": "orgs_github-api-test-org_projects", + "request": { + "url": "/orgs/github-api-test-org/projects", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"test-project\",\"body\":\"This is a test project\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "orgs_github-api-test-org_projects-68e871e2-343e-47b7-aa45-b613ef9f8bc0.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:58 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4644", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"7bb94c8c7bbddb7adf83151d48bd7acc\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/3312443", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FECE:9576:937D87:B04EB8:5D97806A" + } + }, + "uuid": "68e871e2-343e-47b7-aa45-b613ef9f8bc0", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/projects_3312443_columns-4-1de47f.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/projects_3312443_columns-4-1de47f.json new file mode 100644 index 0000000000..e80c148faa --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/projects_3312443_columns-4-1de47f.json @@ -0,0 +1,50 @@ +{ + "id": "1de47f2e-9018-4a4f-9dad-0ee29614aa4e", + "name": "projects_3312443_columns", + "request": { + "url": "/projects/3312443/columns", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"column-one\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "projects_3312443_columns-1de47f2e-9018-4a4f-9dad-0ee29614aa4e.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:59 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4643", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"3243dc01ed1b53aabad6a24f048dc99f\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/columns/6706800", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FECE:9576:937D98:B04ECA:5D97806A" + } + }, + "uuid": "1de47f2e-9018-4a4f-9dad-0ee29614aa4e", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/projects_columns_6706800_cards-5-695ce5.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/projects_columns_6706800_cards-5-695ce5.json new file mode 100644 index 0000000000..f2eb9a923e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/projects_columns_6706800_cards-5-695ce5.json @@ -0,0 +1,50 @@ +{ + "id": "695ce51a-3df9-4aea-b10d-471d3ff856b8", + "name": "projects_columns_6706800_cards", + "request": { + "url": "/projects/columns/6706800/cards", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"note\":\"This is a card\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "projects_columns_6706800_cards-695ce51a-3df9-4aea-b10d-471d3ff856b8.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:59 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4642", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"11ba043406f49747c9a9276315707b66\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/columns/cards/27353267", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FECE:9576:937DA3:B04EDA:5D97806B" + } + }, + "uuid": "695ce51a-3df9-4aea-b10d-471d3ff856b8", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/projects_columns_cards_27353267-6-62a0d7.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/projects_columns_cards_27353267-6-62a0d7.json new file mode 100644 index 0000000000..5427f1a256 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/projects_columns_cards_27353267-6-62a0d7.json @@ -0,0 +1,49 @@ +{ + "id": "62a0d7cf-0c8a-4f96-8c00-c48aeaab4a6f", + "name": "projects_columns_cards_27353267", + "request": { + "url": "/projects/columns/cards/27353267", + "method": "PATCH", + "bodyPatterns": [ + { + "equalToJson": "{\"note\":\"New note\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "projects_columns_cards_27353267-62a0d7cf-0c8a-4f96-8c00-c48aeaab4a6f.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:59 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4641", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"c7463959f008c276bc758a6de34254ef\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FECE:9576:937DB6:B04EF0:5D97806B" + } + }, + "uuid": "62a0d7cf-0c8a-4f96-8c00-c48aeaab4a6f", + "persistent": true, + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/projects_columns_cards_27353267-7-93c5d2.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/projects_columns_cards_27353267-7-93c5d2.json new file mode 100644 index 0000000000..5b1f9e23aa --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/projects_columns_cards_27353267-7-93c5d2.json @@ -0,0 +1,42 @@ +{ + "id": "93c5d233-0602-432f-a6a1-784506a19fe0", + "name": "projects_columns_cards_27353267", + "request": { + "url": "/projects/columns/cards/27353267", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "projects_columns_cards_27353267-93c5d233-0602-432f-a6a1-784506a19fe0.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:59 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4640", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"c7463959f008c276bc758a6de34254ef\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "read:org, repo", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FECE:9576:937DC4:B04F01:5D97806B" + } + }, + "uuid": "93c5d233-0602-432f-a6a1-784506a19fe0", + "persistent": true, + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/user-1-355d68.json b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/user-1-355d68.json new file mode 100644 index 0000000000..8dd76aba80 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectCardTest/wiremock/testEditCardNote/mappings/user-1-355d68.json @@ -0,0 +1,43 @@ +{ + "id": "355d682a-6ab6-4af5-be72-d00bf6403051", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-355d682a-6ab6-4af5-be72-d00bf6403051.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:58 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4647", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FECE:9576:937D70:B04E9E:5D978069" + } + }, + "uuid": "355d682a-6ab6-4af5-be72-d00bf6403051", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/__files/orgs_github-api-test-org-7feb4202-bd04-498e-a28c-fd9df44d8fc8.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/__files/orgs_github-api-test-org-7feb4202-bd04-498e-a28c-fd9df44d8fc8.json new file mode 100644 index 0000000000..d4c06c4749 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/__files/orgs_github-api-test-org-7feb4202-bd04-498e-a28c-fd9df44d8fc8.json @@ -0,0 +1,41 @@ +{ + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/github-api-test-org", + "repos_url": "https://api.github.com/orgs/github-api-test-org/repos", + "events_url": "https://api.github.com/orgs/github-api-test-org/events", + "hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks", + "issues_url": "https://api.github.com/orgs/github-api-test-org/issues", + "members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/github-api-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 9, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/github-api-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 132, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 4, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/__files/orgs_github-api-test-org_projects-42bd7d98-f969-40ce-bb9a-1586c556569d.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/__files/orgs_github-api-test-org_projects-42bd7d98-f969-40ce-bb9a-1586c556569d.json new file mode 100644 index 0000000000..2980ef61c4 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/__files/orgs_github-api-test-org_projects-42bd7d98-f969-40ce-bb9a-1586c556569d.json @@ -0,0 +1,36 @@ +{ + "owner_url": "https://api.github.com/orgs/github-api-test-org", + "url": "https://api.github.com/projects/3312440", + "html_url": "https://github.com/orgs/github-api-test-org/projects/25", + "columns_url": "https://api.github.com/projects/3312440/columns", + "id": 3312440, + "node_id": "MDc6UHJvamVjdDMzMTI0NDA=", + "name": "test-project", + "body": "This is a test project", + "number": 25, + "state": "open", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:24:27Z", + "updated_at": "2019-10-04T17:24:27Z", + "organization_permission": "write", + "private": true +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/__files/projects_3312440_columns-eb58635e-11b9-461d-8868-6ece3733f962.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/__files/projects_3312440_columns-eb58635e-11b9-461d-8868-6ece3733f962.json new file mode 100644 index 0000000000..22e165b3c3 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/__files/projects_3312440_columns-eb58635e-11b9-461d-8868-6ece3733f962.json @@ -0,0 +1,10 @@ +{ + "url": "https://api.github.com/projects/columns/6706793", + "project_url": "https://api.github.com/projects/3312440", + "cards_url": "https://api.github.com/projects/columns/6706793/cards", + "id": 6706793, + "node_id": "MDEzOlByb2plY3RDb2x1bW42NzA2Nzkz", + "name": "column-one", + "created_at": "2019-10-04T17:24:27Z", + "updated_at": "2019-10-04T17:24:27Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/__files/user-ff30f972-21ad-40ee-aa60-c006643154d2.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/__files/user-ff30f972-21ad-40ee-aa60-c006643154d2.json new file mode 100644 index 0000000000..41fc9e3d00 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/__files/user-ff30f972-21ad-40ee-aa60-c006643154d2.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 168, + "public_gists": 4, + "followers": 136, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/mappings/orgs_github-api-test-org-2-7feb42.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/mappings/orgs_github-api-test-org-2-7feb42.json new file mode 100644 index 0000000000..893c862e18 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/mappings/orgs_github-api-test-org-2-7feb42.json @@ -0,0 +1,43 @@ +{ + "id": "7feb4202-bd04-498e-a28c-fd9df44d8fc8", + "name": "orgs_github-api-test-org", + "request": { + "url": "/orgs/github-api-test-org", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org-7feb4202-bd04-498e-a28c-fd9df44d8fc8.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:26 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4675", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"9f594020395ec69662bd8dc1ceecdc09\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEBB:3620:19183A8:1E0F91F:5D97804A" + } + }, + "uuid": "7feb4202-bd04-498e-a28c-fd9df44d8fc8", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/mappings/orgs_github-api-test-org_projects-3-42bd7d.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/mappings/orgs_github-api-test-org_projects-3-42bd7d.json new file mode 100644 index 0000000000..3833763657 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/mappings/orgs_github-api-test-org_projects-3-42bd7d.json @@ -0,0 +1,50 @@ +{ + "id": "42bd7d98-f969-40ce-bb9a-1586c556569d", + "name": "orgs_github-api-test-org_projects", + "request": { + "url": "/orgs/github-api-test-org/projects", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"test-project\",\"body\":\"This is a test project\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "orgs_github-api-test-org_projects-42bd7d98-f969-40ce-bb9a-1586c556569d.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:27 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4674", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"a6900939a35440d9033eab3545193374\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/3312440", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEBB:3620:19183C0:1E0F963:5D97804A" + } + }, + "uuid": "42bd7d98-f969-40ce-bb9a-1586c556569d", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/mappings/projects_3312440_columns-4-eb5863.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/mappings/projects_3312440_columns-4-eb5863.json new file mode 100644 index 0000000000..c3871a6af5 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/mappings/projects_3312440_columns-4-eb5863.json @@ -0,0 +1,50 @@ +{ + "id": "eb58635e-11b9-461d-8868-6ece3733f962", + "name": "projects_3312440_columns", + "request": { + "url": "/projects/3312440/columns", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"column-one\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "projects_3312440_columns-eb58635e-11b9-461d-8868-6ece3733f962.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:27 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4673", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"379f6babba44d5b0f33db74b05e245cc\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/columns/6706793", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEBB:3620:19183EC:1E0F994:5D97804B" + } + }, + "uuid": "eb58635e-11b9-461d-8868-6ece3733f962", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/mappings/user-1-ff30f9.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/mappings/user-1-ff30f9.json new file mode 100644 index 0000000000..4a6ed6879c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testCreatedColumn/mappings/user-1-ff30f9.json @@ -0,0 +1,43 @@ +{ + "id": "ff30f972-21ad-40ee-aa60-c006643154d2", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-ff30f972-21ad-40ee-aa60-c006643154d2.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:26 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4677", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEBB:3620:1918377:1E0F90A:5D97804A" + } + }, + "uuid": "ff30f972-21ad-40ee-aa60-c006643154d2", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/__files/orgs_github-api-test-org-f4a0595a-a719-4b21-bf67-f12d67bac972.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/__files/orgs_github-api-test-org-f4a0595a-a719-4b21-bf67-f12d67bac972.json new file mode 100644 index 0000000000..d4c06c4749 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/__files/orgs_github-api-test-org-f4a0595a-a719-4b21-bf67-f12d67bac972.json @@ -0,0 +1,41 @@ +{ + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/github-api-test-org", + "repos_url": "https://api.github.com/orgs/github-api-test-org/repos", + "events_url": "https://api.github.com/orgs/github-api-test-org/events", + "hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks", + "issues_url": "https://api.github.com/orgs/github-api-test-org/issues", + "members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/github-api-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 9, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/github-api-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 132, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 4, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/__files/orgs_github-api-test-org_projects-bfb7de93-74a1-48dc-a74a-ba06cee9e764.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/__files/orgs_github-api-test-org_projects-bfb7de93-74a1-48dc-a74a-ba06cee9e764.json new file mode 100644 index 0000000000..a1e09d76c7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/__files/orgs_github-api-test-org_projects-bfb7de93-74a1-48dc-a74a-ba06cee9e764.json @@ -0,0 +1,36 @@ +{ + "owner_url": "https://api.github.com/orgs/github-api-test-org", + "url": "https://api.github.com/projects/3312441", + "html_url": "https://github.com/orgs/github-api-test-org/projects/26", + "columns_url": "https://api.github.com/projects/3312441/columns", + "id": 3312441, + "node_id": "MDc6UHJvamVjdDMzMTI0NDE=", + "name": "test-project", + "body": "This is a test project", + "number": 26, + "state": "open", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:24:29Z", + "updated_at": "2019-10-04T17:24:29Z", + "organization_permission": "write", + "private": true +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/__files/projects_3312441_columns-fb6e53a0-db62-4037-8f0b-3511e79bea93.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/__files/projects_3312441_columns-fb6e53a0-db62-4037-8f0b-3511e79bea93.json new file mode 100644 index 0000000000..7528c403d9 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/__files/projects_3312441_columns-fb6e53a0-db62-4037-8f0b-3511e79bea93.json @@ -0,0 +1,10 @@ +{ + "url": "https://api.github.com/projects/columns/6706794", + "project_url": "https://api.github.com/projects/3312441", + "cards_url": "https://api.github.com/projects/columns/6706794/cards", + "id": 6706794, + "node_id": "MDEzOlByb2plY3RDb2x1bW42NzA2Nzk0", + "name": "column-one", + "created_at": "2019-10-04T17:24:29Z", + "updated_at": "2019-10-04T17:24:29Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/__files/user-f818b667-7eed-4efb-9719-ea27f8d05b59.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/__files/user-f818b667-7eed-4efb-9719-ea27f8d05b59.json new file mode 100644 index 0000000000..41fc9e3d00 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/__files/user-f818b667-7eed-4efb-9719-ea27f8d05b59.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 168, + "public_gists": 4, + "followers": 136, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/orgs_github-api-test-org-2-f4a059.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/orgs_github-api-test-org-2-f4a059.json new file mode 100644 index 0000000000..da0026218e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/orgs_github-api-test-org-2-f4a059.json @@ -0,0 +1,43 @@ +{ + "id": "f4a0595a-a719-4b21-bf67-f12d67bac972", + "name": "orgs_github-api-test-org", + "request": { + "url": "/orgs/github-api-test-org", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org-f4a0595a-a719-4b21-bf67-f12d67bac972.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:28 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4666", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"9f594020395ec69662bd8dc1ceecdc09\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEBE:9576:93789E:B048D3:5D97804C" + } + }, + "uuid": "f4a0595a-a719-4b21-bf67-f12d67bac972", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/orgs_github-api-test-org_projects-3-bfb7de.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/orgs_github-api-test-org_projects-3-bfb7de.json new file mode 100644 index 0000000000..1216936c02 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/orgs_github-api-test-org_projects-3-bfb7de.json @@ -0,0 +1,50 @@ +{ + "id": "bfb7de93-74a1-48dc-a74a-ba06cee9e764", + "name": "orgs_github-api-test-org_projects", + "request": { + "url": "/orgs/github-api-test-org/projects", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"test-project\",\"body\":\"This is a test project\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "orgs_github-api-test-org_projects-bfb7de93-74a1-48dc-a74a-ba06cee9e764.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:29 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4665", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"692005a3bf5a296797a4882a89ae8d1c\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/3312441", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEBE:9576:9378A6:B048E5:5D97804C" + } + }, + "uuid": "bfb7de93-74a1-48dc-a74a-ba06cee9e764", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/projects_3312441_columns-4-fb6e53.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/projects_3312441_columns-4-fb6e53.json new file mode 100644 index 0000000000..eaf2ea3852 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/projects_3312441_columns-4-fb6e53.json @@ -0,0 +1,50 @@ +{ + "id": "fb6e53a0-db62-4037-8f0b-3511e79bea93", + "name": "projects_3312441_columns", + "request": { + "url": "/projects/3312441/columns", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"column-one\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "projects_3312441_columns-fb6e53a0-db62-4037-8f0b-3511e79bea93.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:29 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4664", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"7675060e89ea2dcb4eb492d8e0c75501\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/columns/6706794", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEBE:9576:9378BA:B048F7:5D97804D" + } + }, + "uuid": "fb6e53a0-db62-4037-8f0b-3511e79bea93", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/projects_columns_6706794-5-8c0cae.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/projects_columns_6706794-5-8c0cae.json new file mode 100644 index 0000000000..584b3b19bd --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/projects_columns_6706794-5-8c0cae.json @@ -0,0 +1,35 @@ +{ + "id": "8c0cae31-5806-43dd-8c12-bdbd7152f930", + "name": "projects_columns_6706794", + "request": { + "url": "/projects/columns/6706794", + "method": "DELETE" + }, + "response": { + "status": 204, + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:29 GMT", + "Server": "GitHub.com", + "Status": "204 No Content", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4663", + "X-RateLimit-Reset": "1570212957", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "Vary": "Accept-Encoding", + "X-GitHub-Request-Id": "FEBE:9576:9378C9:B0490B:5D97804D" + } + }, + "uuid": "8c0cae31-5806-43dd-8c12-bdbd7152f930", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/projects_columns_6706794-6-112e1e.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/projects_columns_6706794-6-112e1e.json new file mode 100644 index 0000000000..38cc8b68fa --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/projects_columns_6706794-6-112e1e.json @@ -0,0 +1,36 @@ +{ + "id": "112e1e32-4afb-43b6-8a57-f4821737ff64", + "name": "projects_columns_6706794", + "request": { + "url": "/projects/columns/6706794", + "method": "GET" + }, + "response": { + "status": 404, + "body": "{\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3/projects/columns/#get-a-project-column\"}", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:29 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "404 Not Found", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4662", + "X-RateLimit-Reset": "1570212957", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEBE:9576:9378D5:B04918:5D97804D" + } + }, + "uuid": "112e1e32-4afb-43b6-8a57-f4821737ff64", + "persistent": true, + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/user-1-f818b6.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/user-1-f818b6.json new file mode 100644 index 0000000000..202acbf907 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testDeleteColumn/mappings/user-1-f818b6.json @@ -0,0 +1,43 @@ +{ + "id": "f818b667-7eed-4efb-9719-ea27f8d05b59", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-f818b667-7eed-4efb-9719-ea27f8d05b59.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:28 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4668", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEBE:9576:937891:B048CB:5D97804C" + } + }, + "uuid": "f818b667-7eed-4efb-9719-ea27f8d05b59", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/orgs_github-api-test-org-eb0425ef-7f2e-4b3a-a7f7-53cef5d5647b.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/orgs_github-api-test-org-eb0425ef-7f2e-4b3a-a7f7-53cef5d5647b.json new file mode 100644 index 0000000000..d4c06c4749 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/orgs_github-api-test-org-eb0425ef-7f2e-4b3a-a7f7-53cef5d5647b.json @@ -0,0 +1,41 @@ +{ + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/github-api-test-org", + "repos_url": "https://api.github.com/orgs/github-api-test-org/repos", + "events_url": "https://api.github.com/orgs/github-api-test-org/events", + "hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks", + "issues_url": "https://api.github.com/orgs/github-api-test-org/issues", + "members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/github-api-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 9, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/github-api-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 132, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 4, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/orgs_github-api-test-org_projects-97b70b32-45f4-419f-87d0-f15a2c004196.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/orgs_github-api-test-org_projects-97b70b32-45f4-419f-87d0-f15a2c004196.json new file mode 100644 index 0000000000..507b233b38 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/orgs_github-api-test-org_projects-97b70b32-45f4-419f-87d0-f15a2c004196.json @@ -0,0 +1,36 @@ +{ + "owner_url": "https://api.github.com/orgs/github-api-test-org", + "url": "https://api.github.com/projects/3312439", + "html_url": "https://github.com/orgs/github-api-test-org/projects/24", + "columns_url": "https://api.github.com/projects/3312439/columns", + "id": 3312439, + "node_id": "MDc6UHJvamVjdDMzMTI0Mzk=", + "name": "test-project", + "body": "This is a test project", + "number": 24, + "state": "open", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:24:24Z", + "updated_at": "2019-10-04T17:24:24Z", + "organization_permission": "write", + "private": true +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/projects_3312439_columns-082ed3d1-bea6-48fc-8e61-a63c4d0db977.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/projects_3312439_columns-082ed3d1-bea6-48fc-8e61-a63c4d0db977.json new file mode 100644 index 0000000000..209b7f26b2 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/projects_3312439_columns-082ed3d1-bea6-48fc-8e61-a63c4d0db977.json @@ -0,0 +1,10 @@ +{ + "url": "https://api.github.com/projects/columns/6706791", + "project_url": "https://api.github.com/projects/3312439", + "cards_url": "https://api.github.com/projects/columns/6706791/cards", + "id": 6706791, + "node_id": "MDEzOlByb2plY3RDb2x1bW42NzA2Nzkx", + "name": "column-one", + "created_at": "2019-10-04T17:24:24Z", + "updated_at": "2019-10-04T17:24:24Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/projects_columns_6706791-1cfa5ddf-74f4-4a95-aaf2-c8149c7d1c17.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/projects_columns_6706791-1cfa5ddf-74f4-4a95-aaf2-c8149c7d1c17.json new file mode 100644 index 0000000000..3e2dc10d56 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/projects_columns_6706791-1cfa5ddf-74f4-4a95-aaf2-c8149c7d1c17.json @@ -0,0 +1,10 @@ +{ + "url": "https://api.github.com/projects/columns/6706791", + "project_url": "https://api.github.com/projects/3312439", + "cards_url": "https://api.github.com/projects/columns/6706791/cards", + "id": 6706791, + "node_id": "MDEzOlByb2plY3RDb2x1bW42NzA2Nzkx", + "name": "new-name", + "created_at": "2019-10-04T17:24:24Z", + "updated_at": "2019-10-04T17:24:24Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/projects_columns_6706791-85f35660-6579-4bea-af53-b636239dd5cd.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/projects_columns_6706791-85f35660-6579-4bea-af53-b636239dd5cd.json new file mode 100644 index 0000000000..3e2dc10d56 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/projects_columns_6706791-85f35660-6579-4bea-af53-b636239dd5cd.json @@ -0,0 +1,10 @@ +{ + "url": "https://api.github.com/projects/columns/6706791", + "project_url": "https://api.github.com/projects/3312439", + "cards_url": "https://api.github.com/projects/columns/6706791/cards", + "id": 6706791, + "node_id": "MDEzOlByb2plY3RDb2x1bW42NzA2Nzkx", + "name": "new-name", + "created_at": "2019-10-04T17:24:24Z", + "updated_at": "2019-10-04T17:24:24Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/user-e21e45b0-f34c-473e-9454-cb601fb759b9.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/user-e21e45b0-f34c-473e-9454-cb601fb759b9.json new file mode 100644 index 0000000000..41fc9e3d00 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/__files/user-e21e45b0-f34c-473e-9454-cb601fb759b9.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 168, + "public_gists": 4, + "followers": 136, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/orgs_github-api-test-org-2-eb0425.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/orgs_github-api-test-org-2-eb0425.json new file mode 100644 index 0000000000..fa0784bc99 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/orgs_github-api-test-org-2-eb0425.json @@ -0,0 +1,43 @@ +{ + "id": "eb0425ef-7f2e-4b3a-a7f7-53cef5d5647b", + "name": "orgs_github-api-test-org", + "request": { + "url": "/orgs/github-api-test-org", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org-eb0425ef-7f2e-4b3a-a7f7-53cef5d5647b.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:23 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4686", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"9f594020395ec69662bd8dc1ceecdc09\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEB6:2CE8:1B9CD3A:21106FC:5D978047" + } + }, + "uuid": "eb0425ef-7f2e-4b3a-a7f7-53cef5d5647b", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/orgs_github-api-test-org_projects-3-97b70b.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/orgs_github-api-test-org_projects-3-97b70b.json new file mode 100644 index 0000000000..5fab2bdbd6 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/orgs_github-api-test-org_projects-3-97b70b.json @@ -0,0 +1,50 @@ +{ + "id": "97b70b32-45f4-419f-87d0-f15a2c004196", + "name": "orgs_github-api-test-org_projects", + "request": { + "url": "/orgs/github-api-test-org/projects", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"test-project\",\"body\":\"This is a test project\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "orgs_github-api-test-org_projects-97b70b32-45f4-419f-87d0-f15a2c004196.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:24 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4685", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"040d8b7f5c015e1b70de188f5f75a2dd\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/3312439", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEB6:2CE8:1B9CD54:2110760:5D978047" + } + }, + "uuid": "97b70b32-45f4-419f-87d0-f15a2c004196", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/projects_3312439_columns-4-082ed3.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/projects_3312439_columns-4-082ed3.json new file mode 100644 index 0000000000..a3d2b0a97a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/projects_3312439_columns-4-082ed3.json @@ -0,0 +1,50 @@ +{ + "id": "082ed3d1-bea6-48fc-8e61-a63c4d0db977", + "name": "projects_3312439_columns", + "request": { + "url": "/projects/3312439/columns", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"column-one\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "projects_3312439_columns-082ed3d1-bea6-48fc-8e61-a63c4d0db977.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:24 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4684", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"4a9022ef010ae8a2bbc6ec155fca2f9b\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/columns/6706791", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEB6:2CE8:1B9CD9B:211079F:5D978048" + } + }, + "uuid": "082ed3d1-bea6-48fc-8e61-a63c4d0db977", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/projects_columns_6706791-5-85f356.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/projects_columns_6706791-5-85f356.json new file mode 100644 index 0000000000..5846403999 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/projects_columns_6706791-5-85f356.json @@ -0,0 +1,49 @@ +{ + "id": "85f35660-6579-4bea-af53-b636239dd5cd", + "name": "projects_columns_6706791", + "request": { + "url": "/projects/columns/6706791", + "method": "PATCH", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"new-name\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "projects_columns_6706791-85f35660-6579-4bea-af53-b636239dd5cd.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:25 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4683", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"df1e321ce6b9b1cfb88f5947bff72393\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEB6:2CE8:1B9CDD9:21107DA:5D978048" + } + }, + "uuid": "85f35660-6579-4bea-af53-b636239dd5cd", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/projects_columns_6706791-6-1cfa5d.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/projects_columns_6706791-6-1cfa5d.json new file mode 100644 index 0000000000..62ecacd745 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/projects_columns_6706791-6-1cfa5d.json @@ -0,0 +1,42 @@ +{ + "id": "1cfa5ddf-74f4-4a95-aaf2-c8149c7d1c17", + "name": "projects_columns_6706791", + "request": { + "url": "/projects/columns/6706791", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "projects_columns_6706791-1cfa5ddf-74f4-4a95-aaf2-c8149c7d1c17.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:25 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4682", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"df1e321ce6b9b1cfb88f5947bff72393\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "read:org, repo", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEB6:2CE8:1B9CE06:211081E:5D978049" + } + }, + "uuid": "1cfa5ddf-74f4-4a95-aaf2-c8149c7d1c17", + "persistent": true, + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/user-1-e21e45.json b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/user-1-e21e45.json new file mode 100644 index 0000000000..5dc3ad3500 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectColumnTest/wiremock/testEditColumnName/mappings/user-1-e21e45.json @@ -0,0 +1,43 @@ +{ + "id": "e21e45b0-f34c-473e-9454-cb601fb759b9", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-e21e45b0-f34c-473e-9454-cb601fb759b9.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:24:23 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4688", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEB6:2CE8:1B9CCEE:21106E7:5D978047" + } + }, + "uuid": "e21e45b0-f34c-473e-9454-cb601fb759b9", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/__files/orgs_github-api-test-org-713f01eb-4f07-4f02-89fe-e7560ed08e11.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/__files/orgs_github-api-test-org-713f01eb-4f07-4f02-89fe-e7560ed08e11.json new file mode 100644 index 0000000000..d4c06c4749 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/__files/orgs_github-api-test-org-713f01eb-4f07-4f02-89fe-e7560ed08e11.json @@ -0,0 +1,41 @@ +{ + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/github-api-test-org", + "repos_url": "https://api.github.com/orgs/github-api-test-org/repos", + "events_url": "https://api.github.com/orgs/github-api-test-org/events", + "hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks", + "issues_url": "https://api.github.com/orgs/github-api-test-org/issues", + "members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/github-api-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 9, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/github-api-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 132, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 4, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/__files/orgs_github-api-test-org_projects-e5afd90e-d2ac-4e83-800d-a680bc27c9ed.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/__files/orgs_github-api-test-org_projects-e5afd90e-d2ac-4e83-800d-a680bc27c9ed.json new file mode 100644 index 0000000000..a3a9d1fe7d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/__files/orgs_github-api-test-org_projects-e5afd90e-d2ac-4e83-800d-a680bc27c9ed.json @@ -0,0 +1,36 @@ +{ + "owner_url": "https://api.github.com/orgs/github-api-test-org", + "url": "https://api.github.com/projects/3312432", + "html_url": "https://github.com/orgs/github-api-test-org/projects/19", + "columns_url": "https://api.github.com/projects/3312432/columns", + "id": 3312432, + "node_id": "MDc6UHJvamVjdDMzMTI0MzI=", + "name": "test-project", + "body": "This is a test project", + "number": 19, + "state": "open", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:23:22Z", + "updated_at": "2019-10-04T17:23:22Z", + "organization_permission": "write", + "private": true +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/__files/user-a9a3d26a-4c87-4ebf-9609-48b2120173b7.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/__files/user-a9a3d26a-4c87-4ebf-9609-48b2120173b7.json new file mode 100644 index 0000000000..41fc9e3d00 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/__files/user-a9a3d26a-4c87-4ebf-9609-48b2120173b7.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 168, + "public_gists": 4, + "followers": 136, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/mappings/orgs_github-api-test-org-2-713f01.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/mappings/orgs_github-api-test-org-2-713f01.json new file mode 100644 index 0000000000..2454d7a0d4 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/mappings/orgs_github-api-test-org-2-713f01.json @@ -0,0 +1,43 @@ +{ + "id": "713f01eb-4f07-4f02-89fe-e7560ed08e11", + "name": "orgs_github-api-test-org", + "request": { + "url": "/orgs/github-api-test-org", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org-713f01eb-4f07-4f02-89fe-e7560ed08e11.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:22 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4722", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"9f594020395ec69662bd8dc1ceecdc09\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FE9F:3C98:18F214:1DE2D7:5D978009" + } + }, + "uuid": "713f01eb-4f07-4f02-89fe-e7560ed08e11", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/mappings/orgs_github-api-test-org_projects-3-e5afd9.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/mappings/orgs_github-api-test-org_projects-3-e5afd9.json new file mode 100644 index 0000000000..129aaf9ccc --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/mappings/orgs_github-api-test-org_projects-3-e5afd9.json @@ -0,0 +1,50 @@ +{ + "id": "e5afd90e-d2ac-4e83-800d-a680bc27c9ed", + "name": "orgs_github-api-test-org_projects", + "request": { + "url": "/orgs/github-api-test-org/projects", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"test-project\",\"body\":\"This is a test project\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "orgs_github-api-test-org_projects-e5afd90e-d2ac-4e83-800d-a680bc27c9ed.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:22 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4721", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"7a699861cb77bfa34b007afda4f83f36\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/3312432", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FE9F:3C98:18F216:1DE2DD:5D97800A" + } + }, + "uuid": "e5afd90e-d2ac-4e83-800d-a680bc27c9ed", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/mappings/user-1-a9a3d2.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/mappings/user-1-a9a3d2.json new file mode 100644 index 0000000000..b3dfd009c0 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testCreatedProject/mappings/user-1-a9a3d2.json @@ -0,0 +1,43 @@ +{ + "id": "a9a3d26a-4c87-4ebf-9609-48b2120173b7", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-a9a3d26a-4c87-4ebf-9609-48b2120173b7.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:21 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4724", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FE9F:3C98:18F210:1DE2D5:5D978009" + } + }, + "uuid": "a9a3d26a-4c87-4ebf-9609-48b2120173b7", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/__files/orgs_github-api-test-org-c3024047-fc8f-443f-a2b4-810324f889b4.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/__files/orgs_github-api-test-org-c3024047-fc8f-443f-a2b4-810324f889b4.json new file mode 100644 index 0000000000..d4c06c4749 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/__files/orgs_github-api-test-org-c3024047-fc8f-443f-a2b4-810324f889b4.json @@ -0,0 +1,41 @@ +{ + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/github-api-test-org", + "repos_url": "https://api.github.com/orgs/github-api-test-org/repos", + "events_url": "https://api.github.com/orgs/github-api-test-org/events", + "hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks", + "issues_url": "https://api.github.com/orgs/github-api-test-org/issues", + "members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/github-api-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 9, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/github-api-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 132, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 4, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/__files/orgs_github-api-test-org_projects-daa6c228-6e0f-4398-a6d2-2d114f986e93.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/__files/orgs_github-api-test-org_projects-daa6c228-6e0f-4398-a6d2-2d114f986e93.json new file mode 100644 index 0000000000..efbd7e59ec --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/__files/orgs_github-api-test-org_projects-daa6c228-6e0f-4398-a6d2-2d114f986e93.json @@ -0,0 +1,36 @@ +{ + "owner_url": "https://api.github.com/orgs/github-api-test-org", + "url": "https://api.github.com/projects/3312437", + "html_url": "https://github.com/orgs/github-api-test-org/projects/23", + "columns_url": "https://api.github.com/projects/3312437/columns", + "id": 3312437, + "node_id": "MDc6UHJvamVjdDMzMTI0Mzc=", + "name": "test-project", + "body": "This is a test project", + "number": 23, + "state": "open", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:23:30Z", + "updated_at": "2019-10-04T17:23:30Z", + "organization_permission": "write", + "private": true +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/__files/user-9cb86722-7ae5-46b2-8598-59567e17ed99.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/__files/user-9cb86722-7ae5-46b2-8598-59567e17ed99.json new file mode 100644 index 0000000000..41fc9e3d00 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/__files/user-9cb86722-7ae5-46b2-8598-59567e17ed99.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 168, + "public_gists": 4, + "followers": 136, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/mappings/orgs_github-api-test-org-2-c30240.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/mappings/orgs_github-api-test-org-2-c30240.json new file mode 100644 index 0000000000..8545d3aeb5 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/mappings/orgs_github-api-test-org-2-c30240.json @@ -0,0 +1,43 @@ +{ + "id": "c3024047-fc8f-443f-a2b4-810324f889b4", + "name": "orgs_github-api-test-org", + "request": { + "url": "/orgs/github-api-test-org", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org-c3024047-fc8f-443f-a2b4-810324f889b4.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:30 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4692", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"9f594020395ec69662bd8dc1ceecdc09\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEAD:2CE8:1B9B385:210E7E0:5D978011" + } + }, + "uuid": "c3024047-fc8f-443f-a2b4-810324f889b4", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/mappings/orgs_github-api-test-org_projects-3-daa6c2.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/mappings/orgs_github-api-test-org_projects-3-daa6c2.json new file mode 100644 index 0000000000..a050ecb4fc --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/mappings/orgs_github-api-test-org_projects-3-daa6c2.json @@ -0,0 +1,50 @@ +{ + "id": "daa6c228-6e0f-4398-a6d2-2d114f986e93", + "name": "orgs_github-api-test-org_projects", + "request": { + "url": "/orgs/github-api-test-org/projects", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"test-project\",\"body\":\"This is a test project\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "orgs_github-api-test-org_projects-daa6c228-6e0f-4398-a6d2-2d114f986e93.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:30 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4691", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"4f5ec06b3157c88d6acf342c8db21aac\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/3312437", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEAD:2CE8:1B9B397:210E837:5D978012" + } + }, + "uuid": "daa6c228-6e0f-4398-a6d2-2d114f986e93", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/mappings/projects_3312437-4-f50762.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/mappings/projects_3312437-4-f50762.json new file mode 100644 index 0000000000..3fa4a50934 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/mappings/projects_3312437-4-f50762.json @@ -0,0 +1,35 @@ +{ + "id": "f507621b-4b4d-497d-81aa-d83b31b7dd52", + "name": "projects_3312437", + "request": { + "url": "/projects/3312437", + "method": "DELETE" + }, + "response": { + "status": 204, + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:30 GMT", + "Server": "GitHub.com", + "Status": "204 No Content", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4690", + "X-RateLimit-Reset": "1570212957", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "Vary": "Accept-Encoding", + "X-GitHub-Request-Id": "FEAD:2CE8:1B9B3B2:210E85D:5D978012" + } + }, + "uuid": "f507621b-4b4d-497d-81aa-d83b31b7dd52", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/mappings/projects_3312437-5-8b8e6f.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/mappings/projects_3312437-5-8b8e6f.json new file mode 100644 index 0000000000..153985433e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/mappings/projects_3312437-5-8b8e6f.json @@ -0,0 +1,36 @@ +{ + "id": "8b8e6f75-2c0e-497e-8205-449e17e078e6", + "name": "projects_3312437", + "request": { + "url": "/projects/3312437", + "method": "GET" + }, + "response": { + "status": 404, + "body": "{\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3/projects/#get-a-project\"}", + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:30 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "404 Not Found", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4689", + "X-RateLimit-Reset": "1570212957", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEAD:2CE8:1B9B3CD:210E87D:5D978012" + } + }, + "uuid": "8b8e6f75-2c0e-497e-8205-449e17e078e6", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/mappings/user-1-9cb867.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/mappings/user-1-9cb867.json new file mode 100644 index 0000000000..295beaf4cc --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testDeleteProject/mappings/user-1-9cb867.json @@ -0,0 +1,43 @@ +{ + "id": "9cb86722-7ae5-46b2-8598-59567e17ed99", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-9cb86722-7ae5-46b2-8598-59567e17ed99.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:29 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4694", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEAD:2CE8:1B9B347:210E7D7:5D978011" + } + }, + "uuid": "9cb86722-7ae5-46b2-8598-59567e17ed99", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/__files/orgs_github-api-test-org-2e39c772-c889-44d1-bf15-5248ad194202.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/__files/orgs_github-api-test-org-2e39c772-c889-44d1-bf15-5248ad194202.json new file mode 100644 index 0000000000..d4c06c4749 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/__files/orgs_github-api-test-org-2e39c772-c889-44d1-bf15-5248ad194202.json @@ -0,0 +1,41 @@ +{ + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/github-api-test-org", + "repos_url": "https://api.github.com/orgs/github-api-test-org/repos", + "events_url": "https://api.github.com/orgs/github-api-test-org/events", + "hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks", + "issues_url": "https://api.github.com/orgs/github-api-test-org/issues", + "members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/github-api-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 9, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/github-api-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 132, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 4, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/__files/orgs_github-api-test-org_projects-08231b0e-288f-49fa-aa2b-9456449d2cfd.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/__files/orgs_github-api-test-org_projects-08231b0e-288f-49fa-aa2b-9456449d2cfd.json new file mode 100644 index 0000000000..075cd0b2d2 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/__files/orgs_github-api-test-org_projects-08231b0e-288f-49fa-aa2b-9456449d2cfd.json @@ -0,0 +1,36 @@ +{ + "owner_url": "https://api.github.com/orgs/github-api-test-org", + "url": "https://api.github.com/projects/3312435", + "html_url": "https://github.com/orgs/github-api-test-org/projects/21", + "columns_url": "https://api.github.com/projects/3312435/columns", + "id": 3312435, + "node_id": "MDc6UHJvamVjdDMzMTI0MzU=", + "name": "test-project", + "body": "This is a test project", + "number": 21, + "state": "open", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:23:26Z", + "updated_at": "2019-10-04T17:23:26Z", + "organization_permission": "write", + "private": true +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/__files/projects_3312435-004d3495-63b2-40e7-a864-10d175a59756.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/__files/projects_3312435-004d3495-63b2-40e7-a864-10d175a59756.json new file mode 100644 index 0000000000..6846aae104 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/__files/projects_3312435-004d3495-63b2-40e7-a864-10d175a59756.json @@ -0,0 +1,36 @@ +{ + "owner_url": "https://api.github.com/orgs/github-api-test-org", + "url": "https://api.github.com/projects/3312435", + "html_url": "https://github.com/orgs/github-api-test-org/projects/21", + "columns_url": "https://api.github.com/projects/3312435/columns", + "id": 3312435, + "node_id": "MDc6UHJvamVjdDMzMTI0MzU=", + "name": "test-project", + "body": "New body", + "number": 21, + "state": "open", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:23:26Z", + "updated_at": "2019-10-04T17:23:27Z", + "organization_permission": "write", + "private": true +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/__files/projects_3312435-76e0c251-b1df-4f18-8a01-77a7bbc15474.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/__files/projects_3312435-76e0c251-b1df-4f18-8a01-77a7bbc15474.json new file mode 100644 index 0000000000..6846aae104 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/__files/projects_3312435-76e0c251-b1df-4f18-8a01-77a7bbc15474.json @@ -0,0 +1,36 @@ +{ + "owner_url": "https://api.github.com/orgs/github-api-test-org", + "url": "https://api.github.com/projects/3312435", + "html_url": "https://github.com/orgs/github-api-test-org/projects/21", + "columns_url": "https://api.github.com/projects/3312435/columns", + "id": 3312435, + "node_id": "MDc6UHJvamVjdDMzMTI0MzU=", + "name": "test-project", + "body": "New body", + "number": 21, + "state": "open", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:23:26Z", + "updated_at": "2019-10-04T17:23:27Z", + "organization_permission": "write", + "private": true +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/__files/user-b2b1262a-1678-4080-af72-92346bb25688.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/__files/user-b2b1262a-1678-4080-af72-92346bb25688.json new file mode 100644 index 0000000000..41fc9e3d00 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/__files/user-b2b1262a-1678-4080-af72-92346bb25688.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 168, + "public_gists": 4, + "followers": 136, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/mappings/orgs_github-api-test-org-2-2e39c7.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/mappings/orgs_github-api-test-org-2-2e39c7.json new file mode 100644 index 0000000000..a555125903 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/mappings/orgs_github-api-test-org-2-2e39c7.json @@ -0,0 +1,43 @@ +{ + "id": "2e39c772-c889-44d1-bf15-5248ad194202", + "name": "orgs_github-api-test-org", + "request": { + "url": "/orgs/github-api-test-org", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org-2e39c772-c889-44d1-bf15-5248ad194202.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:26 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4708", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"9f594020395ec69662bd8dc1ceecdc09\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEA7:361A:4A1417:584BFC:5D97800D" + } + }, + "uuid": "2e39c772-c889-44d1-bf15-5248ad194202", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/mappings/orgs_github-api-test-org_projects-3-08231b.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/mappings/orgs_github-api-test-org_projects-3-08231b.json new file mode 100644 index 0000000000..fb3952ed82 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/mappings/orgs_github-api-test-org_projects-3-08231b.json @@ -0,0 +1,50 @@ +{ + "id": "08231b0e-288f-49fa-aa2b-9456449d2cfd", + "name": "orgs_github-api-test-org_projects", + "request": { + "url": "/orgs/github-api-test-org/projects", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"test-project\",\"body\":\"This is a test project\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "orgs_github-api-test-org_projects-08231b0e-288f-49fa-aa2b-9456449d2cfd.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:26 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4707", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"cefe753176c197026b78819a457c18a0\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/3312435", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEA7:361A:4A1420:584C06:5D97800E" + } + }, + "uuid": "08231b0e-288f-49fa-aa2b-9456449d2cfd", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/mappings/projects_3312435-4-004d34.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/mappings/projects_3312435-4-004d34.json new file mode 100644 index 0000000000..572b539405 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/mappings/projects_3312435-4-004d34.json @@ -0,0 +1,49 @@ +{ + "id": "004d3495-63b2-40e7-a864-10d175a59756", + "name": "projects_3312435", + "request": { + "url": "/projects/3312435", + "method": "PATCH", + "bodyPatterns": [ + { + "equalToJson": "{\"body\":\"New body\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "projects_3312435-004d3495-63b2-40e7-a864-10d175a59756.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:27 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4706", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"69232fc55193c550101d07bd6b082586\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEA7:361A:4A1426:584C0F:5D97800E" + } + }, + "uuid": "004d3495-63b2-40e7-a864-10d175a59756", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/mappings/projects_3312435-5-76e0c2.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/mappings/projects_3312435-5-76e0c2.json new file mode 100644 index 0000000000..e38f6c946f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/mappings/projects_3312435-5-76e0c2.json @@ -0,0 +1,42 @@ +{ + "id": "76e0c251-b1df-4f18-8a01-77a7bbc15474", + "name": "projects_3312435", + "request": { + "url": "/projects/3312435", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "projects_3312435-76e0c251-b1df-4f18-8a01-77a7bbc15474.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:27 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4705", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"69232fc55193c550101d07bd6b082586\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "read:org, repo", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEA7:361A:4A142A:584C14:5D97800F" + } + }, + "uuid": "76e0c251-b1df-4f18-8a01-77a7bbc15474", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/mappings/user-1-b2b126.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/mappings/user-1-b2b126.json new file mode 100644 index 0000000000..6b0dc73389 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectBody/mappings/user-1-b2b126.json @@ -0,0 +1,43 @@ +{ + "id": "b2b1262a-1678-4080-af72-92346bb25688", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-b2b1262a-1678-4080-af72-92346bb25688.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:25 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4710", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEA7:361A:4A1410:584BF6:5D97800D" + } + }, + "uuid": "b2b1262a-1678-4080-af72-92346bb25688", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/__files/orgs_github-api-test-org-e3d87fca-b817-4dfb-b80f-99eebaabba08.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/__files/orgs_github-api-test-org-e3d87fca-b817-4dfb-b80f-99eebaabba08.json new file mode 100644 index 0000000000..d4c06c4749 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/__files/orgs_github-api-test-org-e3d87fca-b817-4dfb-b80f-99eebaabba08.json @@ -0,0 +1,41 @@ +{ + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/github-api-test-org", + "repos_url": "https://api.github.com/orgs/github-api-test-org/repos", + "events_url": "https://api.github.com/orgs/github-api-test-org/events", + "hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks", + "issues_url": "https://api.github.com/orgs/github-api-test-org/issues", + "members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/github-api-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 9, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/github-api-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 132, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 4, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/__files/orgs_github-api-test-org_projects-6a0a4669-8d74-4fa9-92c0-0fa428078637.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/__files/orgs_github-api-test-org_projects-6a0a4669-8d74-4fa9-92c0-0fa428078637.json new file mode 100644 index 0000000000..86e3e10d03 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/__files/orgs_github-api-test-org_projects-6a0a4669-8d74-4fa9-92c0-0fa428078637.json @@ -0,0 +1,36 @@ +{ + "owner_url": "https://api.github.com/orgs/github-api-test-org", + "url": "https://api.github.com/projects/3312436", + "html_url": "https://github.com/orgs/github-api-test-org/projects/22", + "columns_url": "https://api.github.com/projects/3312436/columns", + "id": 3312436, + "node_id": "MDc6UHJvamVjdDMzMTI0MzY=", + "name": "test-project", + "body": "This is a test project", + "number": 22, + "state": "open", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:23:28Z", + "updated_at": "2019-10-04T17:23:28Z", + "organization_permission": "write", + "private": true +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/__files/projects_3312436-20ac7f07-9e2b-47dd-801c-67974592a3b9.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/__files/projects_3312436-20ac7f07-9e2b-47dd-801c-67974592a3b9.json new file mode 100644 index 0000000000..cef9f73207 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/__files/projects_3312436-20ac7f07-9e2b-47dd-801c-67974592a3b9.json @@ -0,0 +1,36 @@ +{ + "owner_url": "https://api.github.com/orgs/github-api-test-org", + "url": "https://api.github.com/projects/3312436", + "html_url": "https://github.com/orgs/github-api-test-org/projects/22", + "columns_url": "https://api.github.com/projects/3312436/columns", + "id": 3312436, + "node_id": "MDc6UHJvamVjdDMzMTI0MzY=", + "name": "new-name", + "body": "This is a test project", + "number": 22, + "state": "open", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:23:28Z", + "updated_at": "2019-10-04T17:23:28Z", + "organization_permission": "write", + "private": true +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/__files/projects_3312436-6c28d544-7193-4c9d-93a8-5c4bd20af717.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/__files/projects_3312436-6c28d544-7193-4c9d-93a8-5c4bd20af717.json new file mode 100644 index 0000000000..cef9f73207 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/__files/projects_3312436-6c28d544-7193-4c9d-93a8-5c4bd20af717.json @@ -0,0 +1,36 @@ +{ + "owner_url": "https://api.github.com/orgs/github-api-test-org", + "url": "https://api.github.com/projects/3312436", + "html_url": "https://github.com/orgs/github-api-test-org/projects/22", + "columns_url": "https://api.github.com/projects/3312436/columns", + "id": 3312436, + "node_id": "MDc6UHJvamVjdDMzMTI0MzY=", + "name": "new-name", + "body": "This is a test project", + "number": 22, + "state": "open", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:23:28Z", + "updated_at": "2019-10-04T17:23:28Z", + "organization_permission": "write", + "private": true +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/__files/user-115e6194-ffb3-4129-8f7b-ad60f5fff91a.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/__files/user-115e6194-ffb3-4129-8f7b-ad60f5fff91a.json new file mode 100644 index 0000000000..41fc9e3d00 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/__files/user-115e6194-ffb3-4129-8f7b-ad60f5fff91a.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 168, + "public_gists": 4, + "followers": 136, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/mappings/orgs_github-api-test-org-2-e3d87f.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/mappings/orgs_github-api-test-org-2-e3d87f.json new file mode 100644 index 0000000000..1bf181fada --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/mappings/orgs_github-api-test-org-2-e3d87f.json @@ -0,0 +1,43 @@ +{ + "id": "e3d87fca-b817-4dfb-b80f-99eebaabba08", + "name": "orgs_github-api-test-org", + "request": { + "url": "/orgs/github-api-test-org", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org-e3d87fca-b817-4dfb-b80f-99eebaabba08.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:28 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4700", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"9f594020395ec69662bd8dc1ceecdc09\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEAA:3C9F:14C0B0D:18C5092:5D978010" + } + }, + "uuid": "e3d87fca-b817-4dfb-b80f-99eebaabba08", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/mappings/orgs_github-api-test-org_projects-3-6a0a46.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/mappings/orgs_github-api-test-org_projects-3-6a0a46.json new file mode 100644 index 0000000000..daf6f6b784 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/mappings/orgs_github-api-test-org_projects-3-6a0a46.json @@ -0,0 +1,50 @@ +{ + "id": "6a0a4669-8d74-4fa9-92c0-0fa428078637", + "name": "orgs_github-api-test-org_projects", + "request": { + "url": "/orgs/github-api-test-org/projects", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"test-project\",\"body\":\"This is a test project\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "orgs_github-api-test-org_projects-6a0a4669-8d74-4fa9-92c0-0fa428078637.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:28 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4699", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"ae3e206fe50efc5382388a0f1243289c\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/3312436", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEAA:3C9F:14C0B1E:18C50B1:5D978010" + } + }, + "uuid": "6a0a4669-8d74-4fa9-92c0-0fa428078637", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/mappings/projects_3312436-4-20ac7f.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/mappings/projects_3312436-4-20ac7f.json new file mode 100644 index 0000000000..b9e9ce56c0 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/mappings/projects_3312436-4-20ac7f.json @@ -0,0 +1,49 @@ +{ + "id": "20ac7f07-9e2b-47dd-801c-67974592a3b9", + "name": "projects_3312436", + "request": { + "url": "/projects/3312436", + "method": "PATCH", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"new-name\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "projects_3312436-20ac7f07-9e2b-47dd-801c-67974592a3b9.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:28 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4698", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"4bae2d84036567575958f036df372cf7\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEAA:3C9F:14C0B39:18C50D0:5D978010" + } + }, + "uuid": "20ac7f07-9e2b-47dd-801c-67974592a3b9", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/mappings/projects_3312436-5-6c28d5.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/mappings/projects_3312436-5-6c28d5.json new file mode 100644 index 0000000000..2c034bbf21 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/mappings/projects_3312436-5-6c28d5.json @@ -0,0 +1,42 @@ +{ + "id": "6c28d544-7193-4c9d-93a8-5c4bd20af717", + "name": "projects_3312436", + "request": { + "url": "/projects/3312436", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "projects_3312436-6c28d544-7193-4c9d-93a8-5c4bd20af717.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:29 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4697", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"4bae2d84036567575958f036df372cf7\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "read:org, repo", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEAA:3C9F:14C0B58:18C50EB:5D978010" + } + }, + "uuid": "6c28d544-7193-4c9d-93a8-5c4bd20af717", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/mappings/user-1-115e61.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/mappings/user-1-115e61.json new file mode 100644 index 0000000000..850a7eaa6c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectName/mappings/user-1-115e61.json @@ -0,0 +1,43 @@ +{ + "id": "115e6194-ffb3-4129-8f7b-ad60f5fff91a", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-115e6194-ffb3-4129-8f7b-ad60f5fff91a.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:28 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4702", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEAA:3C9F:14C0AFE:18C5088:5D97800F" + } + }, + "uuid": "115e6194-ffb3-4129-8f7b-ad60f5fff91a", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/__files/orgs_github-api-test-org-a522b55e-f089-4a29-a55e-33f0744eca1a.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/__files/orgs_github-api-test-org-a522b55e-f089-4a29-a55e-33f0744eca1a.json new file mode 100644 index 0000000000..d4c06c4749 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/__files/orgs_github-api-test-org-a522b55e-f089-4a29-a55e-33f0744eca1a.json @@ -0,0 +1,41 @@ +{ + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/github-api-test-org", + "repos_url": "https://api.github.com/orgs/github-api-test-org/repos", + "events_url": "https://api.github.com/orgs/github-api-test-org/events", + "hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks", + "issues_url": "https://api.github.com/orgs/github-api-test-org/issues", + "members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/github-api-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 9, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/github-api-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 132, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 4, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/__files/orgs_github-api-test-org_projects-ee429eb6-b010-4916-91af-3ce0976426dd.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/__files/orgs_github-api-test-org_projects-ee429eb6-b010-4916-91af-3ce0976426dd.json new file mode 100644 index 0000000000..a4d24e7175 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/__files/orgs_github-api-test-org_projects-ee429eb6-b010-4916-91af-3ce0976426dd.json @@ -0,0 +1,36 @@ +{ + "owner_url": "https://api.github.com/orgs/github-api-test-org", + "url": "https://api.github.com/projects/3312433", + "html_url": "https://github.com/orgs/github-api-test-org/projects/20", + "columns_url": "https://api.github.com/projects/3312433/columns", + "id": 3312433, + "node_id": "MDc6UHJvamVjdDMzMTI0MzM=", + "name": "test-project", + "body": "This is a test project", + "number": 20, + "state": "open", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:23:24Z", + "updated_at": "2019-10-04T17:23:24Z", + "organization_permission": "write", + "private": true +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/__files/projects_3312433-55b16b4e-924d-4cf7-9113-fbc644011a44.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/__files/projects_3312433-55b16b4e-924d-4cf7-9113-fbc644011a44.json new file mode 100644 index 0000000000..bd67c4e136 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/__files/projects_3312433-55b16b4e-924d-4cf7-9113-fbc644011a44.json @@ -0,0 +1,36 @@ +{ + "owner_url": "https://api.github.com/orgs/github-api-test-org", + "url": "https://api.github.com/projects/3312433", + "html_url": "https://github.com/orgs/github-api-test-org/projects/20", + "columns_url": "https://api.github.com/projects/3312433/columns", + "id": 3312433, + "node_id": "MDc6UHJvamVjdDMzMTI0MzM=", + "name": "test-project", + "body": "This is a test project", + "number": 20, + "state": "closed", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:23:24Z", + "updated_at": "2019-10-04T17:23:24Z", + "organization_permission": "write", + "private": true +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/__files/projects_3312433-715884a8-0610-43b5-9379-01ac91168ec0.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/__files/projects_3312433-715884a8-0610-43b5-9379-01ac91168ec0.json new file mode 100644 index 0000000000..bd67c4e136 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/__files/projects_3312433-715884a8-0610-43b5-9379-01ac91168ec0.json @@ -0,0 +1,36 @@ +{ + "owner_url": "https://api.github.com/orgs/github-api-test-org", + "url": "https://api.github.com/projects/3312433", + "html_url": "https://github.com/orgs/github-api-test-org/projects/20", + "columns_url": "https://api.github.com/projects/3312433/columns", + "id": 3312433, + "node_id": "MDc6UHJvamVjdDMzMTI0MzM=", + "name": "test-project", + "body": "This is a test project", + "number": 20, + "state": "closed", + "creator": { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2019-10-04T17:23:24Z", + "updated_at": "2019-10-04T17:23:24Z", + "organization_permission": "write", + "private": true +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/__files/user-f7605e5c-c728-4af9-baca-a6e1266d1b4a.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/__files/user-f7605e5c-c728-4af9-baca-a6e1266d1b4a.json new file mode 100644 index 0000000000..41fc9e3d00 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/__files/user-f7605e5c-c728-4af9-baca-a6e1266d1b4a.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 168, + "public_gists": 4, + "followers": 136, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/mappings/orgs_github-api-test-org-2-a522b5.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/mappings/orgs_github-api-test-org-2-a522b5.json new file mode 100644 index 0000000000..6d67cd930b --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/mappings/orgs_github-api-test-org-2-a522b5.json @@ -0,0 +1,43 @@ +{ + "id": "a522b55e-f089-4a29-a55e-33f0744eca1a", + "name": "orgs_github-api-test-org", + "request": { + "url": "/orgs/github-api-test-org", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org-a522b55e-f089-4a29-a55e-33f0744eca1a.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:24 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4716", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"9f594020395ec69662bd8dc1ceecdc09\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEA4:67D5:141DFCC:18393EC:5D97800B" + } + }, + "uuid": "a522b55e-f089-4a29-a55e-33f0744eca1a", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/mappings/orgs_github-api-test-org_projects-3-ee429e.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/mappings/orgs_github-api-test-org_projects-3-ee429e.json new file mode 100644 index 0000000000..54b50b6298 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/mappings/orgs_github-api-test-org_projects-3-ee429e.json @@ -0,0 +1,50 @@ +{ + "id": "ee429eb6-b010-4916-91af-3ce0976426dd", + "name": "orgs_github-api-test-org_projects", + "request": { + "url": "/orgs/github-api-test-org/projects", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"name\":\"test-project\",\"body\":\"This is a test project\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "orgs_github-api-test-org_projects-ee429eb6-b010-4916-91af-3ce0976426dd.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:24 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4715", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"4f777a856ead633d72e59b26d48fd596\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "Location": "https://api.github.com/projects/3312433", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEA4:67D5:141DFD9:1839402:5D97800C" + } + }, + "uuid": "ee429eb6-b010-4916-91af-3ce0976426dd", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/mappings/projects_3312433-4-55b16b.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/mappings/projects_3312433-4-55b16b.json new file mode 100644 index 0000000000..62f10ca491 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/mappings/projects_3312433-4-55b16b.json @@ -0,0 +1,49 @@ +{ + "id": "55b16b4e-924d-4cf7-9113-fbc644011a44", + "name": "projects_3312433", + "request": { + "url": "/projects/3312433", + "method": "PATCH", + "bodyPatterns": [ + { + "equalToJson": "{\"state\":\"closed\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "projects_3312433-55b16b4e-924d-4cf7-9113-fbc644011a44.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:24 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4714", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"96424fba8e165ef2bd2efd7ae572b817\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo, write:org", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEA4:67D5:141DFEF:1839415:5D97800C" + } + }, + "uuid": "55b16b4e-924d-4cf7-9113-fbc644011a44", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/mappings/projects_3312433-5-715884.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/mappings/projects_3312433-5-715884.json new file mode 100644 index 0000000000..94f2b1bb77 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/mappings/projects_3312433-5-715884.json @@ -0,0 +1,42 @@ +{ + "id": "715884a8-0610-43b5-9379-01ac91168ec0", + "name": "projects_3312433", + "request": { + "url": "/projects/3312433", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "projects_3312433-715884a8-0610-43b5-9379-01ac91168ec0.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:24 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4713", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"96424fba8e165ef2bd2efd7ae572b817\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "read:org, repo", + "X-GitHub-Media-Type": "github.inertia-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEA4:67D5:141E00D:183943D:5D97800C" + } + }, + "uuid": "715884a8-0610-43b5-9379-01ac91168ec0", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/mappings/user-1-f7605e.json b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/mappings/user-1-f7605e.json new file mode 100644 index 0000000000..665d6118ad --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHProjectTest/wiremock/testEditProjectState/mappings/user-1-f7605e.json @@ -0,0 +1,43 @@ +{ + "id": "f7605e5c-c728-4af9-baca-a6e1266d1b4a", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-f7605e5c-c728-4af9-baca-a6e1266d1b4a.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:23:23 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4718", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FEA4:67D5:141DFBA:18393E1:5D97800B" + } + }, + "uuid": "f7605e5c-c728-4af9-baca-a6e1266d1b4a", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file From 3972d11827d5bdd31edfac557a6c118ed8746843 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Fri, 4 Oct 2019 10:30:22 -0700 Subject: [PATCH 4/8] WireMock License Test --- .../org/kohsuke/github/GHLicenseTest.java | 18 +-- ...-4cc836da-9288-41bd-886c-05c93470225d.json | 25 ++++ ...-631120d1-4833-49ea-a8f7-55a6085625ef.json | 130 ++++++++++++++++++ ...-f6ba1895-6c06-4c51-9ad0-fcf322e87ee4.json | 25 ++++ ...-eeb32135-bbb9-4c4c-8166-472f24fba13a.json | 45 ++++++ .../mappings/licenses_mit-4-4cc836.json | 42 ++++++ .../repos_github-api_github-api-2-631120.json | 43 ++++++ ...ithub-api_github-api_license-3-f6ba18.json | 43 ++++++ .../mappings/user-1-eeb321.json | 43 ++++++ ...-1f9552cb-0b47-47ca-bb9b-f685d1dbbf05.json | 130 ++++++++++++++++++ ...-b99917fd-7863-4815-8e2e-cd3261475e98.json | 25 ++++ ...-659cc231-9415-4c8e-8f9f-153362753343.json | 45 ++++++ .../repos_github-api_github-api-2-1f9552.json | 43 ++++++ ...ithub-api_github-api_license-3-b99917.json | 43 ++++++ .../mappings/user-1-659cc2.json | 43 ++++++ ...-bd1153cf-7be6-4147-9e7e-e12a0d7789f2.json | 127 +++++++++++++++++ ...-a0fac733-4d83-4d68-be23-c1c57574ea10.json | 25 ++++ ...-30af4231-bcac-4e52-8dfe-da122934c709.json | 45 ++++++ .../mappings/repos_atom_atom-2-bd1153.json | 43 ++++++ .../repos_atom_atom_license-3-a0fac7.json | 43 ++++++ .../mappings/user-1-30af42.json | 43 ++++++ ...-7c3e7b36-6930-4804-8d6e-83075abfcde8.json | 127 +++++++++++++++++ ...-c59d46f6-2c50-4afd-80b6-40dbfa4dd754.json | 25 ++++ ...-767d6575-bd87-4641-a940-a567ff936667.json | 45 ++++++ .../mappings/repos_pomes_pomes-2-7c3e7b.json | 43 ++++++ .../repos_pomes_pomes_license-3-c59d46.json | 43 ++++++ .../mappings/user-1-767d65.json | 43 ++++++ ...-c9deed07-bd75-4016-bc8e-ee09b582b604.json | 127 +++++++++++++++++ ...-47a3f209-8281-4238-b926-f199992b4cdf.json | 25 ++++ ...-f33aa0eb-ef47-4106-b877-b8938a450623.json | 45 ++++++ .../mappings/repos_pomes_pomes-2-c9deed.json | 43 ++++++ .../repos_pomes_pomes_license-3-47a3f2.json | 43 ++++++ .../mappings/user-1-f33aa0.json | 43 ++++++ ...-ed789279-0e18-43b9-8ee5-4a9a40160834.json | 124 +++++++++++++++++ ...-3003d0dd-7267-40ad-a499-e3fb8ce52a3f.json | 45 ++++++ ...os_github-api-test-org_empty-2-ed7892.json | 43 ++++++ ...b-api-test-org_empty_license-3-fb7ab8.json | 36 +++++ .../mappings/user-1-3003d0.json | 43 ++++++ ...-2182eadf-58a8-487f-89af-e6f6e8c527fe.json | 25 ++++ ...-38876ae8-0962-4f1b-97cf-78ca1fb1fcb9.json | 45 ++++++ .../mappings/licenses_mit-2-2182ea.json | 42 ++++++ .../getLicense/mappings/user-1-38876a.json | 43 ++++++ ...-b3d307b7-ab1a-4a9e-9b89-d0a7e8fcd2e8.json | 86 ++++++++++++ ...-dfe7f772-b859-48ce-919e-54ccde4cdd28.json | 45 ++++++ .../mappings/licenses-2-b3d307.json | 42 ++++++ .../listLicenses/mappings/user-1-dfe7f7.json | 43 ++++++ ...-f00fa680-0dd6-401b-a35f-1ed72d7587a7.json | 86 ++++++++++++ ...-b8102c16-0e43-4f4d-96c1-7d6cfb5981c2.json | 45 ++++++ .../mappings/licenses-2-f00fa6.json | 42 ++++++ .../mappings/user-1-b8102c.json | 43 ++++++ 50 files changed, 2590 insertions(+), 9 deletions(-) create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/__files/licenses_mit-4cc836da-9288-41bd-886c-05c93470225d.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/__files/repos_github-api_github-api-631120d1-4833-49ea-a8f7-55a6085625ef.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/__files/repos_github-api_github-api_license-f6ba1895-6c06-4c51-9ad0-fcf322e87ee4.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/__files/user-eeb32135-bbb9-4c4c-8166-472f24fba13a.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/mappings/licenses_mit-4-4cc836.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/mappings/repos_github-api_github-api-2-631120.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/mappings/repos_github-api_github-api_license-3-f6ba18.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/mappings/user-1-eeb321.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/__files/repos_github-api_github-api-1f9552cb-0b47-47ca-bb9b-f685d1dbbf05.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/__files/repos_github-api_github-api_license-b99917fd-7863-4815-8e2e-cd3261475e98.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/__files/user-659cc231-9415-4c8e-8f9f-153362753343.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/mappings/repos_github-api_github-api-2-1f9552.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/mappings/repos_github-api_github-api_license-3-b99917.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/mappings/user-1-659cc2.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/__files/repos_atom_atom-bd1153cf-7be6-4147-9e7e-e12a0d7789f2.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/__files/repos_atom_atom_license-a0fac733-4d83-4d68-be23-c1c57574ea10.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/__files/user-30af4231-bcac-4e52-8dfe-da122934c709.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/mappings/repos_atom_atom-2-bd1153.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/mappings/repos_atom_atom_license-3-a0fac7.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/mappings/user-1-30af42.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/__files/repos_pomes_pomes-7c3e7b36-6930-4804-8d6e-83075abfcde8.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/__files/repos_pomes_pomes_license-c59d46f6-2c50-4afd-80b6-40dbfa4dd754.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/__files/user-767d6575-bd87-4641-a940-a567ff936667.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/mappings/repos_pomes_pomes-2-7c3e7b.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/mappings/repos_pomes_pomes_license-3-c59d46.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/mappings/user-1-767d65.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/__files/repos_pomes_pomes-c9deed07-bd75-4016-bc8e-ee09b582b604.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/__files/repos_pomes_pomes_license-47a3f209-8281-4238-b926-f199992b4cdf.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/__files/user-f33aa0eb-ef47-4106-b877-b8938a450623.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/mappings/repos_pomes_pomes-2-c9deed.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/mappings/repos_pomes_pomes_license-3-47a3f2.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/mappings/user-1-f33aa0.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryWithoutLicense/__files/repos_github-api-test-org_empty-ed789279-0e18-43b9-8ee5-4a9a40160834.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryWithoutLicense/__files/user-3003d0dd-7267-40ad-a499-e3fb8ce52a3f.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryWithoutLicense/mappings/repos_github-api-test-org_empty-2-ed7892.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryWithoutLicense/mappings/repos_github-api-test-org_empty_license-3-fb7ab8.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryWithoutLicense/mappings/user-1-3003d0.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/getLicense/__files/licenses_mit-2182eadf-58a8-487f-89af-e6f6e8c527fe.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/getLicense/__files/user-38876ae8-0962-4f1b-97cf-78ca1fb1fcb9.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/getLicense/mappings/licenses_mit-2-2182ea.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/getLicense/mappings/user-1-38876a.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicenses/__files/licenses-b3d307b7-ab1a-4a9e-9b89-d0a7e8fcd2e8.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicenses/__files/user-dfe7f772-b859-48ce-919e-54ccde4cdd28.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicenses/mappings/licenses-2-b3d307.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicenses/mappings/user-1-dfe7f7.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicensesCheckIndividualLicense/__files/licenses-f00fa680-0dd6-401b-a35f-1ed72d7587a7.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicensesCheckIndividualLicense/__files/user-b8102c16-0e43-4f4d-96c1-7d6cfb5981c2.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicensesCheckIndividualLicense/mappings/licenses-2-f00fa6.json create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicensesCheckIndividualLicense/mappings/user-1-b8102c.json diff --git a/src/test/java/org/kohsuke/github/GHLicenseTest.java b/src/test/java/org/kohsuke/github/GHLicenseTest.java index fc039dc45c..2ddbd50c8e 100644 --- a/src/test/java/org/kohsuke/github/GHLicenseTest.java +++ b/src/test/java/org/kohsuke/github/GHLicenseTest.java @@ -35,7 +35,7 @@ /** * @author Duncan Dickinson */ -public class GHLicenseTest extends AbstractGitHubApiTestBase { +public class GHLicenseTest extends AbstractGitHubApiWireMockTest { /** * Basic test to ensure that the list of licenses from {@link GitHub#listLicenses()} is returned @@ -59,7 +59,7 @@ public void listLicensesCheckIndividualLicense() throws IOException { PagedIterable licenses = gitHub.listLicenses(); for (GHLicense lic : licenses) { if (lic.getKey().equals("mit")) { - assertTrue(lic.getUrl().equals(new URL("https://api.github.com/licenses/mit"))); + assertTrue(lic.getUrl().equals(new URL(githubApi.baseUrl() + "/licenses/mit"))); return; } } @@ -89,12 +89,12 @@ public void getLicense() throws IOException { */ @Test public void checkRepositoryLicense() throws IOException { - GHRepository repo = gitHub.getRepository("kohsuke/github-api"); + GHRepository repo = gitHub.getRepository("github-api/github-api"); GHLicense license = repo.getLicense(); assertNotNull("The license is populated", license); assertTrue("The key is correct", license.getKey().equals("mit")); assertTrue("The name is correct", license.getName().equals("MIT License")); - assertTrue("The URL is correct", license.getUrl().equals(new URL("https://api.github.com/licenses/mit"))); + assertTrue("The URL is correct", license.getUrl().equals(new URL(githubApi.baseUrl() + "/licenses/mit"))); } /** @@ -110,7 +110,7 @@ public void checkRepositoryLicenseAtom() throws IOException { assertNotNull("The license is populated", license); assertTrue("The key is correct", license.getKey().equals("mit")); assertTrue("The name is correct", license.getName().equals("MIT License")); - assertTrue("The URL is correct", license.getUrl().equals(new URL("https://api.github.com/licenses/mit"))); + assertTrue("The URL is correct", license.getUrl().equals(new URL(githubApi.baseUrl() + "/licenses/mit"))); } /** @@ -126,7 +126,7 @@ public void checkRepositoryLicensePomes() throws IOException { assertNotNull("The license is populated", license); assertTrue("The key is correct", license.getKey().equals("apache-2.0")); assertTrue("The name is correct", license.getName().equals("Apache License 2.0")); - assertTrue("The URL is correct", license.getUrl().equals(new URL("https://api.github.com/licenses/apache-2.0"))); + assertTrue("The URL is correct", license.getUrl().equals(new URL(githubApi.baseUrl() + "/licenses/apache-2.0"))); } /** @@ -137,7 +137,7 @@ public void checkRepositoryLicensePomes() throws IOException { */ @Test public void checkRepositoryWithoutLicense() throws IOException { - GHRepository repo = gitHub.getRepository("dedickinson/test-repo"); + GHRepository repo = gitHub.getRepository(GITHUB_API_TEST_ORG + "/empty"); GHLicense license = repo.getLicense(); assertNull("There is no license", license); } @@ -151,12 +151,12 @@ public void checkRepositoryWithoutLicense() throws IOException { */ @Test public void checkRepositoryFullLicense() throws IOException { - GHRepository repo = gitHub.getRepository("kohsuke/github-api"); + GHRepository repo = gitHub.getRepository("github-api/github-api"); GHLicense license = repo.getLicense(); assertNotNull("The license is populated", license); assertTrue("The key is correct", license.getKey().equals("mit")); assertTrue("The name is correct", license.getName().equals("MIT License")); - assertTrue("The URL is correct", license.getUrl().equals(new URL("https://api.github.com/licenses/mit"))); + assertTrue("The URL is correct", license.getUrl().equals(new URL(githubApi.baseUrl() + "/licenses/mit"))); assertTrue("The HTML URL is correct", license.getHtmlUrl().equals(new URL("http://choosealicense.com/licenses/mit/"))); } diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/__files/licenses_mit-4cc836da-9288-41bd-886c-05c93470225d.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/__files/licenses_mit-4cc836da-9288-41bd-886c-05c93470225d.json new file mode 100644 index 0000000000..b8c174e94b --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/__files/licenses_mit-4cc836da-9288-41bd-886c-05c93470225d.json @@ -0,0 +1,25 @@ +{ + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz", + "html_url": "http://choosealicense.com/licenses/mit/", + "description": "A short and simple permissive license with conditions only requiring preservation of copyright and license notices. Licensed works, modifications, and larger works may be distributed under different terms and without source code.", + "implementation": "Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file. Replace [year] with the current year and [fullname] with the name (or names) of the copyright holders.", + "permissions": [ + "commercial-use", + "modifications", + "distribution", + "private-use" + ], + "conditions": [ + "include-copyright" + ], + "limitations": [ + "liability", + "warranty" + ], + "body": "MIT License\n\nCopyright (c) [year] [fullname]\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", + "featured": true +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/__files/repos_github-api_github-api-631120d1-4833-49ea-a8f7-55a6085625ef.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/__files/repos_github-api_github-api-631120d1-4833-49ea-a8f7-55a6085625ef.json new file mode 100644 index 0000000000..8d7603c61d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/__files/repos_github-api_github-api-631120d1-4833-49ea-a8f7-55a6085625ef.json @@ -0,0 +1,130 @@ +{ + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "github-api/github-api", + "private": false, + "owner": { + "login": "github-api", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api", + "html_url": "https://github.com/github-api", + "followers_url": "https://api.github.com/users/github-api/followers", + "following_url": "https://api.github.com/users/github-api/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api/subscriptions", + "organizations_url": "https://api.github.com/users/github-api/orgs", + "repos_url": "https://api.github.com/users/github-api/repos", + "events_url": "https://api.github.com/users/github-api/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/github-api/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/github-api/github-api", + "forks_url": "https://api.github.com/repos/github-api/github-api/forks", + "keys_url": "https://api.github.com/repos/github-api/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api/github-api/teams", + "hooks_url": "https://api.github.com/repos/github-api/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/github-api/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api/github-api/events", + "assignees_url": "https://api.github.com/repos/github-api/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api/github-api/tags", + "blobs_url": "https://api.github.com/repos/github-api/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api/github-api/languages", + "stargazers_url": "https://api.github.com/repos/github-api/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/github-api/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/github-api/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/github-api/github-api/subscription", + "commits_url": "https://api.github.com/repos/github-api/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api/github-api/merges", + "archive_url": "https://api.github.com/repos/github-api/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api/github-api/downloads", + "issues_url": "https://api.github.com/repos/github-api/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2019-10-04T16:15:14Z", + "pushed_at": "2019-10-04T17:28:24Z", + "git_url": "git://github.com/github-api/github-api.git", + "ssh_url": "git@github.com:github-api/github-api.git", + "clone_url": "https://github.com/github-api/github-api.git", + "svn_url": "https://github.com/github-api/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 12265, + "stargazers_count": 557, + "watchers_count": 557, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 428, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 86, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 428, + "open_issues": 86, + "watchers": 557, + "default_branch": "master", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "github-api", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api", + "html_url": "https://github.com/github-api", + "followers_url": "https://api.github.com/users/github-api/followers", + "following_url": "https://api.github.com/users/github-api/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api/subscriptions", + "organizations_url": "https://api.github.com/users/github-api/orgs", + "repos_url": "https://api.github.com/users/github-api/repos", + "events_url": "https://api.github.com/users/github-api/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 428, + "subscribers_count": 50 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/__files/repos_github-api_github-api_license-f6ba1895-6c06-4c51-9ad0-fcf322e87ee4.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/__files/repos_github-api_github-api_license-f6ba1895-6c06-4c51-9ad0-fcf322e87ee4.json new file mode 100644 index 0000000000..299e4262b2 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/__files/repos_github-api_github-api_license-f6ba1895-6c06-4c51-9ad0-fcf322e87ee4.json @@ -0,0 +1,25 @@ +{ + "name": "LICENSE.txt", + "path": "LICENSE.txt", + "sha": "a12243f2fc5b8c2ba47dd677d0b0c7583539584d", + "size": 1104, + "url": "https://api.github.com/repos/github-api/github-api/contents/LICENSE.txt?ref=master", + "html_url": "https://github.com/github-api/github-api/blob/master/LICENSE.txt", + "git_url": "https://api.github.com/repos/github-api/github-api/git/blobs/a12243f2fc5b8c2ba47dd677d0b0c7583539584d", + "download_url": "https://raw.githubusercontent.com/github-api/github-api/master/LICENSE.txt", + "type": "file", + "content": "IENvcHlyaWdodCAoYykgMjAxMS0gS29oc3VrZSBLYXdhZ3VjaGkgYW5kIG90\naGVyIGNvbnRyaWJ1dG9ycwoKIFBlcm1pc3Npb24gaXMgaGVyZWJ5IGdyYW50\nZWQsIGZyZWUgb2YgY2hhcmdlLCB0byBhbnkgcGVyc29uCiBvYnRhaW5pbmcg\nYSBjb3B5IG9mIHRoaXMgc29mdHdhcmUgYW5kIGFzc29jaWF0ZWQgZG9jdW1l\nbnRhdGlvbgogZmlsZXMgKHRoZSAiU29mdHdhcmUiKSwgdG8gZGVhbCBpbiB0\naGUgU29mdHdhcmUgd2l0aG91dAogcmVzdHJpY3Rpb24sIGluY2x1ZGluZyB3\naXRob3V0IGxpbWl0YXRpb24gdGhlIHJpZ2h0cyB0byB1c2UsCiBjb3B5LCBt\nb2RpZnksIG1lcmdlLCBwdWJsaXNoLCBkaXN0cmlidXRlLCBzdWJsaWNlbnNl\nLCBhbmQvb3Igc2VsbAogY29waWVzIG9mIHRoZSBTb2Z0d2FyZSwgYW5kIHRv\nIHBlcm1pdCBwZXJzb25zIHRvIHdob20gdGhlCiBTb2Z0d2FyZSBpcyBmdXJu\naXNoZWQgdG8gZG8gc28sIHN1YmplY3QgdG8gdGhlIGZvbGxvd2luZwogY29u\nZGl0aW9uczoKCiBUaGUgYWJvdmUgY29weXJpZ2h0IG5vdGljZSBhbmQgdGhp\ncyBwZXJtaXNzaW9uIG5vdGljZSBzaGFsbCBiZQogaW5jbHVkZWQgaW4gYWxs\nIGNvcGllcyBvciBzdWJzdGFudGlhbCBwb3J0aW9ucyBvZiB0aGUgU29mdHdh\ncmUuCgogVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIsIFdJVEhP\nVVQgV0FSUkFOVFkgT0YgQU5ZIEtJTkQsCiBFWFBSRVNTIE9SIElNUExJRUQs\nIElOQ0xVRElORyBCVVQgTk9UIExJTUlURUQgVE8gVEhFIFdBUlJBTlRJRVMK\nIE9GIE1FUkNIQU5UQUJJTElUWSwgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFS\nIFBVUlBPU0UgQU5ECiBOT05JTkZSSU5HRU1FTlQuIElOIE5PIEVWRU5UIFNI\nQUxMIFRIRSBBVVRIT1JTIE9SIENPUFlSSUdIVAogSE9MREVSUyBCRSBMSUFC\nTEUgRk9SIEFOWSBDTEFJTSwgREFNQUdFUyBPUiBPVEhFUiBMSUFCSUxJVFks\nCiBXSEVUSEVSIElOIEFOIEFDVElPTiBPRiBDT05UUkFDVCwgVE9SVCBPUiBP\nVEhFUldJU0UsIEFSSVNJTkcKIEZST00sIE9VVCBPRiBPUiBJTiBDT05ORUNU\nSU9OIFdJVEggVEhFIFNPRlRXQVJFIE9SIFRIRSBVU0UgT1IKIE9USEVSIERF\nQUxJTkdTIElOIFRIRSBTT0ZUV0FSRS4K\n", + "encoding": "base64", + "_links": { + "self": "https://api.github.com/repos/github-api/github-api/contents/LICENSE.txt?ref=master", + "git": "https://api.github.com/repos/github-api/github-api/git/blobs/a12243f2fc5b8c2ba47dd677d0b0c7583539584d", + "html": "https://github.com/github-api/github-api/blob/master/LICENSE.txt" + }, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/__files/user-eeb32135-bbb9-4c4c-8166-472f24fba13a.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/__files/user-eeb32135-bbb9-4c4c-8166-472f24fba13a.json new file mode 100644 index 0000000000..41fc9e3d00 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/__files/user-eeb32135-bbb9-4c4c-8166-472f24fba13a.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 168, + "public_gists": 4, + "followers": 136, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/mappings/licenses_mit-4-4cc836.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/mappings/licenses_mit-4-4cc836.json new file mode 100644 index 0000000000..94a654fa64 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/mappings/licenses_mit-4-4cc836.json @@ -0,0 +1,42 @@ +{ + "id": "4cc836da-9288-41bd-886c-05c93470225d", + "name": "licenses_mit", + "request": { + "url": "/licenses/mit", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "licenses_mit-4cc836da-9288-41bd-886c-05c93470225d.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:35 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4583", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"cdc71ea0b0e60f4cdbf00107bcf1035c\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C161:67D5:1425BD1:18429E5:5D97817F" + } + }, + "uuid": "4cc836da-9288-41bd-886c-05c93470225d", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/mappings/repos_github-api_github-api-2-631120.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/mappings/repos_github-api_github-api-2-631120.json new file mode 100644 index 0000000000..36b0371aa2 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/mappings/repos_github-api_github-api-2-631120.json @@ -0,0 +1,43 @@ +{ + "id": "631120d1-4833-49ea-a8f7-55a6085625ef", + "name": "repos_github-api_github-api", + "request": { + "url": "/repos/github-api/github-api", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api_github-api-631120d1-4833-49ea-a8f7-55a6085625ef.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:35 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4585", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"973d36671120e8acb6adb43ce42e6820\"", + "Last-Modified": "Fri, 04 Oct 2019 16:15:14 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C161:67D5:1425BB7:18429A6:5D97817E" + } + }, + "uuid": "631120d1-4833-49ea-a8f7-55a6085625ef", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/mappings/repos_github-api_github-api_license-3-f6ba18.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/mappings/repos_github-api_github-api_license-3-f6ba18.json new file mode 100644 index 0000000000..9a683b88f5 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/mappings/repos_github-api_github-api_license-3-f6ba18.json @@ -0,0 +1,43 @@ +{ + "id": "f6ba1895-6c06-4c51-9ad0-fcf322e87ee4", + "name": "repos_github-api_github-api_license", + "request": { + "url": "/repos/github-api/github-api/license", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api_github-api_license-f6ba1895-6c06-4c51-9ad0-fcf322e87ee4.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:35 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4584", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"22f018ca5a5e3c36ee8522bb91a5046a\"", + "Last-Modified": "Fri, 04 Oct 2019 16:15:09 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C161:67D5:1425BC5:18429D3:5D97817F" + } + }, + "uuid": "f6ba1895-6c06-4c51-9ad0-fcf322e87ee4", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/mappings/user-1-eeb321.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/mappings/user-1-eeb321.json new file mode 100644 index 0000000000..62702f9066 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryFullLicense/mappings/user-1-eeb321.json @@ -0,0 +1,43 @@ +{ + "id": "eeb32135-bbb9-4c4c-8166-472f24fba13a", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-eeb32135-bbb9-4c4c-8166-472f24fba13a.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:34 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4587", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C161:67D5:1425B9D:1842999:5D97817E" + } + }, + "uuid": "eeb32135-bbb9-4c4c-8166-472f24fba13a", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/__files/repos_github-api_github-api-1f9552cb-0b47-47ca-bb9b-f685d1dbbf05.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/__files/repos_github-api_github-api-1f9552cb-0b47-47ca-bb9b-f685d1dbbf05.json new file mode 100644 index 0000000000..8d7603c61d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/__files/repos_github-api_github-api-1f9552cb-0b47-47ca-bb9b-f685d1dbbf05.json @@ -0,0 +1,130 @@ +{ + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "github-api/github-api", + "private": false, + "owner": { + "login": "github-api", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api", + "html_url": "https://github.com/github-api", + "followers_url": "https://api.github.com/users/github-api/followers", + "following_url": "https://api.github.com/users/github-api/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api/subscriptions", + "organizations_url": "https://api.github.com/users/github-api/orgs", + "repos_url": "https://api.github.com/users/github-api/repos", + "events_url": "https://api.github.com/users/github-api/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/github-api/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/github-api/github-api", + "forks_url": "https://api.github.com/repos/github-api/github-api/forks", + "keys_url": "https://api.github.com/repos/github-api/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api/github-api/teams", + "hooks_url": "https://api.github.com/repos/github-api/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/github-api/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api/github-api/events", + "assignees_url": "https://api.github.com/repos/github-api/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api/github-api/tags", + "blobs_url": "https://api.github.com/repos/github-api/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api/github-api/languages", + "stargazers_url": "https://api.github.com/repos/github-api/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/github-api/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/github-api/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/github-api/github-api/subscription", + "commits_url": "https://api.github.com/repos/github-api/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api/github-api/merges", + "archive_url": "https://api.github.com/repos/github-api/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api/github-api/downloads", + "issues_url": "https://api.github.com/repos/github-api/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2019-10-04T16:15:14Z", + "pushed_at": "2019-10-04T17:28:24Z", + "git_url": "git://github.com/github-api/github-api.git", + "ssh_url": "git@github.com:github-api/github-api.git", + "clone_url": "https://github.com/github-api/github-api.git", + "svn_url": "https://github.com/github-api/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 12265, + "stargazers_count": 557, + "watchers_count": 557, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 428, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 86, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 428, + "open_issues": 86, + "watchers": 557, + "default_branch": "master", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "github-api", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api", + "html_url": "https://github.com/github-api", + "followers_url": "https://api.github.com/users/github-api/followers", + "following_url": "https://api.github.com/users/github-api/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api/subscriptions", + "organizations_url": "https://api.github.com/users/github-api/orgs", + "repos_url": "https://api.github.com/users/github-api/repos", + "events_url": "https://api.github.com/users/github-api/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 428, + "subscribers_count": 50 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/__files/repos_github-api_github-api_license-b99917fd-7863-4815-8e2e-cd3261475e98.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/__files/repos_github-api_github-api_license-b99917fd-7863-4815-8e2e-cd3261475e98.json new file mode 100644 index 0000000000..299e4262b2 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/__files/repos_github-api_github-api_license-b99917fd-7863-4815-8e2e-cd3261475e98.json @@ -0,0 +1,25 @@ +{ + "name": "LICENSE.txt", + "path": "LICENSE.txt", + "sha": "a12243f2fc5b8c2ba47dd677d0b0c7583539584d", + "size": 1104, + "url": "https://api.github.com/repos/github-api/github-api/contents/LICENSE.txt?ref=master", + "html_url": "https://github.com/github-api/github-api/blob/master/LICENSE.txt", + "git_url": "https://api.github.com/repos/github-api/github-api/git/blobs/a12243f2fc5b8c2ba47dd677d0b0c7583539584d", + "download_url": "https://raw.githubusercontent.com/github-api/github-api/master/LICENSE.txt", + "type": "file", + "content": "IENvcHlyaWdodCAoYykgMjAxMS0gS29oc3VrZSBLYXdhZ3VjaGkgYW5kIG90\naGVyIGNvbnRyaWJ1dG9ycwoKIFBlcm1pc3Npb24gaXMgaGVyZWJ5IGdyYW50\nZWQsIGZyZWUgb2YgY2hhcmdlLCB0byBhbnkgcGVyc29uCiBvYnRhaW5pbmcg\nYSBjb3B5IG9mIHRoaXMgc29mdHdhcmUgYW5kIGFzc29jaWF0ZWQgZG9jdW1l\nbnRhdGlvbgogZmlsZXMgKHRoZSAiU29mdHdhcmUiKSwgdG8gZGVhbCBpbiB0\naGUgU29mdHdhcmUgd2l0aG91dAogcmVzdHJpY3Rpb24sIGluY2x1ZGluZyB3\naXRob3V0IGxpbWl0YXRpb24gdGhlIHJpZ2h0cyB0byB1c2UsCiBjb3B5LCBt\nb2RpZnksIG1lcmdlLCBwdWJsaXNoLCBkaXN0cmlidXRlLCBzdWJsaWNlbnNl\nLCBhbmQvb3Igc2VsbAogY29waWVzIG9mIHRoZSBTb2Z0d2FyZSwgYW5kIHRv\nIHBlcm1pdCBwZXJzb25zIHRvIHdob20gdGhlCiBTb2Z0d2FyZSBpcyBmdXJu\naXNoZWQgdG8gZG8gc28sIHN1YmplY3QgdG8gdGhlIGZvbGxvd2luZwogY29u\nZGl0aW9uczoKCiBUaGUgYWJvdmUgY29weXJpZ2h0IG5vdGljZSBhbmQgdGhp\ncyBwZXJtaXNzaW9uIG5vdGljZSBzaGFsbCBiZQogaW5jbHVkZWQgaW4gYWxs\nIGNvcGllcyBvciBzdWJzdGFudGlhbCBwb3J0aW9ucyBvZiB0aGUgU29mdHdh\ncmUuCgogVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIsIFdJVEhP\nVVQgV0FSUkFOVFkgT0YgQU5ZIEtJTkQsCiBFWFBSRVNTIE9SIElNUExJRUQs\nIElOQ0xVRElORyBCVVQgTk9UIExJTUlURUQgVE8gVEhFIFdBUlJBTlRJRVMK\nIE9GIE1FUkNIQU5UQUJJTElUWSwgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFS\nIFBVUlBPU0UgQU5ECiBOT05JTkZSSU5HRU1FTlQuIElOIE5PIEVWRU5UIFNI\nQUxMIFRIRSBBVVRIT1JTIE9SIENPUFlSSUdIVAogSE9MREVSUyBCRSBMSUFC\nTEUgRk9SIEFOWSBDTEFJTSwgREFNQUdFUyBPUiBPVEhFUiBMSUFCSUxJVFks\nCiBXSEVUSEVSIElOIEFOIEFDVElPTiBPRiBDT05UUkFDVCwgVE9SVCBPUiBP\nVEhFUldJU0UsIEFSSVNJTkcKIEZST00sIE9VVCBPRiBPUiBJTiBDT05ORUNU\nSU9OIFdJVEggVEhFIFNPRlRXQVJFIE9SIFRIRSBVU0UgT1IKIE9USEVSIERF\nQUxJTkdTIElOIFRIRSBTT0ZUV0FSRS4K\n", + "encoding": "base64", + "_links": { + "self": "https://api.github.com/repos/github-api/github-api/contents/LICENSE.txt?ref=master", + "git": "https://api.github.com/repos/github-api/github-api/git/blobs/a12243f2fc5b8c2ba47dd677d0b0c7583539584d", + "html": "https://github.com/github-api/github-api/blob/master/LICENSE.txt" + }, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/__files/user-659cc231-9415-4c8e-8f9f-153362753343.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/__files/user-659cc231-9415-4c8e-8f9f-153362753343.json new file mode 100644 index 0000000000..41fc9e3d00 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/__files/user-659cc231-9415-4c8e-8f9f-153362753343.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 168, + "public_gists": 4, + "followers": 136, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/mappings/repos_github-api_github-api-2-1f9552.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/mappings/repos_github-api_github-api-2-1f9552.json new file mode 100644 index 0000000000..44394c38c3 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/mappings/repos_github-api_github-api-2-1f9552.json @@ -0,0 +1,43 @@ +{ + "id": "1f9552cb-0b47-47ca-bb9b-f685d1dbbf05", + "name": "repos_github-api_github-api", + "request": { + "url": "/repos/github-api/github-api", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api_github-api-1f9552cb-0b47-47ca-bb9b-f685d1dbbf05.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:33 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4589", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"973d36671120e8acb6adb43ce42e6820\"", + "Last-Modified": "Fri, 04 Oct 2019 16:15:14 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C15D:9576:93A269:B07BAE:5D97817C" + } + }, + "uuid": "1f9552cb-0b47-47ca-bb9b-f685d1dbbf05", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/mappings/repos_github-api_github-api_license-3-b99917.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/mappings/repos_github-api_github-api_license-3-b99917.json new file mode 100644 index 0000000000..fc1d4cf0ff --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/mappings/repos_github-api_github-api_license-3-b99917.json @@ -0,0 +1,43 @@ +{ + "id": "b99917fd-7863-4815-8e2e-cd3261475e98", + "name": "repos_github-api_github-api_license", + "request": { + "url": "/repos/github-api/github-api/license", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api_github-api_license-b99917fd-7863-4815-8e2e-cd3261475e98.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:34 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4588", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"22f018ca5a5e3c36ee8522bb91a5046a\"", + "Last-Modified": "Fri, 04 Oct 2019 16:15:09 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C15D:9576:93A277:B07BCE:5D97817D" + } + }, + "uuid": "b99917fd-7863-4815-8e2e-cd3261475e98", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/mappings/user-1-659cc2.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/mappings/user-1-659cc2.json new file mode 100644 index 0000000000..9f1c1d0ede --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicense/mappings/user-1-659cc2.json @@ -0,0 +1,43 @@ +{ + "id": "659cc231-9415-4c8e-8f9f-153362753343", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-659cc231-9415-4c8e-8f9f-153362753343.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:32 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4591", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C15D:9576:93A250:B07BA4:5D97817C" + } + }, + "uuid": "659cc231-9415-4c8e-8f9f-153362753343", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/__files/repos_atom_atom-bd1153cf-7be6-4147-9e7e-e12a0d7789f2.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/__files/repos_atom_atom-bd1153cf-7be6-4147-9e7e-e12a0d7789f2.json new file mode 100644 index 0000000000..ff2bee6b93 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/__files/repos_atom_atom-bd1153cf-7be6-4147-9e7e-e12a0d7789f2.json @@ -0,0 +1,127 @@ +{ + "id": 3228505, + "node_id": "MDEwOlJlcG9zaXRvcnkzMjI4NTA1", + "name": "atom", + "full_name": "atom/atom", + "private": false, + "owner": { + "login": "atom", + "id": 1089146, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjEwODkxNDY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/1089146?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atom", + "html_url": "https://github.com/atom", + "followers_url": "https://api.github.com/users/atom/followers", + "following_url": "https://api.github.com/users/atom/following{/other_user}", + "gists_url": "https://api.github.com/users/atom/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atom/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atom/subscriptions", + "organizations_url": "https://api.github.com/users/atom/orgs", + "repos_url": "https://api.github.com/users/atom/repos", + "events_url": "https://api.github.com/users/atom/events{/privacy}", + "received_events_url": "https://api.github.com/users/atom/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/atom/atom", + "description": ":atom: The hackable text editor", + "fork": false, + "url": "https://api.github.com/repos/atom/atom", + "forks_url": "https://api.github.com/repos/atom/atom/forks", + "keys_url": "https://api.github.com/repos/atom/atom/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/atom/atom/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/atom/atom/teams", + "hooks_url": "https://api.github.com/repos/atom/atom/hooks", + "issue_events_url": "https://api.github.com/repos/atom/atom/issues/events{/number}", + "events_url": "https://api.github.com/repos/atom/atom/events", + "assignees_url": "https://api.github.com/repos/atom/atom/assignees{/user}", + "branches_url": "https://api.github.com/repos/atom/atom/branches{/branch}", + "tags_url": "https://api.github.com/repos/atom/atom/tags", + "blobs_url": "https://api.github.com/repos/atom/atom/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/atom/atom/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/atom/atom/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/atom/atom/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/atom/atom/statuses/{sha}", + "languages_url": "https://api.github.com/repos/atom/atom/languages", + "stargazers_url": "https://api.github.com/repos/atom/atom/stargazers", + "contributors_url": "https://api.github.com/repos/atom/atom/contributors", + "subscribers_url": "https://api.github.com/repos/atom/atom/subscribers", + "subscription_url": "https://api.github.com/repos/atom/atom/subscription", + "commits_url": "https://api.github.com/repos/atom/atom/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/atom/atom/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/atom/atom/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/atom/atom/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/atom/atom/contents/{+path}", + "compare_url": "https://api.github.com/repos/atom/atom/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/atom/atom/merges", + "archive_url": "https://api.github.com/repos/atom/atom/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/atom/atom/downloads", + "issues_url": "https://api.github.com/repos/atom/atom/issues{/number}", + "pulls_url": "https://api.github.com/repos/atom/atom/pulls{/number}", + "milestones_url": "https://api.github.com/repos/atom/atom/milestones{/number}", + "notifications_url": "https://api.github.com/repos/atom/atom/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/atom/atom/labels{/name}", + "releases_url": "https://api.github.com/repos/atom/atom/releases{/id}", + "deployments_url": "https://api.github.com/repos/atom/atom/deployments", + "created_at": "2012-01-20T18:18:21Z", + "updated_at": "2019-10-04T16:36:19Z", + "pushed_at": "2019-10-02T18:53:08Z", + "git_url": "git://github.com/atom/atom.git", + "ssh_url": "git@github.com:atom/atom.git", + "clone_url": "https://github.com/atom/atom.git", + "svn_url": "https://github.com/atom/atom", + "homepage": "https://atom.io", + "size": 314158, + "stargazers_count": 50039, + "watchers_count": 50039, + "language": "JavaScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 12930, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 587, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 12930, + "open_issues": 587, + "watchers": 50039, + "default_branch": "master", + "permissions": { + "admin": false, + "push": false, + "pull": true + }, + "organization": { + "login": "atom", + "id": 1089146, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjEwODkxNDY=", + "avatar_url": "https://avatars2.githubusercontent.com/u/1089146?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/atom", + "html_url": "https://github.com/atom", + "followers_url": "https://api.github.com/users/atom/followers", + "following_url": "https://api.github.com/users/atom/following{/other_user}", + "gists_url": "https://api.github.com/users/atom/gists{/gist_id}", + "starred_url": "https://api.github.com/users/atom/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/atom/subscriptions", + "organizations_url": "https://api.github.com/users/atom/orgs", + "repos_url": "https://api.github.com/users/atom/repos", + "events_url": "https://api.github.com/users/atom/events{/privacy}", + "received_events_url": "https://api.github.com/users/atom/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 12930, + "subscribers_count": 2463 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/__files/repos_atom_atom_license-a0fac733-4d83-4d68-be23-c1c57574ea10.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/__files/repos_atom_atom_license-a0fac733-4d83-4d68-be23-c1c57574ea10.json new file mode 100644 index 0000000000..37d64c2287 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/__files/repos_atom_atom_license-a0fac733-4d83-4d68-be23-c1c57574ea10.json @@ -0,0 +1,25 @@ +{ + "name": "LICENSE.md", + "path": "LICENSE.md", + "sha": "ef355c2dd7ccd13cf3aba8e20522ca8f578d481f", + "size": 1060, + "url": "https://api.github.com/repos/atom/atom/contents/LICENSE.md?ref=master", + "html_url": "https://github.com/atom/atom/blob/master/LICENSE.md", + "git_url": "https://api.github.com/repos/atom/atom/git/blobs/ef355c2dd7ccd13cf3aba8e20522ca8f578d481f", + "download_url": "https://raw.githubusercontent.com/atom/atom/master/LICENSE.md", + "type": "file", + "content": "Q29weXJpZ2h0IChjKSAyMDExLTIwMTkgR2l0SHViIEluYy4KClBlcm1pc3Np\nb24gaXMgaGVyZWJ5IGdyYW50ZWQsIGZyZWUgb2YgY2hhcmdlLCB0byBhbnkg\ncGVyc29uIG9idGFpbmluZwphIGNvcHkgb2YgdGhpcyBzb2Z0d2FyZSBhbmQg\nYXNzb2NpYXRlZCBkb2N1bWVudGF0aW9uIGZpbGVzICh0aGUKIlNvZnR3YXJl\nIiksIHRvIGRlYWwgaW4gdGhlIFNvZnR3YXJlIHdpdGhvdXQgcmVzdHJpY3Rp\nb24sIGluY2x1ZGluZwp3aXRob3V0IGxpbWl0YXRpb24gdGhlIHJpZ2h0cyB0\nbyB1c2UsIGNvcHksIG1vZGlmeSwgbWVyZ2UsIHB1Ymxpc2gsCmRpc3RyaWJ1\ndGUsIHN1YmxpY2Vuc2UsIGFuZC9vciBzZWxsIGNvcGllcyBvZiB0aGUgU29m\ndHdhcmUsIGFuZCB0bwpwZXJtaXQgcGVyc29ucyB0byB3aG9tIHRoZSBTb2Z0\nd2FyZSBpcyBmdXJuaXNoZWQgdG8gZG8gc28sIHN1YmplY3QgdG8KdGhlIGZv\nbGxvd2luZyBjb25kaXRpb25zOgoKVGhlIGFib3ZlIGNvcHlyaWdodCBub3Rp\nY2UgYW5kIHRoaXMgcGVybWlzc2lvbiBub3RpY2Ugc2hhbGwgYmUKaW5jbHVk\nZWQgaW4gYWxsIGNvcGllcyBvciBzdWJzdGFudGlhbCBwb3J0aW9ucyBvZiB0\naGUgU29mdHdhcmUuCgpUSEUgU09GVFdBUkUgSVMgUFJPVklERUQgIkFTIElT\nIiwgV0lUSE9VVCBXQVJSQU5UWSBPRiBBTlkgS0lORCwKRVhQUkVTUyBPUiBJ\nTVBMSUVELCBJTkNMVURJTkcgQlVUIE5PVCBMSU1JVEVEIFRPIFRIRSBXQVJS\nQU5USUVTIE9GCk1FUkNIQU5UQUJJTElUWSwgRklUTkVTUyBGT1IgQSBQQVJU\nSUNVTEFSIFBVUlBPU0UgQU5ECk5PTklORlJJTkdFTUVOVC4gSU4gTk8gRVZF\nTlQgU0hBTEwgVEhFIEFVVEhPUlMgT1IgQ09QWVJJR0hUIEhPTERFUlMgQkUK\nTElBQkxFIEZPUiBBTlkgQ0xBSU0sIERBTUFHRVMgT1IgT1RIRVIgTElBQklM\nSVRZLCBXSEVUSEVSIElOIEFOIEFDVElPTgpPRiBDT05UUkFDVCwgVE9SVCBP\nUiBPVEhFUldJU0UsIEFSSVNJTkcgRlJPTSwgT1VUIE9GIE9SIElOIENPTk5F\nQ1RJT04KV0lUSCBUSEUgU09GVFdBUkUgT1IgVEhFIFVTRSBPUiBPVEhFUiBE\nRUFMSU5HUyBJTiBUSEUgU09GVFdBUkUuCg==\n", + "encoding": "base64", + "_links": { + "self": "https://api.github.com/repos/atom/atom/contents/LICENSE.md?ref=master", + "git": "https://api.github.com/repos/atom/atom/git/blobs/ef355c2dd7ccd13cf3aba8e20522ca8f578d481f", + "html": "https://github.com/atom/atom/blob/master/LICENSE.md" + }, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/__files/user-30af4231-bcac-4e52-8dfe-da122934c709.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/__files/user-30af4231-bcac-4e52-8dfe-da122934c709.json new file mode 100644 index 0000000000..41fc9e3d00 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/__files/user-30af4231-bcac-4e52-8dfe-da122934c709.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 168, + "public_gists": 4, + "followers": 136, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/mappings/repos_atom_atom-2-bd1153.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/mappings/repos_atom_atom-2-bd1153.json new file mode 100644 index 0000000000..47f8c0bffc --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/mappings/repos_atom_atom-2-bd1153.json @@ -0,0 +1,43 @@ +{ + "id": "bd1153cf-7be6-4147-9e7e-e12a0d7789f2", + "name": "repos_atom_atom", + "request": { + "url": "/repos/atom/atom", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "repos_atom_atom-bd1153cf-7be6-4147-9e7e-e12a0d7789f2.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:37 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4572", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"a63d0def5b3c51b1300382b5fe799e08\"", + "Last-Modified": "Fri, 04 Oct 2019 16:36:19 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C16B:6B2D:155EEB9:198D221:5D978181" + } + }, + "uuid": "bd1153cf-7be6-4147-9e7e-e12a0d7789f2", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/mappings/repos_atom_atom_license-3-a0fac7.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/mappings/repos_atom_atom_license-3-a0fac7.json new file mode 100644 index 0000000000..774422d937 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/mappings/repos_atom_atom_license-3-a0fac7.json @@ -0,0 +1,43 @@ +{ + "id": "a0fac733-4d83-4d68-be23-c1c57574ea10", + "name": "repos_atom_atom_license", + "request": { + "url": "/repos/atom/atom/license", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "repos_atom_atom_license-a0fac733-4d83-4d68-be23-c1c57574ea10.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:37 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4571", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"3644815f2f59c056ae2d1b03bf4b63e0\"", + "Last-Modified": "Tue, 24 Sep 2019 20:19:48 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C16B:6B2D:155EECD:198D249:5D978181" + } + }, + "uuid": "a0fac733-4d83-4d68-be23-c1c57574ea10", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/mappings/user-1-30af42.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/mappings/user-1-30af42.json new file mode 100644 index 0000000000..07c02325d5 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseAtom/mappings/user-1-30af42.json @@ -0,0 +1,43 @@ +{ + "id": "30af4231-bcac-4e52-8dfe-da122934c709", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-30af4231-bcac-4e52-8dfe-da122934c709.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:37 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4574", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C16B:6B2D:155EEA1:198D211:5D978181" + } + }, + "uuid": "30af4231-bcac-4e52-8dfe-da122934c709", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/__files/repos_pomes_pomes-7c3e7b36-6930-4804-8d6e-83075abfcde8.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/__files/repos_pomes_pomes-7c3e7b36-6930-4804-8d6e-83075abfcde8.json new file mode 100644 index 0000000000..cfc7decc75 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/__files/repos_pomes_pomes-7c3e7b36-6930-4804-8d6e-83075abfcde8.json @@ -0,0 +1,127 @@ +{ + "id": 54015549, + "node_id": "MDEwOlJlcG9zaXRvcnk1NDAxNTU0OQ==", + "name": "pomes", + "full_name": "pomes/pomes", + "private": false, + "owner": { + "login": "pomes", + "id": 17839846, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjE3ODM5ODQ2", + "avatar_url": "https://avatars3.githubusercontent.com/u/17839846?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/pomes", + "html_url": "https://github.com/pomes", + "followers_url": "https://api.github.com/users/pomes/followers", + "following_url": "https://api.github.com/users/pomes/following{/other_user}", + "gists_url": "https://api.github.com/users/pomes/gists{/gist_id}", + "starred_url": "https://api.github.com/users/pomes/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/pomes/subscriptions", + "organizations_url": "https://api.github.com/users/pomes/orgs", + "repos_url": "https://api.github.com/users/pomes/repos", + "events_url": "https://api.github.com/users/pomes/events{/privacy}", + "received_events_url": "https://api.github.com/users/pomes/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/pomes/pomes", + "description": "Pomes provides a library and tools for locating and reviewing Maven POMs", + "fork": false, + "url": "https://api.github.com/repos/pomes/pomes", + "forks_url": "https://api.github.com/repos/pomes/pomes/forks", + "keys_url": "https://api.github.com/repos/pomes/pomes/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/pomes/pomes/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/pomes/pomes/teams", + "hooks_url": "https://api.github.com/repos/pomes/pomes/hooks", + "issue_events_url": "https://api.github.com/repos/pomes/pomes/issues/events{/number}", + "events_url": "https://api.github.com/repos/pomes/pomes/events", + "assignees_url": "https://api.github.com/repos/pomes/pomes/assignees{/user}", + "branches_url": "https://api.github.com/repos/pomes/pomes/branches{/branch}", + "tags_url": "https://api.github.com/repos/pomes/pomes/tags", + "blobs_url": "https://api.github.com/repos/pomes/pomes/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/pomes/pomes/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/pomes/pomes/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/pomes/pomes/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/pomes/pomes/statuses/{sha}", + "languages_url": "https://api.github.com/repos/pomes/pomes/languages", + "stargazers_url": "https://api.github.com/repos/pomes/pomes/stargazers", + "contributors_url": "https://api.github.com/repos/pomes/pomes/contributors", + "subscribers_url": "https://api.github.com/repos/pomes/pomes/subscribers", + "subscription_url": "https://api.github.com/repos/pomes/pomes/subscription", + "commits_url": "https://api.github.com/repos/pomes/pomes/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/pomes/pomes/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/pomes/pomes/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/pomes/pomes/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/pomes/pomes/contents/{+path}", + "compare_url": "https://api.github.com/repos/pomes/pomes/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/pomes/pomes/merges", + "archive_url": "https://api.github.com/repos/pomes/pomes/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/pomes/pomes/downloads", + "issues_url": "https://api.github.com/repos/pomes/pomes/issues{/number}", + "pulls_url": "https://api.github.com/repos/pomes/pomes/pulls{/number}", + "milestones_url": "https://api.github.com/repos/pomes/pomes/milestones{/number}", + "notifications_url": "https://api.github.com/repos/pomes/pomes/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/pomes/pomes/labels{/name}", + "releases_url": "https://api.github.com/repos/pomes/pomes/releases{/id}", + "deployments_url": "https://api.github.com/repos/pomes/pomes/deployments", + "created_at": "2016-03-16T08:51:08Z", + "updated_at": "2016-06-26T05:41:12Z", + "pushed_at": "2016-08-14T23:17:04Z", + "git_url": "git://github.com/pomes/pomes.git", + "ssh_url": "git@github.com:pomes/pomes.git", + "clone_url": "https://github.com/pomes/pomes.git", + "svn_url": "https://github.com/pomes/pomes", + "homepage": "https://github.com/pomes/pomes/", + "size": 1049, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Groovy", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 8, + "license": { + "key": "apache-2.0", + "name": "Apache License 2.0", + "spdx_id": "Apache-2.0", + "url": "https://api.github.com/licenses/apache-2.0", + "node_id": "MDc6TGljZW5zZTI=" + }, + "forks": 0, + "open_issues": 8, + "watchers": 0, + "default_branch": "master", + "permissions": { + "admin": false, + "push": false, + "pull": true + }, + "organization": { + "login": "pomes", + "id": 17839846, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjE3ODM5ODQ2", + "avatar_url": "https://avatars3.githubusercontent.com/u/17839846?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/pomes", + "html_url": "https://github.com/pomes", + "followers_url": "https://api.github.com/users/pomes/followers", + "following_url": "https://api.github.com/users/pomes/following{/other_user}", + "gists_url": "https://api.github.com/users/pomes/gists{/gist_id}", + "starred_url": "https://api.github.com/users/pomes/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/pomes/subscriptions", + "organizations_url": "https://api.github.com/users/pomes/orgs", + "repos_url": "https://api.github.com/users/pomes/repos", + "events_url": "https://api.github.com/users/pomes/events{/privacy}", + "received_events_url": "https://api.github.com/users/pomes/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 0, + "subscribers_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/__files/repos_pomes_pomes_license-c59d46f6-2c50-4afd-80b6-40dbfa4dd754.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/__files/repos_pomes_pomes_license-c59d46f6-2c50-4afd-80b6-40dbfa4dd754.json new file mode 100644 index 0000000000..34cefa04e1 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/__files/repos_pomes_pomes_license-c59d46f6-2c50-4afd-80b6-40dbfa4dd754.json @@ -0,0 +1,25 @@ +{ + "name": "LICENSE", + "path": "LICENSE", + "sha": "8371492840f9485d7baf719dc2ae3e4cb9e8c03b", + "size": 11361, + "url": "https://api.github.com/repos/pomes/pomes/contents/LICENSE?ref=master", + "html_url": "https://github.com/pomes/pomes/blob/master/LICENSE", + "git_url": "https://api.github.com/repos/pomes/pomes/git/blobs/8371492840f9485d7baf719dc2ae3e4cb9e8c03b", + "download_url": "https://raw.githubusercontent.com/pomes/pomes/master/LICENSE", + "type": "file", + "content": "CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFwYWNoZSBMaWNl\nbnNlCiAgICAgICAgICAgICAgICAgICAgICAgICAgIFZlcnNpb24gMi4wLCBK\nYW51YXJ5IDIwMDQKICAgICAgICAgICAgICAgICAgICAgICAgaHR0cDovL3d3\ndy5hcGFjaGUub3JnL2xpY2Vuc2VzLwoKICAgVEVSTVMgQU5EIENPTkRJVElP\nTlMgRk9SIFVTRSwgUkVQUk9EVUNUSU9OLCBBTkQgRElTVFJJQlVUSU9OCgog\nICAxLiBEZWZpbml0aW9ucy4KCiAgICAgICJMaWNlbnNlIiBzaGFsbCBtZWFu\nIHRoZSB0ZXJtcyBhbmQgY29uZGl0aW9ucyBmb3IgdXNlLCByZXByb2R1Y3Rp\nb24sCiAgICAgIGFuZCBkaXN0cmlidXRpb24gYXMgZGVmaW5lZCBieSBTZWN0\naW9ucyAxIHRocm91Z2ggOSBvZiB0aGlzIGRvY3VtZW50LgoKICAgICAgIkxp\nY2Vuc29yIiBzaGFsbCBtZWFuIHRoZSBjb3B5cmlnaHQgb3duZXIgb3IgZW50\naXR5IGF1dGhvcml6ZWQgYnkKICAgICAgdGhlIGNvcHlyaWdodCBvd25lciB0\naGF0IGlzIGdyYW50aW5nIHRoZSBMaWNlbnNlLgoKICAgICAgIkxlZ2FsIEVu\ndGl0eSIgc2hhbGwgbWVhbiB0aGUgdW5pb24gb2YgdGhlIGFjdGluZyBlbnRp\ndHkgYW5kIGFsbAogICAgICBvdGhlciBlbnRpdGllcyB0aGF0IGNvbnRyb2ws\nIGFyZSBjb250cm9sbGVkIGJ5LCBvciBhcmUgdW5kZXIgY29tbW9uCiAgICAg\nIGNvbnRyb2wgd2l0aCB0aGF0IGVudGl0eS4gRm9yIHRoZSBwdXJwb3NlcyBv\nZiB0aGlzIGRlZmluaXRpb24sCiAgICAgICJjb250cm9sIiBtZWFucyAoaSkg\ndGhlIHBvd2VyLCBkaXJlY3Qgb3IgaW5kaXJlY3QsIHRvIGNhdXNlIHRoZQog\nICAgICBkaXJlY3Rpb24gb3IgbWFuYWdlbWVudCBvZiBzdWNoIGVudGl0eSwg\nd2hldGhlciBieSBjb250cmFjdCBvcgogICAgICBvdGhlcndpc2UsIG9yIChp\naSkgb3duZXJzaGlwIG9mIGZpZnR5IHBlcmNlbnQgKDUwJSkgb3IgbW9yZSBv\nZiB0aGUKICAgICAgb3V0c3RhbmRpbmcgc2hhcmVzLCBvciAoaWlpKSBiZW5l\nZmljaWFsIG93bmVyc2hpcCBvZiBzdWNoIGVudGl0eS4KCiAgICAgICJZb3Ui\nIChvciAiWW91ciIpIHNoYWxsIG1lYW4gYW4gaW5kaXZpZHVhbCBvciBMZWdh\nbCBFbnRpdHkKICAgICAgZXhlcmNpc2luZyBwZXJtaXNzaW9ucyBncmFudGVk\nIGJ5IHRoaXMgTGljZW5zZS4KCiAgICAgICJTb3VyY2UiIGZvcm0gc2hhbGwg\nbWVhbiB0aGUgcHJlZmVycmVkIGZvcm0gZm9yIG1ha2luZyBtb2RpZmljYXRp\nb25zLAogICAgICBpbmNsdWRpbmcgYnV0IG5vdCBsaW1pdGVkIHRvIHNvZnR3\nYXJlIHNvdXJjZSBjb2RlLCBkb2N1bWVudGF0aW9uCiAgICAgIHNvdXJjZSwg\nYW5kIGNvbmZpZ3VyYXRpb24gZmlsZXMuCgogICAgICAiT2JqZWN0IiBmb3Jt\nIHNoYWxsIG1lYW4gYW55IGZvcm0gcmVzdWx0aW5nIGZyb20gbWVjaGFuaWNh\nbAogICAgICB0cmFuc2Zvcm1hdGlvbiBvciB0cmFuc2xhdGlvbiBvZiBhIFNv\ndXJjZSBmb3JtLCBpbmNsdWRpbmcgYnV0CiAgICAgIG5vdCBsaW1pdGVkIHRv\nIGNvbXBpbGVkIG9iamVjdCBjb2RlLCBnZW5lcmF0ZWQgZG9jdW1lbnRhdGlv\nbiwKICAgICAgYW5kIGNvbnZlcnNpb25zIHRvIG90aGVyIG1lZGlhIHR5cGVz\nLgoKICAgICAgIldvcmsiIHNoYWxsIG1lYW4gdGhlIHdvcmsgb2YgYXV0aG9y\nc2hpcCwgd2hldGhlciBpbiBTb3VyY2Ugb3IKICAgICAgT2JqZWN0IGZvcm0s\nIG1hZGUgYXZhaWxhYmxlIHVuZGVyIHRoZSBMaWNlbnNlLCBhcyBpbmRpY2F0\nZWQgYnkgYQogICAgICBjb3B5cmlnaHQgbm90aWNlIHRoYXQgaXMgaW5jbHVk\nZWQgaW4gb3IgYXR0YWNoZWQgdG8gdGhlIHdvcmsKICAgICAgKGFuIGV4YW1w\nbGUgaXMgcHJvdmlkZWQgaW4gdGhlIEFwcGVuZGl4IGJlbG93KS4KCiAgICAg\nICJEZXJpdmF0aXZlIFdvcmtzIiBzaGFsbCBtZWFuIGFueSB3b3JrLCB3aGV0\naGVyIGluIFNvdXJjZSBvciBPYmplY3QKICAgICAgZm9ybSwgdGhhdCBpcyBi\nYXNlZCBvbiAob3IgZGVyaXZlZCBmcm9tKSB0aGUgV29yayBhbmQgZm9yIHdo\naWNoIHRoZQogICAgICBlZGl0b3JpYWwgcmV2aXNpb25zLCBhbm5vdGF0aW9u\ncywgZWxhYm9yYXRpb25zLCBvciBvdGhlciBtb2RpZmljYXRpb25zCiAgICAg\nIHJlcHJlc2VudCwgYXMgYSB3aG9sZSwgYW4gb3JpZ2luYWwgd29yayBvZiBh\ndXRob3JzaGlwLiBGb3IgdGhlIHB1cnBvc2VzCiAgICAgIG9mIHRoaXMgTGlj\nZW5zZSwgRGVyaXZhdGl2ZSBXb3JrcyBzaGFsbCBub3QgaW5jbHVkZSB3b3Jr\ncyB0aGF0IHJlbWFpbgogICAgICBzZXBhcmFibGUgZnJvbSwgb3IgbWVyZWx5\nIGxpbmsgKG9yIGJpbmQgYnkgdmFsdWUpIHRvIHRoZSBpbnRlcmZhY2VzIG9m\nLAogICAgICB0aGUgV29yayBhbmQgRGVyaXZhdGl2ZSBXb3JrcyB0aGVyZW9m\nLgoKICAgICAgIkNvbnRyaWJ1dGlvbiIgc2hhbGwgbWVhbiBhbnkgd29yayBv\nZiBhdXRob3JzaGlwLCBpbmNsdWRpbmcKICAgICAgdGhlIG9yaWdpbmFsIHZl\ncnNpb24gb2YgdGhlIFdvcmsgYW5kIGFueSBtb2RpZmljYXRpb25zIG9yIGFk\nZGl0aW9ucwogICAgICB0byB0aGF0IFdvcmsgb3IgRGVyaXZhdGl2ZSBXb3Jr\ncyB0aGVyZW9mLCB0aGF0IGlzIGludGVudGlvbmFsbHkKICAgICAgc3VibWl0\ndGVkIHRvIExpY2Vuc29yIGZvciBpbmNsdXNpb24gaW4gdGhlIFdvcmsgYnkg\ndGhlIGNvcHlyaWdodCBvd25lcgogICAgICBvciBieSBhbiBpbmRpdmlkdWFs\nIG9yIExlZ2FsIEVudGl0eSBhdXRob3JpemVkIHRvIHN1Ym1pdCBvbiBiZWhh\nbGYgb2YKICAgICAgdGhlIGNvcHlyaWdodCBvd25lci4gRm9yIHRoZSBwdXJw\nb3NlcyBvZiB0aGlzIGRlZmluaXRpb24sICJzdWJtaXR0ZWQiCiAgICAgIG1l\nYW5zIGFueSBmb3JtIG9mIGVsZWN0cm9uaWMsIHZlcmJhbCwgb3Igd3JpdHRl\nbiBjb21tdW5pY2F0aW9uIHNlbnQKICAgICAgdG8gdGhlIExpY2Vuc29yIG9y\nIGl0cyByZXByZXNlbnRhdGl2ZXMsIGluY2x1ZGluZyBidXQgbm90IGxpbWl0\nZWQgdG8KICAgICAgY29tbXVuaWNhdGlvbiBvbiBlbGVjdHJvbmljIG1haWxp\nbmcgbGlzdHMsIHNvdXJjZSBjb2RlIGNvbnRyb2wgc3lzdGVtcywKICAgICAg\nYW5kIGlzc3VlIHRyYWNraW5nIHN5c3RlbXMgdGhhdCBhcmUgbWFuYWdlZCBi\neSwgb3Igb24gYmVoYWxmIG9mLCB0aGUKICAgICAgTGljZW5zb3IgZm9yIHRo\nZSBwdXJwb3NlIG9mIGRpc2N1c3NpbmcgYW5kIGltcHJvdmluZyB0aGUgV29y\naywgYnV0CiAgICAgIGV4Y2x1ZGluZyBjb21tdW5pY2F0aW9uIHRoYXQgaXMg\nY29uc3BpY3VvdXNseSBtYXJrZWQgb3Igb3RoZXJ3aXNlCiAgICAgIGRlc2ln\nbmF0ZWQgaW4gd3JpdGluZyBieSB0aGUgY29weXJpZ2h0IG93bmVyIGFzICJO\nb3QgYSBDb250cmlidXRpb24uIgoKICAgICAgIkNvbnRyaWJ1dG9yIiBzaGFs\nbCBtZWFuIExpY2Vuc29yIGFuZCBhbnkgaW5kaXZpZHVhbCBvciBMZWdhbCBF\nbnRpdHkKICAgICAgb24gYmVoYWxmIG9mIHdob20gYSBDb250cmlidXRpb24g\naGFzIGJlZW4gcmVjZWl2ZWQgYnkgTGljZW5zb3IgYW5kCiAgICAgIHN1YnNl\ncXVlbnRseSBpbmNvcnBvcmF0ZWQgd2l0aGluIHRoZSBXb3JrLgoKICAgMi4g\nR3JhbnQgb2YgQ29weXJpZ2h0IExpY2Vuc2UuIFN1YmplY3QgdG8gdGhlIHRl\ncm1zIGFuZCBjb25kaXRpb25zIG9mCiAgICAgIHRoaXMgTGljZW5zZSwgZWFj\naCBDb250cmlidXRvciBoZXJlYnkgZ3JhbnRzIHRvIFlvdSBhIHBlcnBldHVh\nbCwKICAgICAgd29ybGR3aWRlLCBub24tZXhjbHVzaXZlLCBuby1jaGFyZ2Us\nIHJveWFsdHktZnJlZSwgaXJyZXZvY2FibGUKICAgICAgY29weXJpZ2h0IGxp\nY2Vuc2UgdG8gcmVwcm9kdWNlLCBwcmVwYXJlIERlcml2YXRpdmUgV29ya3Mg\nb2YsCiAgICAgIHB1YmxpY2x5IGRpc3BsYXksIHB1YmxpY2x5IHBlcmZvcm0s\nIHN1YmxpY2Vuc2UsIGFuZCBkaXN0cmlidXRlIHRoZQogICAgICBXb3JrIGFu\nZCBzdWNoIERlcml2YXRpdmUgV29ya3MgaW4gU291cmNlIG9yIE9iamVjdCBm\nb3JtLgoKICAgMy4gR3JhbnQgb2YgUGF0ZW50IExpY2Vuc2UuIFN1YmplY3Qg\ndG8gdGhlIHRlcm1zIGFuZCBjb25kaXRpb25zIG9mCiAgICAgIHRoaXMgTGlj\nZW5zZSwgZWFjaCBDb250cmlidXRvciBoZXJlYnkgZ3JhbnRzIHRvIFlvdSBh\nIHBlcnBldHVhbCwKICAgICAgd29ybGR3aWRlLCBub24tZXhjbHVzaXZlLCBu\nby1jaGFyZ2UsIHJveWFsdHktZnJlZSwgaXJyZXZvY2FibGUKICAgICAgKGV4\nY2VwdCBhcyBzdGF0ZWQgaW4gdGhpcyBzZWN0aW9uKSBwYXRlbnQgbGljZW5z\nZSB0byBtYWtlLCBoYXZlIG1hZGUsCiAgICAgIHVzZSwgb2ZmZXIgdG8gc2Vs\nbCwgc2VsbCwgaW1wb3J0LCBhbmQgb3RoZXJ3aXNlIHRyYW5zZmVyIHRoZSBX\nb3JrLAogICAgICB3aGVyZSBzdWNoIGxpY2Vuc2UgYXBwbGllcyBvbmx5IHRv\nIHRob3NlIHBhdGVudCBjbGFpbXMgbGljZW5zYWJsZQogICAgICBieSBzdWNo\nIENvbnRyaWJ1dG9yIHRoYXQgYXJlIG5lY2Vzc2FyaWx5IGluZnJpbmdlZCBi\neSB0aGVpcgogICAgICBDb250cmlidXRpb24ocykgYWxvbmUgb3IgYnkgY29t\nYmluYXRpb24gb2YgdGhlaXIgQ29udHJpYnV0aW9uKHMpCiAgICAgIHdpdGgg\ndGhlIFdvcmsgdG8gd2hpY2ggc3VjaCBDb250cmlidXRpb24ocykgd2FzIHN1\nYm1pdHRlZC4gSWYgWW91CiAgICAgIGluc3RpdHV0ZSBwYXRlbnQgbGl0aWdh\ndGlvbiBhZ2FpbnN0IGFueSBlbnRpdHkgKGluY2x1ZGluZyBhCiAgICAgIGNy\nb3NzLWNsYWltIG9yIGNvdW50ZXJjbGFpbSBpbiBhIGxhd3N1aXQpIGFsbGVn\naW5nIHRoYXQgdGhlIFdvcmsKICAgICAgb3IgYSBDb250cmlidXRpb24gaW5j\nb3Jwb3JhdGVkIHdpdGhpbiB0aGUgV29yayBjb25zdGl0dXRlcyBkaXJlY3QK\nICAgICAgb3IgY29udHJpYnV0b3J5IHBhdGVudCBpbmZyaW5nZW1lbnQsIHRo\nZW4gYW55IHBhdGVudCBsaWNlbnNlcwogICAgICBncmFudGVkIHRvIFlvdSB1\nbmRlciB0aGlzIExpY2Vuc2UgZm9yIHRoYXQgV29yayBzaGFsbCB0ZXJtaW5h\ndGUKICAgICAgYXMgb2YgdGhlIGRhdGUgc3VjaCBsaXRpZ2F0aW9uIGlzIGZp\nbGVkLgoKICAgNC4gUmVkaXN0cmlidXRpb24uIFlvdSBtYXkgcmVwcm9kdWNl\nIGFuZCBkaXN0cmlidXRlIGNvcGllcyBvZiB0aGUKICAgICAgV29yayBvciBE\nZXJpdmF0aXZlIFdvcmtzIHRoZXJlb2YgaW4gYW55IG1lZGl1bSwgd2l0aCBv\nciB3aXRob3V0CiAgICAgIG1vZGlmaWNhdGlvbnMsIGFuZCBpbiBTb3VyY2Ug\nb3IgT2JqZWN0IGZvcm0sIHByb3ZpZGVkIHRoYXQgWW91CiAgICAgIG1lZXQg\ndGhlIGZvbGxvd2luZyBjb25kaXRpb25zOgoKICAgICAgKGEpIFlvdSBtdXN0\nIGdpdmUgYW55IG90aGVyIHJlY2lwaWVudHMgb2YgdGhlIFdvcmsgb3IKICAg\nICAgICAgIERlcml2YXRpdmUgV29ya3MgYSBjb3B5IG9mIHRoaXMgTGljZW5z\nZTsgYW5kCgogICAgICAoYikgWW91IG11c3QgY2F1c2UgYW55IG1vZGlmaWVk\nIGZpbGVzIHRvIGNhcnJ5IHByb21pbmVudCBub3RpY2VzCiAgICAgICAgICBz\ndGF0aW5nIHRoYXQgWW91IGNoYW5nZWQgdGhlIGZpbGVzOyBhbmQKCiAgICAg\nIChjKSBZb3UgbXVzdCByZXRhaW4sIGluIHRoZSBTb3VyY2UgZm9ybSBvZiBh\nbnkgRGVyaXZhdGl2ZSBXb3JrcwogICAgICAgICAgdGhhdCBZb3UgZGlzdHJp\nYnV0ZSwgYWxsIGNvcHlyaWdodCwgcGF0ZW50LCB0cmFkZW1hcmssIGFuZAog\nICAgICAgICAgYXR0cmlidXRpb24gbm90aWNlcyBmcm9tIHRoZSBTb3VyY2Ug\nZm9ybSBvZiB0aGUgV29yaywKICAgICAgICAgIGV4Y2x1ZGluZyB0aG9zZSBu\nb3RpY2VzIHRoYXQgZG8gbm90IHBlcnRhaW4gdG8gYW55IHBhcnQgb2YKICAg\nICAgICAgIHRoZSBEZXJpdmF0aXZlIFdvcmtzOyBhbmQKCiAgICAgIChkKSBJ\nZiB0aGUgV29yayBpbmNsdWRlcyBhICJOT1RJQ0UiIHRleHQgZmlsZSBhcyBw\nYXJ0IG9mIGl0cwogICAgICAgICAgZGlzdHJpYnV0aW9uLCB0aGVuIGFueSBE\nZXJpdmF0aXZlIFdvcmtzIHRoYXQgWW91IGRpc3RyaWJ1dGUgbXVzdAogICAg\nICAgICAgaW5jbHVkZSBhIHJlYWRhYmxlIGNvcHkgb2YgdGhlIGF0dHJpYnV0\naW9uIG5vdGljZXMgY29udGFpbmVkCiAgICAgICAgICB3aXRoaW4gc3VjaCBO\nT1RJQ0UgZmlsZSwgZXhjbHVkaW5nIHRob3NlIG5vdGljZXMgdGhhdCBkbyBu\nb3QKICAgICAgICAgIHBlcnRhaW4gdG8gYW55IHBhcnQgb2YgdGhlIERlcml2\nYXRpdmUgV29ya3MsIGluIGF0IGxlYXN0IG9uZQogICAgICAgICAgb2YgdGhl\nIGZvbGxvd2luZyBwbGFjZXM6IHdpdGhpbiBhIE5PVElDRSB0ZXh0IGZpbGUg\nZGlzdHJpYnV0ZWQKICAgICAgICAgIGFzIHBhcnQgb2YgdGhlIERlcml2YXRp\ndmUgV29ya3M7IHdpdGhpbiB0aGUgU291cmNlIGZvcm0gb3IKICAgICAgICAg\nIGRvY3VtZW50YXRpb24sIGlmIHByb3ZpZGVkIGFsb25nIHdpdGggdGhlIERl\ncml2YXRpdmUgV29ya3M7IG9yLAogICAgICAgICAgd2l0aGluIGEgZGlzcGxh\neSBnZW5lcmF0ZWQgYnkgdGhlIERlcml2YXRpdmUgV29ya3MsIGlmIGFuZAog\nICAgICAgICAgd2hlcmV2ZXIgc3VjaCB0aGlyZC1wYXJ0eSBub3RpY2VzIG5v\ncm1hbGx5IGFwcGVhci4gVGhlIGNvbnRlbnRzCiAgICAgICAgICBvZiB0aGUg\nTk9USUNFIGZpbGUgYXJlIGZvciBpbmZvcm1hdGlvbmFsIHB1cnBvc2VzIG9u\nbHkgYW5kCiAgICAgICAgICBkbyBub3QgbW9kaWZ5IHRoZSBMaWNlbnNlLiBZ\nb3UgbWF5IGFkZCBZb3VyIG93biBhdHRyaWJ1dGlvbgogICAgICAgICAgbm90\naWNlcyB3aXRoaW4gRGVyaXZhdGl2ZSBXb3JrcyB0aGF0IFlvdSBkaXN0cmli\ndXRlLCBhbG9uZ3NpZGUKICAgICAgICAgIG9yIGFzIGFuIGFkZGVuZHVtIHRv\nIHRoZSBOT1RJQ0UgdGV4dCBmcm9tIHRoZSBXb3JrLCBwcm92aWRlZAogICAg\nICAgICAgdGhhdCBzdWNoIGFkZGl0aW9uYWwgYXR0cmlidXRpb24gbm90aWNl\ncyBjYW5ub3QgYmUgY29uc3RydWVkCiAgICAgICAgICBhcyBtb2RpZnlpbmcg\ndGhlIExpY2Vuc2UuCgogICAgICBZb3UgbWF5IGFkZCBZb3VyIG93biBjb3B5\ncmlnaHQgc3RhdGVtZW50IHRvIFlvdXIgbW9kaWZpY2F0aW9ucyBhbmQKICAg\nICAgbWF5IHByb3ZpZGUgYWRkaXRpb25hbCBvciBkaWZmZXJlbnQgbGljZW5z\nZSB0ZXJtcyBhbmQgY29uZGl0aW9ucwogICAgICBmb3IgdXNlLCByZXByb2R1\nY3Rpb24sIG9yIGRpc3RyaWJ1dGlvbiBvZiBZb3VyIG1vZGlmaWNhdGlvbnMs\nIG9yCiAgICAgIGZvciBhbnkgc3VjaCBEZXJpdmF0aXZlIFdvcmtzIGFzIGEg\nd2hvbGUsIHByb3ZpZGVkIFlvdXIgdXNlLAogICAgICByZXByb2R1Y3Rpb24s\nIGFuZCBkaXN0cmlidXRpb24gb2YgdGhlIFdvcmsgb3RoZXJ3aXNlIGNvbXBs\naWVzIHdpdGgKICAgICAgdGhlIGNvbmRpdGlvbnMgc3RhdGVkIGluIHRoaXMg\nTGljZW5zZS4KCiAgIDUuIFN1Ym1pc3Npb24gb2YgQ29udHJpYnV0aW9ucy4g\nVW5sZXNzIFlvdSBleHBsaWNpdGx5IHN0YXRlIG90aGVyd2lzZSwKICAgICAg\nYW55IENvbnRyaWJ1dGlvbiBpbnRlbnRpb25hbGx5IHN1Ym1pdHRlZCBmb3Ig\naW5jbHVzaW9uIGluIHRoZSBXb3JrCiAgICAgIGJ5IFlvdSB0byB0aGUgTGlj\nZW5zb3Igc2hhbGwgYmUgdW5kZXIgdGhlIHRlcm1zIGFuZCBjb25kaXRpb25z\nIG9mCiAgICAgIHRoaXMgTGljZW5zZSwgd2l0aG91dCBhbnkgYWRkaXRpb25h\nbCB0ZXJtcyBvciBjb25kaXRpb25zLgogICAgICBOb3R3aXRoc3RhbmRpbmcg\ndGhlIGFib3ZlLCBub3RoaW5nIGhlcmVpbiBzaGFsbCBzdXBlcnNlZGUgb3Ig\nbW9kaWZ5CiAgICAgIHRoZSB0ZXJtcyBvZiBhbnkgc2VwYXJhdGUgbGljZW5z\nZSBhZ3JlZW1lbnQgeW91IG1heSBoYXZlIGV4ZWN1dGVkCiAgICAgIHdpdGgg\nTGljZW5zb3IgcmVnYXJkaW5nIHN1Y2ggQ29udHJpYnV0aW9ucy4KCiAgIDYu\nIFRyYWRlbWFya3MuIFRoaXMgTGljZW5zZSBkb2VzIG5vdCBncmFudCBwZXJt\naXNzaW9uIHRvIHVzZSB0aGUgdHJhZGUKICAgICAgbmFtZXMsIHRyYWRlbWFy\na3MsIHNlcnZpY2UgbWFya3MsIG9yIHByb2R1Y3QgbmFtZXMgb2YgdGhlIExp\nY2Vuc29yLAogICAgICBleGNlcHQgYXMgcmVxdWlyZWQgZm9yIHJlYXNvbmFi\nbGUgYW5kIGN1c3RvbWFyeSB1c2UgaW4gZGVzY3JpYmluZyB0aGUKICAgICAg\nb3JpZ2luIG9mIHRoZSBXb3JrIGFuZCByZXByb2R1Y2luZyB0aGUgY29udGVu\ndCBvZiB0aGUgTk9USUNFIGZpbGUuCgogICA3LiBEaXNjbGFpbWVyIG9mIFdh\ncnJhbnR5LiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IK\nICAgICAgYWdyZWVkIHRvIGluIHdyaXRpbmcsIExpY2Vuc29yIHByb3ZpZGVz\nIHRoZSBXb3JrIChhbmQgZWFjaAogICAgICBDb250cmlidXRvciBwcm92aWRl\ncyBpdHMgQ29udHJpYnV0aW9ucykgb24gYW4gIkFTIElTIiBCQVNJUywKICAg\nICAgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJ\nTkQsIGVpdGhlciBleHByZXNzIG9yCiAgICAgIGltcGxpZWQsIGluY2x1ZGlu\nZywgd2l0aG91dCBsaW1pdGF0aW9uLCBhbnkgd2FycmFudGllcyBvciBjb25k\naXRpb25zCiAgICAgIG9mIFRJVExFLCBOT04tSU5GUklOR0VNRU5ULCBNRVJD\nSEFOVEFCSUxJVFksIG9yIEZJVE5FU1MgRk9SIEEKICAgICAgUEFSVElDVUxB\nUiBQVVJQT1NFLiBZb3UgYXJlIHNvbGVseSByZXNwb25zaWJsZSBmb3IgZGV0\nZXJtaW5pbmcgdGhlCiAgICAgIGFwcHJvcHJpYXRlbmVzcyBvZiB1c2luZyBv\nciByZWRpc3RyaWJ1dGluZyB0aGUgV29yayBhbmQgYXNzdW1lIGFueQogICAg\nICByaXNrcyBhc3NvY2lhdGVkIHdpdGggWW91ciBleGVyY2lzZSBvZiBwZXJt\naXNzaW9ucyB1bmRlciB0aGlzIExpY2Vuc2UuCgogICA4LiBMaW1pdGF0aW9u\nIG9mIExpYWJpbGl0eS4gSW4gbm8gZXZlbnQgYW5kIHVuZGVyIG5vIGxlZ2Fs\nIHRoZW9yeSwKICAgICAgd2hldGhlciBpbiB0b3J0IChpbmNsdWRpbmcgbmVn\nbGlnZW5jZSksIGNvbnRyYWN0LCBvciBvdGhlcndpc2UsCiAgICAgIHVubGVz\ncyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyAoc3VjaCBhcyBkZWxpYmVy\nYXRlIGFuZCBncm9zc2x5CiAgICAgIG5lZ2xpZ2VudCBhY3RzKSBvciBhZ3Jl\nZWQgdG8gaW4gd3JpdGluZywgc2hhbGwgYW55IENvbnRyaWJ1dG9yIGJlCiAg\nICAgIGxpYWJsZSB0byBZb3UgZm9yIGRhbWFnZXMsIGluY2x1ZGluZyBhbnkg\nZGlyZWN0LCBpbmRpcmVjdCwgc3BlY2lhbCwKICAgICAgaW5jaWRlbnRhbCwg\nb3IgY29uc2VxdWVudGlhbCBkYW1hZ2VzIG9mIGFueSBjaGFyYWN0ZXIgYXJp\nc2luZyBhcyBhCiAgICAgIHJlc3VsdCBvZiB0aGlzIExpY2Vuc2Ugb3Igb3V0\nIG9mIHRoZSB1c2Ugb3IgaW5hYmlsaXR5IHRvIHVzZSB0aGUKICAgICAgV29y\nayAoaW5jbHVkaW5nIGJ1dCBub3QgbGltaXRlZCB0byBkYW1hZ2VzIGZvciBs\nb3NzIG9mIGdvb2R3aWxsLAogICAgICB3b3JrIHN0b3BwYWdlLCBjb21wdXRl\nciBmYWlsdXJlIG9yIG1hbGZ1bmN0aW9uLCBvciBhbnkgYW5kIGFsbAogICAg\nICBvdGhlciBjb21tZXJjaWFsIGRhbWFnZXMgb3IgbG9zc2VzKSwgZXZlbiBp\nZiBzdWNoIENvbnRyaWJ1dG9yCiAgICAgIGhhcyBiZWVuIGFkdmlzZWQgb2Yg\ndGhlIHBvc3NpYmlsaXR5IG9mIHN1Y2ggZGFtYWdlcy4KCiAgIDkuIEFjY2Vw\ndGluZyBXYXJyYW50eSBvciBBZGRpdGlvbmFsIExpYWJpbGl0eS4gV2hpbGUg\ncmVkaXN0cmlidXRpbmcKICAgICAgdGhlIFdvcmsgb3IgRGVyaXZhdGl2ZSBX\nb3JrcyB0aGVyZW9mLCBZb3UgbWF5IGNob29zZSB0byBvZmZlciwKICAgICAg\nYW5kIGNoYXJnZSBhIGZlZSBmb3IsIGFjY2VwdGFuY2Ugb2Ygc3VwcG9ydCwg\nd2FycmFudHksIGluZGVtbml0eSwKICAgICAgb3Igb3RoZXIgbGlhYmlsaXR5\nIG9ibGlnYXRpb25zIGFuZC9vciByaWdodHMgY29uc2lzdGVudCB3aXRoIHRo\naXMKICAgICAgTGljZW5zZS4gSG93ZXZlciwgaW4gYWNjZXB0aW5nIHN1Y2gg\nb2JsaWdhdGlvbnMsIFlvdSBtYXkgYWN0IG9ubHkKICAgICAgb24gWW91ciBv\nd24gYmVoYWxmIGFuZCBvbiBZb3VyIHNvbGUgcmVzcG9uc2liaWxpdHksIG5v\ndCBvbiBiZWhhbGYKICAgICAgb2YgYW55IG90aGVyIENvbnRyaWJ1dG9yLCBh\nbmQgb25seSBpZiBZb3UgYWdyZWUgdG8gaW5kZW1uaWZ5LAogICAgICBkZWZl\nbmQsIGFuZCBob2xkIGVhY2ggQ29udHJpYnV0b3IgaGFybWxlc3MgZm9yIGFu\neSBsaWFiaWxpdHkKICAgICAgaW5jdXJyZWQgYnksIG9yIGNsYWltcyBhc3Nl\ncnRlZCBhZ2FpbnN0LCBzdWNoIENvbnRyaWJ1dG9yIGJ5IHJlYXNvbgogICAg\nICBvZiB5b3VyIGFjY2VwdGluZyBhbnkgc3VjaCB3YXJyYW50eSBvciBhZGRp\ndGlvbmFsIGxpYWJpbGl0eS4KCiAgIEVORCBPRiBURVJNUyBBTkQgQ09ORElU\nSU9OUwoKICAgQVBQRU5ESVg6IEhvdyB0byBhcHBseSB0aGUgQXBhY2hlIExp\nY2Vuc2UgdG8geW91ciB3b3JrLgoKICAgICAgVG8gYXBwbHkgdGhlIEFwYWNo\nZSBMaWNlbnNlIHRvIHlvdXIgd29yaywgYXR0YWNoIHRoZSBmb2xsb3dpbmcK\nICAgICAgYm9pbGVycGxhdGUgbm90aWNlLCB3aXRoIHRoZSBmaWVsZHMgZW5j\nbG9zZWQgYnkgYnJhY2tldHMgIltdIgogICAgICByZXBsYWNlZCB3aXRoIHlv\ndXIgb3duIGlkZW50aWZ5aW5nIGluZm9ybWF0aW9uLiAoRG9uJ3QgaW5jbHVk\nZQogICAgICB0aGUgYnJhY2tldHMhKSAgVGhlIHRleHQgc2hvdWxkIGJlIGVu\nY2xvc2VkIGluIHRoZSBhcHByb3ByaWF0ZQogICAgICBjb21tZW50IHN5bnRh\neCBmb3IgdGhlIGZpbGUgZm9ybWF0LiBXZSBhbHNvIHJlY29tbWVuZCB0aGF0\nIGEKICAgICAgZmlsZSBvciBjbGFzcyB2YWx1ZSBhbmQgZGVzY3JpcHRpb24g\nb2YgcHVycG9zZSBiZSBpbmNsdWRlZCBvbiB0aGUKICAgICAgc2FtZSAicHJp\nbnRlZCBwYWdlIiBhcyB0aGUgY29weXJpZ2h0IG5vdGljZSBmb3IgZWFzaWVy\nCiAgICAgIGlkZW50aWZpY2F0aW9uIHdpdGhpbiB0aGlyZC1wYXJ0eSBhcmNo\naXZlcy4KCiAgIENvcHlyaWdodCBbeXl5eV0gW3ZhbHVlIG9mIGNvcHlyaWdo\ndCBvd25lcl0KCiAgIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5z\nZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOwogICB5b3UgbWF5IG5v\ndCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhl\nIExpY2Vuc2UuCiAgIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGlj\nZW5zZSBhdAoKICAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNl\ncy9MSUNFTlNFLTIuMAoKICAgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2Fi\nbGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQogICBk\naXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBv\nbiBhbiAiQVMgSVMiIEJBU0lTLAogICBXSVRIT1VUIFdBUlJBTlRJRVMgT1Ig\nQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1w\nbGllZC4KICAgU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFu\nZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAogICBsaW1pdGF0aW9u\ncyB1bmRlciB0aGUgTGljZW5zZS4K\n", + "encoding": "base64", + "_links": { + "self": "https://api.github.com/repos/pomes/pomes/contents/LICENSE?ref=master", + "git": "https://api.github.com/repos/pomes/pomes/git/blobs/8371492840f9485d7baf719dc2ae3e4cb9e8c03b", + "html": "https://github.com/pomes/pomes/blob/master/LICENSE" + }, + "license": { + "key": "apache-2.0", + "name": "Apache License 2.0", + "spdx_id": "Apache-2.0", + "url": "https://api.github.com/licenses/apache-2.0", + "node_id": "MDc6TGljZW5zZTI=" + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/__files/user-767d6575-bd87-4641-a940-a567ff936667.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/__files/user-767d6575-bd87-4641-a940-a567ff936667.json new file mode 100644 index 0000000000..41fc9e3d00 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/__files/user-767d6575-bd87-4641-a940-a567ff936667.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 168, + "public_gists": 4, + "followers": 136, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/mappings/repos_pomes_pomes-2-7c3e7b.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/mappings/repos_pomes_pomes-2-7c3e7b.json new file mode 100644 index 0000000000..2771b8c27a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/mappings/repos_pomes_pomes-2-7c3e7b.json @@ -0,0 +1,43 @@ +{ + "id": "7c3e7b36-6930-4804-8d6e-83075abfcde8", + "name": "repos_pomes_pomes", + "request": { + "url": "/repos/pomes/pomes", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "repos_pomes_pomes-7c3e7b36-6930-4804-8d6e-83075abfcde8.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:36 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4576", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"66e425cde189cc71851c3869a89f8541\"", + "Last-Modified": "Sun, 26 Jun 2016 05:41:12 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C167:78ED:1CE7E5A:2277637:5D978180" + } + }, + "uuid": "7c3e7b36-6930-4804-8d6e-83075abfcde8", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/mappings/repos_pomes_pomes_license-3-c59d46.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/mappings/repos_pomes_pomes_license-3-c59d46.json new file mode 100644 index 0000000000..2f6f97ae41 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/mappings/repos_pomes_pomes_license-3-c59d46.json @@ -0,0 +1,43 @@ +{ + "id": "c59d46f6-2c50-4afd-80b6-40dbfa4dd754", + "name": "repos_pomes_pomes_license", + "request": { + "url": "/repos/pomes/pomes/license", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "repos_pomes_pomes_license-c59d46f6-2c50-4afd-80b6-40dbfa4dd754.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:36 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4575", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"9c9e74dccdac3dc6904a9b3926a63906\"", + "Last-Modified": "Sun, 14 Aug 2016 23:16:59 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C167:78ED:1CE7E70:2277667:5D978180" + } + }, + "uuid": "c59d46f6-2c50-4afd-80b6-40dbfa4dd754", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/mappings/user-1-767d65.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/mappings/user-1-767d65.json new file mode 100644 index 0000000000..fa06ce977e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent/mappings/user-1-767d65.json @@ -0,0 +1,43 @@ +{ + "id": "767d6575-bd87-4641-a940-a567ff936667", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-767d6575-bd87-4641-a940-a567ff936667.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:36 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4578", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C167:78ED:1CE7E34:2277624:5D978180" + } + }, + "uuid": "767d6575-bd87-4641-a940-a567ff936667", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/__files/repos_pomes_pomes-c9deed07-bd75-4016-bc8e-ee09b582b604.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/__files/repos_pomes_pomes-c9deed07-bd75-4016-bc8e-ee09b582b604.json new file mode 100644 index 0000000000..cfc7decc75 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/__files/repos_pomes_pomes-c9deed07-bd75-4016-bc8e-ee09b582b604.json @@ -0,0 +1,127 @@ +{ + "id": 54015549, + "node_id": "MDEwOlJlcG9zaXRvcnk1NDAxNTU0OQ==", + "name": "pomes", + "full_name": "pomes/pomes", + "private": false, + "owner": { + "login": "pomes", + "id": 17839846, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjE3ODM5ODQ2", + "avatar_url": "https://avatars3.githubusercontent.com/u/17839846?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/pomes", + "html_url": "https://github.com/pomes", + "followers_url": "https://api.github.com/users/pomes/followers", + "following_url": "https://api.github.com/users/pomes/following{/other_user}", + "gists_url": "https://api.github.com/users/pomes/gists{/gist_id}", + "starred_url": "https://api.github.com/users/pomes/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/pomes/subscriptions", + "organizations_url": "https://api.github.com/users/pomes/orgs", + "repos_url": "https://api.github.com/users/pomes/repos", + "events_url": "https://api.github.com/users/pomes/events{/privacy}", + "received_events_url": "https://api.github.com/users/pomes/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/pomes/pomes", + "description": "Pomes provides a library and tools for locating and reviewing Maven POMs", + "fork": false, + "url": "https://api.github.com/repos/pomes/pomes", + "forks_url": "https://api.github.com/repos/pomes/pomes/forks", + "keys_url": "https://api.github.com/repos/pomes/pomes/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/pomes/pomes/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/pomes/pomes/teams", + "hooks_url": "https://api.github.com/repos/pomes/pomes/hooks", + "issue_events_url": "https://api.github.com/repos/pomes/pomes/issues/events{/number}", + "events_url": "https://api.github.com/repos/pomes/pomes/events", + "assignees_url": "https://api.github.com/repos/pomes/pomes/assignees{/user}", + "branches_url": "https://api.github.com/repos/pomes/pomes/branches{/branch}", + "tags_url": "https://api.github.com/repos/pomes/pomes/tags", + "blobs_url": "https://api.github.com/repos/pomes/pomes/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/pomes/pomes/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/pomes/pomes/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/pomes/pomes/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/pomes/pomes/statuses/{sha}", + "languages_url": "https://api.github.com/repos/pomes/pomes/languages", + "stargazers_url": "https://api.github.com/repos/pomes/pomes/stargazers", + "contributors_url": "https://api.github.com/repos/pomes/pomes/contributors", + "subscribers_url": "https://api.github.com/repos/pomes/pomes/subscribers", + "subscription_url": "https://api.github.com/repos/pomes/pomes/subscription", + "commits_url": "https://api.github.com/repos/pomes/pomes/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/pomes/pomes/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/pomes/pomes/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/pomes/pomes/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/pomes/pomes/contents/{+path}", + "compare_url": "https://api.github.com/repos/pomes/pomes/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/pomes/pomes/merges", + "archive_url": "https://api.github.com/repos/pomes/pomes/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/pomes/pomes/downloads", + "issues_url": "https://api.github.com/repos/pomes/pomes/issues{/number}", + "pulls_url": "https://api.github.com/repos/pomes/pomes/pulls{/number}", + "milestones_url": "https://api.github.com/repos/pomes/pomes/milestones{/number}", + "notifications_url": "https://api.github.com/repos/pomes/pomes/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/pomes/pomes/labels{/name}", + "releases_url": "https://api.github.com/repos/pomes/pomes/releases{/id}", + "deployments_url": "https://api.github.com/repos/pomes/pomes/deployments", + "created_at": "2016-03-16T08:51:08Z", + "updated_at": "2016-06-26T05:41:12Z", + "pushed_at": "2016-08-14T23:17:04Z", + "git_url": "git://github.com/pomes/pomes.git", + "ssh_url": "git@github.com:pomes/pomes.git", + "clone_url": "https://github.com/pomes/pomes.git", + "svn_url": "https://github.com/pomes/pomes", + "homepage": "https://github.com/pomes/pomes/", + "size": 1049, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Groovy", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 8, + "license": { + "key": "apache-2.0", + "name": "Apache License 2.0", + "spdx_id": "Apache-2.0", + "url": "https://api.github.com/licenses/apache-2.0", + "node_id": "MDc6TGljZW5zZTI=" + }, + "forks": 0, + "open_issues": 8, + "watchers": 0, + "default_branch": "master", + "permissions": { + "admin": false, + "push": false, + "pull": true + }, + "organization": { + "login": "pomes", + "id": 17839846, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjE3ODM5ODQ2", + "avatar_url": "https://avatars3.githubusercontent.com/u/17839846?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/pomes", + "html_url": "https://github.com/pomes", + "followers_url": "https://api.github.com/users/pomes/followers", + "following_url": "https://api.github.com/users/pomes/following{/other_user}", + "gists_url": "https://api.github.com/users/pomes/gists{/gist_id}", + "starred_url": "https://api.github.com/users/pomes/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/pomes/subscriptions", + "organizations_url": "https://api.github.com/users/pomes/orgs", + "repos_url": "https://api.github.com/users/pomes/repos", + "events_url": "https://api.github.com/users/pomes/events{/privacy}", + "received_events_url": "https://api.github.com/users/pomes/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 0, + "subscribers_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/__files/repos_pomes_pomes_license-47a3f209-8281-4238-b926-f199992b4cdf.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/__files/repos_pomes_pomes_license-47a3f209-8281-4238-b926-f199992b4cdf.json new file mode 100644 index 0000000000..34cefa04e1 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/__files/repos_pomes_pomes_license-47a3f209-8281-4238-b926-f199992b4cdf.json @@ -0,0 +1,25 @@ +{ + "name": "LICENSE", + "path": "LICENSE", + "sha": "8371492840f9485d7baf719dc2ae3e4cb9e8c03b", + "size": 11361, + "url": "https://api.github.com/repos/pomes/pomes/contents/LICENSE?ref=master", + "html_url": "https://github.com/pomes/pomes/blob/master/LICENSE", + "git_url": "https://api.github.com/repos/pomes/pomes/git/blobs/8371492840f9485d7baf719dc2ae3e4cb9e8c03b", + "download_url": "https://raw.githubusercontent.com/pomes/pomes/master/LICENSE", + "type": "file", + "content": "CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFwYWNoZSBMaWNl\nbnNlCiAgICAgICAgICAgICAgICAgICAgICAgICAgIFZlcnNpb24gMi4wLCBK\nYW51YXJ5IDIwMDQKICAgICAgICAgICAgICAgICAgICAgICAgaHR0cDovL3d3\ndy5hcGFjaGUub3JnL2xpY2Vuc2VzLwoKICAgVEVSTVMgQU5EIENPTkRJVElP\nTlMgRk9SIFVTRSwgUkVQUk9EVUNUSU9OLCBBTkQgRElTVFJJQlVUSU9OCgog\nICAxLiBEZWZpbml0aW9ucy4KCiAgICAgICJMaWNlbnNlIiBzaGFsbCBtZWFu\nIHRoZSB0ZXJtcyBhbmQgY29uZGl0aW9ucyBmb3IgdXNlLCByZXByb2R1Y3Rp\nb24sCiAgICAgIGFuZCBkaXN0cmlidXRpb24gYXMgZGVmaW5lZCBieSBTZWN0\naW9ucyAxIHRocm91Z2ggOSBvZiB0aGlzIGRvY3VtZW50LgoKICAgICAgIkxp\nY2Vuc29yIiBzaGFsbCBtZWFuIHRoZSBjb3B5cmlnaHQgb3duZXIgb3IgZW50\naXR5IGF1dGhvcml6ZWQgYnkKICAgICAgdGhlIGNvcHlyaWdodCBvd25lciB0\naGF0IGlzIGdyYW50aW5nIHRoZSBMaWNlbnNlLgoKICAgICAgIkxlZ2FsIEVu\ndGl0eSIgc2hhbGwgbWVhbiB0aGUgdW5pb24gb2YgdGhlIGFjdGluZyBlbnRp\ndHkgYW5kIGFsbAogICAgICBvdGhlciBlbnRpdGllcyB0aGF0IGNvbnRyb2ws\nIGFyZSBjb250cm9sbGVkIGJ5LCBvciBhcmUgdW5kZXIgY29tbW9uCiAgICAg\nIGNvbnRyb2wgd2l0aCB0aGF0IGVudGl0eS4gRm9yIHRoZSBwdXJwb3NlcyBv\nZiB0aGlzIGRlZmluaXRpb24sCiAgICAgICJjb250cm9sIiBtZWFucyAoaSkg\ndGhlIHBvd2VyLCBkaXJlY3Qgb3IgaW5kaXJlY3QsIHRvIGNhdXNlIHRoZQog\nICAgICBkaXJlY3Rpb24gb3IgbWFuYWdlbWVudCBvZiBzdWNoIGVudGl0eSwg\nd2hldGhlciBieSBjb250cmFjdCBvcgogICAgICBvdGhlcndpc2UsIG9yIChp\naSkgb3duZXJzaGlwIG9mIGZpZnR5IHBlcmNlbnQgKDUwJSkgb3IgbW9yZSBv\nZiB0aGUKICAgICAgb3V0c3RhbmRpbmcgc2hhcmVzLCBvciAoaWlpKSBiZW5l\nZmljaWFsIG93bmVyc2hpcCBvZiBzdWNoIGVudGl0eS4KCiAgICAgICJZb3Ui\nIChvciAiWW91ciIpIHNoYWxsIG1lYW4gYW4gaW5kaXZpZHVhbCBvciBMZWdh\nbCBFbnRpdHkKICAgICAgZXhlcmNpc2luZyBwZXJtaXNzaW9ucyBncmFudGVk\nIGJ5IHRoaXMgTGljZW5zZS4KCiAgICAgICJTb3VyY2UiIGZvcm0gc2hhbGwg\nbWVhbiB0aGUgcHJlZmVycmVkIGZvcm0gZm9yIG1ha2luZyBtb2RpZmljYXRp\nb25zLAogICAgICBpbmNsdWRpbmcgYnV0IG5vdCBsaW1pdGVkIHRvIHNvZnR3\nYXJlIHNvdXJjZSBjb2RlLCBkb2N1bWVudGF0aW9uCiAgICAgIHNvdXJjZSwg\nYW5kIGNvbmZpZ3VyYXRpb24gZmlsZXMuCgogICAgICAiT2JqZWN0IiBmb3Jt\nIHNoYWxsIG1lYW4gYW55IGZvcm0gcmVzdWx0aW5nIGZyb20gbWVjaGFuaWNh\nbAogICAgICB0cmFuc2Zvcm1hdGlvbiBvciB0cmFuc2xhdGlvbiBvZiBhIFNv\ndXJjZSBmb3JtLCBpbmNsdWRpbmcgYnV0CiAgICAgIG5vdCBsaW1pdGVkIHRv\nIGNvbXBpbGVkIG9iamVjdCBjb2RlLCBnZW5lcmF0ZWQgZG9jdW1lbnRhdGlv\nbiwKICAgICAgYW5kIGNvbnZlcnNpb25zIHRvIG90aGVyIG1lZGlhIHR5cGVz\nLgoKICAgICAgIldvcmsiIHNoYWxsIG1lYW4gdGhlIHdvcmsgb2YgYXV0aG9y\nc2hpcCwgd2hldGhlciBpbiBTb3VyY2Ugb3IKICAgICAgT2JqZWN0IGZvcm0s\nIG1hZGUgYXZhaWxhYmxlIHVuZGVyIHRoZSBMaWNlbnNlLCBhcyBpbmRpY2F0\nZWQgYnkgYQogICAgICBjb3B5cmlnaHQgbm90aWNlIHRoYXQgaXMgaW5jbHVk\nZWQgaW4gb3IgYXR0YWNoZWQgdG8gdGhlIHdvcmsKICAgICAgKGFuIGV4YW1w\nbGUgaXMgcHJvdmlkZWQgaW4gdGhlIEFwcGVuZGl4IGJlbG93KS4KCiAgICAg\nICJEZXJpdmF0aXZlIFdvcmtzIiBzaGFsbCBtZWFuIGFueSB3b3JrLCB3aGV0\naGVyIGluIFNvdXJjZSBvciBPYmplY3QKICAgICAgZm9ybSwgdGhhdCBpcyBi\nYXNlZCBvbiAob3IgZGVyaXZlZCBmcm9tKSB0aGUgV29yayBhbmQgZm9yIHdo\naWNoIHRoZQogICAgICBlZGl0b3JpYWwgcmV2aXNpb25zLCBhbm5vdGF0aW9u\ncywgZWxhYm9yYXRpb25zLCBvciBvdGhlciBtb2RpZmljYXRpb25zCiAgICAg\nIHJlcHJlc2VudCwgYXMgYSB3aG9sZSwgYW4gb3JpZ2luYWwgd29yayBvZiBh\ndXRob3JzaGlwLiBGb3IgdGhlIHB1cnBvc2VzCiAgICAgIG9mIHRoaXMgTGlj\nZW5zZSwgRGVyaXZhdGl2ZSBXb3JrcyBzaGFsbCBub3QgaW5jbHVkZSB3b3Jr\ncyB0aGF0IHJlbWFpbgogICAgICBzZXBhcmFibGUgZnJvbSwgb3IgbWVyZWx5\nIGxpbmsgKG9yIGJpbmQgYnkgdmFsdWUpIHRvIHRoZSBpbnRlcmZhY2VzIG9m\nLAogICAgICB0aGUgV29yayBhbmQgRGVyaXZhdGl2ZSBXb3JrcyB0aGVyZW9m\nLgoKICAgICAgIkNvbnRyaWJ1dGlvbiIgc2hhbGwgbWVhbiBhbnkgd29yayBv\nZiBhdXRob3JzaGlwLCBpbmNsdWRpbmcKICAgICAgdGhlIG9yaWdpbmFsIHZl\ncnNpb24gb2YgdGhlIFdvcmsgYW5kIGFueSBtb2RpZmljYXRpb25zIG9yIGFk\nZGl0aW9ucwogICAgICB0byB0aGF0IFdvcmsgb3IgRGVyaXZhdGl2ZSBXb3Jr\ncyB0aGVyZW9mLCB0aGF0IGlzIGludGVudGlvbmFsbHkKICAgICAgc3VibWl0\ndGVkIHRvIExpY2Vuc29yIGZvciBpbmNsdXNpb24gaW4gdGhlIFdvcmsgYnkg\ndGhlIGNvcHlyaWdodCBvd25lcgogICAgICBvciBieSBhbiBpbmRpdmlkdWFs\nIG9yIExlZ2FsIEVudGl0eSBhdXRob3JpemVkIHRvIHN1Ym1pdCBvbiBiZWhh\nbGYgb2YKICAgICAgdGhlIGNvcHlyaWdodCBvd25lci4gRm9yIHRoZSBwdXJw\nb3NlcyBvZiB0aGlzIGRlZmluaXRpb24sICJzdWJtaXR0ZWQiCiAgICAgIG1l\nYW5zIGFueSBmb3JtIG9mIGVsZWN0cm9uaWMsIHZlcmJhbCwgb3Igd3JpdHRl\nbiBjb21tdW5pY2F0aW9uIHNlbnQKICAgICAgdG8gdGhlIExpY2Vuc29yIG9y\nIGl0cyByZXByZXNlbnRhdGl2ZXMsIGluY2x1ZGluZyBidXQgbm90IGxpbWl0\nZWQgdG8KICAgICAgY29tbXVuaWNhdGlvbiBvbiBlbGVjdHJvbmljIG1haWxp\nbmcgbGlzdHMsIHNvdXJjZSBjb2RlIGNvbnRyb2wgc3lzdGVtcywKICAgICAg\nYW5kIGlzc3VlIHRyYWNraW5nIHN5c3RlbXMgdGhhdCBhcmUgbWFuYWdlZCBi\neSwgb3Igb24gYmVoYWxmIG9mLCB0aGUKICAgICAgTGljZW5zb3IgZm9yIHRo\nZSBwdXJwb3NlIG9mIGRpc2N1c3NpbmcgYW5kIGltcHJvdmluZyB0aGUgV29y\naywgYnV0CiAgICAgIGV4Y2x1ZGluZyBjb21tdW5pY2F0aW9uIHRoYXQgaXMg\nY29uc3BpY3VvdXNseSBtYXJrZWQgb3Igb3RoZXJ3aXNlCiAgICAgIGRlc2ln\nbmF0ZWQgaW4gd3JpdGluZyBieSB0aGUgY29weXJpZ2h0IG93bmVyIGFzICJO\nb3QgYSBDb250cmlidXRpb24uIgoKICAgICAgIkNvbnRyaWJ1dG9yIiBzaGFs\nbCBtZWFuIExpY2Vuc29yIGFuZCBhbnkgaW5kaXZpZHVhbCBvciBMZWdhbCBF\nbnRpdHkKICAgICAgb24gYmVoYWxmIG9mIHdob20gYSBDb250cmlidXRpb24g\naGFzIGJlZW4gcmVjZWl2ZWQgYnkgTGljZW5zb3IgYW5kCiAgICAgIHN1YnNl\ncXVlbnRseSBpbmNvcnBvcmF0ZWQgd2l0aGluIHRoZSBXb3JrLgoKICAgMi4g\nR3JhbnQgb2YgQ29weXJpZ2h0IExpY2Vuc2UuIFN1YmplY3QgdG8gdGhlIHRl\ncm1zIGFuZCBjb25kaXRpb25zIG9mCiAgICAgIHRoaXMgTGljZW5zZSwgZWFj\naCBDb250cmlidXRvciBoZXJlYnkgZ3JhbnRzIHRvIFlvdSBhIHBlcnBldHVh\nbCwKICAgICAgd29ybGR3aWRlLCBub24tZXhjbHVzaXZlLCBuby1jaGFyZ2Us\nIHJveWFsdHktZnJlZSwgaXJyZXZvY2FibGUKICAgICAgY29weXJpZ2h0IGxp\nY2Vuc2UgdG8gcmVwcm9kdWNlLCBwcmVwYXJlIERlcml2YXRpdmUgV29ya3Mg\nb2YsCiAgICAgIHB1YmxpY2x5IGRpc3BsYXksIHB1YmxpY2x5IHBlcmZvcm0s\nIHN1YmxpY2Vuc2UsIGFuZCBkaXN0cmlidXRlIHRoZQogICAgICBXb3JrIGFu\nZCBzdWNoIERlcml2YXRpdmUgV29ya3MgaW4gU291cmNlIG9yIE9iamVjdCBm\nb3JtLgoKICAgMy4gR3JhbnQgb2YgUGF0ZW50IExpY2Vuc2UuIFN1YmplY3Qg\ndG8gdGhlIHRlcm1zIGFuZCBjb25kaXRpb25zIG9mCiAgICAgIHRoaXMgTGlj\nZW5zZSwgZWFjaCBDb250cmlidXRvciBoZXJlYnkgZ3JhbnRzIHRvIFlvdSBh\nIHBlcnBldHVhbCwKICAgICAgd29ybGR3aWRlLCBub24tZXhjbHVzaXZlLCBu\nby1jaGFyZ2UsIHJveWFsdHktZnJlZSwgaXJyZXZvY2FibGUKICAgICAgKGV4\nY2VwdCBhcyBzdGF0ZWQgaW4gdGhpcyBzZWN0aW9uKSBwYXRlbnQgbGljZW5z\nZSB0byBtYWtlLCBoYXZlIG1hZGUsCiAgICAgIHVzZSwgb2ZmZXIgdG8gc2Vs\nbCwgc2VsbCwgaW1wb3J0LCBhbmQgb3RoZXJ3aXNlIHRyYW5zZmVyIHRoZSBX\nb3JrLAogICAgICB3aGVyZSBzdWNoIGxpY2Vuc2UgYXBwbGllcyBvbmx5IHRv\nIHRob3NlIHBhdGVudCBjbGFpbXMgbGljZW5zYWJsZQogICAgICBieSBzdWNo\nIENvbnRyaWJ1dG9yIHRoYXQgYXJlIG5lY2Vzc2FyaWx5IGluZnJpbmdlZCBi\neSB0aGVpcgogICAgICBDb250cmlidXRpb24ocykgYWxvbmUgb3IgYnkgY29t\nYmluYXRpb24gb2YgdGhlaXIgQ29udHJpYnV0aW9uKHMpCiAgICAgIHdpdGgg\ndGhlIFdvcmsgdG8gd2hpY2ggc3VjaCBDb250cmlidXRpb24ocykgd2FzIHN1\nYm1pdHRlZC4gSWYgWW91CiAgICAgIGluc3RpdHV0ZSBwYXRlbnQgbGl0aWdh\ndGlvbiBhZ2FpbnN0IGFueSBlbnRpdHkgKGluY2x1ZGluZyBhCiAgICAgIGNy\nb3NzLWNsYWltIG9yIGNvdW50ZXJjbGFpbSBpbiBhIGxhd3N1aXQpIGFsbGVn\naW5nIHRoYXQgdGhlIFdvcmsKICAgICAgb3IgYSBDb250cmlidXRpb24gaW5j\nb3Jwb3JhdGVkIHdpdGhpbiB0aGUgV29yayBjb25zdGl0dXRlcyBkaXJlY3QK\nICAgICAgb3IgY29udHJpYnV0b3J5IHBhdGVudCBpbmZyaW5nZW1lbnQsIHRo\nZW4gYW55IHBhdGVudCBsaWNlbnNlcwogICAgICBncmFudGVkIHRvIFlvdSB1\nbmRlciB0aGlzIExpY2Vuc2UgZm9yIHRoYXQgV29yayBzaGFsbCB0ZXJtaW5h\ndGUKICAgICAgYXMgb2YgdGhlIGRhdGUgc3VjaCBsaXRpZ2F0aW9uIGlzIGZp\nbGVkLgoKICAgNC4gUmVkaXN0cmlidXRpb24uIFlvdSBtYXkgcmVwcm9kdWNl\nIGFuZCBkaXN0cmlidXRlIGNvcGllcyBvZiB0aGUKICAgICAgV29yayBvciBE\nZXJpdmF0aXZlIFdvcmtzIHRoZXJlb2YgaW4gYW55IG1lZGl1bSwgd2l0aCBv\nciB3aXRob3V0CiAgICAgIG1vZGlmaWNhdGlvbnMsIGFuZCBpbiBTb3VyY2Ug\nb3IgT2JqZWN0IGZvcm0sIHByb3ZpZGVkIHRoYXQgWW91CiAgICAgIG1lZXQg\ndGhlIGZvbGxvd2luZyBjb25kaXRpb25zOgoKICAgICAgKGEpIFlvdSBtdXN0\nIGdpdmUgYW55IG90aGVyIHJlY2lwaWVudHMgb2YgdGhlIFdvcmsgb3IKICAg\nICAgICAgIERlcml2YXRpdmUgV29ya3MgYSBjb3B5IG9mIHRoaXMgTGljZW5z\nZTsgYW5kCgogICAgICAoYikgWW91IG11c3QgY2F1c2UgYW55IG1vZGlmaWVk\nIGZpbGVzIHRvIGNhcnJ5IHByb21pbmVudCBub3RpY2VzCiAgICAgICAgICBz\ndGF0aW5nIHRoYXQgWW91IGNoYW5nZWQgdGhlIGZpbGVzOyBhbmQKCiAgICAg\nIChjKSBZb3UgbXVzdCByZXRhaW4sIGluIHRoZSBTb3VyY2UgZm9ybSBvZiBh\nbnkgRGVyaXZhdGl2ZSBXb3JrcwogICAgICAgICAgdGhhdCBZb3UgZGlzdHJp\nYnV0ZSwgYWxsIGNvcHlyaWdodCwgcGF0ZW50LCB0cmFkZW1hcmssIGFuZAog\nICAgICAgICAgYXR0cmlidXRpb24gbm90aWNlcyBmcm9tIHRoZSBTb3VyY2Ug\nZm9ybSBvZiB0aGUgV29yaywKICAgICAgICAgIGV4Y2x1ZGluZyB0aG9zZSBu\nb3RpY2VzIHRoYXQgZG8gbm90IHBlcnRhaW4gdG8gYW55IHBhcnQgb2YKICAg\nICAgICAgIHRoZSBEZXJpdmF0aXZlIFdvcmtzOyBhbmQKCiAgICAgIChkKSBJ\nZiB0aGUgV29yayBpbmNsdWRlcyBhICJOT1RJQ0UiIHRleHQgZmlsZSBhcyBw\nYXJ0IG9mIGl0cwogICAgICAgICAgZGlzdHJpYnV0aW9uLCB0aGVuIGFueSBE\nZXJpdmF0aXZlIFdvcmtzIHRoYXQgWW91IGRpc3RyaWJ1dGUgbXVzdAogICAg\nICAgICAgaW5jbHVkZSBhIHJlYWRhYmxlIGNvcHkgb2YgdGhlIGF0dHJpYnV0\naW9uIG5vdGljZXMgY29udGFpbmVkCiAgICAgICAgICB3aXRoaW4gc3VjaCBO\nT1RJQ0UgZmlsZSwgZXhjbHVkaW5nIHRob3NlIG5vdGljZXMgdGhhdCBkbyBu\nb3QKICAgICAgICAgIHBlcnRhaW4gdG8gYW55IHBhcnQgb2YgdGhlIERlcml2\nYXRpdmUgV29ya3MsIGluIGF0IGxlYXN0IG9uZQogICAgICAgICAgb2YgdGhl\nIGZvbGxvd2luZyBwbGFjZXM6IHdpdGhpbiBhIE5PVElDRSB0ZXh0IGZpbGUg\nZGlzdHJpYnV0ZWQKICAgICAgICAgIGFzIHBhcnQgb2YgdGhlIERlcml2YXRp\ndmUgV29ya3M7IHdpdGhpbiB0aGUgU291cmNlIGZvcm0gb3IKICAgICAgICAg\nIGRvY3VtZW50YXRpb24sIGlmIHByb3ZpZGVkIGFsb25nIHdpdGggdGhlIERl\ncml2YXRpdmUgV29ya3M7IG9yLAogICAgICAgICAgd2l0aGluIGEgZGlzcGxh\neSBnZW5lcmF0ZWQgYnkgdGhlIERlcml2YXRpdmUgV29ya3MsIGlmIGFuZAog\nICAgICAgICAgd2hlcmV2ZXIgc3VjaCB0aGlyZC1wYXJ0eSBub3RpY2VzIG5v\ncm1hbGx5IGFwcGVhci4gVGhlIGNvbnRlbnRzCiAgICAgICAgICBvZiB0aGUg\nTk9USUNFIGZpbGUgYXJlIGZvciBpbmZvcm1hdGlvbmFsIHB1cnBvc2VzIG9u\nbHkgYW5kCiAgICAgICAgICBkbyBub3QgbW9kaWZ5IHRoZSBMaWNlbnNlLiBZ\nb3UgbWF5IGFkZCBZb3VyIG93biBhdHRyaWJ1dGlvbgogICAgICAgICAgbm90\naWNlcyB3aXRoaW4gRGVyaXZhdGl2ZSBXb3JrcyB0aGF0IFlvdSBkaXN0cmli\ndXRlLCBhbG9uZ3NpZGUKICAgICAgICAgIG9yIGFzIGFuIGFkZGVuZHVtIHRv\nIHRoZSBOT1RJQ0UgdGV4dCBmcm9tIHRoZSBXb3JrLCBwcm92aWRlZAogICAg\nICAgICAgdGhhdCBzdWNoIGFkZGl0aW9uYWwgYXR0cmlidXRpb24gbm90aWNl\ncyBjYW5ub3QgYmUgY29uc3RydWVkCiAgICAgICAgICBhcyBtb2RpZnlpbmcg\ndGhlIExpY2Vuc2UuCgogICAgICBZb3UgbWF5IGFkZCBZb3VyIG93biBjb3B5\ncmlnaHQgc3RhdGVtZW50IHRvIFlvdXIgbW9kaWZpY2F0aW9ucyBhbmQKICAg\nICAgbWF5IHByb3ZpZGUgYWRkaXRpb25hbCBvciBkaWZmZXJlbnQgbGljZW5z\nZSB0ZXJtcyBhbmQgY29uZGl0aW9ucwogICAgICBmb3IgdXNlLCByZXByb2R1\nY3Rpb24sIG9yIGRpc3RyaWJ1dGlvbiBvZiBZb3VyIG1vZGlmaWNhdGlvbnMs\nIG9yCiAgICAgIGZvciBhbnkgc3VjaCBEZXJpdmF0aXZlIFdvcmtzIGFzIGEg\nd2hvbGUsIHByb3ZpZGVkIFlvdXIgdXNlLAogICAgICByZXByb2R1Y3Rpb24s\nIGFuZCBkaXN0cmlidXRpb24gb2YgdGhlIFdvcmsgb3RoZXJ3aXNlIGNvbXBs\naWVzIHdpdGgKICAgICAgdGhlIGNvbmRpdGlvbnMgc3RhdGVkIGluIHRoaXMg\nTGljZW5zZS4KCiAgIDUuIFN1Ym1pc3Npb24gb2YgQ29udHJpYnV0aW9ucy4g\nVW5sZXNzIFlvdSBleHBsaWNpdGx5IHN0YXRlIG90aGVyd2lzZSwKICAgICAg\nYW55IENvbnRyaWJ1dGlvbiBpbnRlbnRpb25hbGx5IHN1Ym1pdHRlZCBmb3Ig\naW5jbHVzaW9uIGluIHRoZSBXb3JrCiAgICAgIGJ5IFlvdSB0byB0aGUgTGlj\nZW5zb3Igc2hhbGwgYmUgdW5kZXIgdGhlIHRlcm1zIGFuZCBjb25kaXRpb25z\nIG9mCiAgICAgIHRoaXMgTGljZW5zZSwgd2l0aG91dCBhbnkgYWRkaXRpb25h\nbCB0ZXJtcyBvciBjb25kaXRpb25zLgogICAgICBOb3R3aXRoc3RhbmRpbmcg\ndGhlIGFib3ZlLCBub3RoaW5nIGhlcmVpbiBzaGFsbCBzdXBlcnNlZGUgb3Ig\nbW9kaWZ5CiAgICAgIHRoZSB0ZXJtcyBvZiBhbnkgc2VwYXJhdGUgbGljZW5z\nZSBhZ3JlZW1lbnQgeW91IG1heSBoYXZlIGV4ZWN1dGVkCiAgICAgIHdpdGgg\nTGljZW5zb3IgcmVnYXJkaW5nIHN1Y2ggQ29udHJpYnV0aW9ucy4KCiAgIDYu\nIFRyYWRlbWFya3MuIFRoaXMgTGljZW5zZSBkb2VzIG5vdCBncmFudCBwZXJt\naXNzaW9uIHRvIHVzZSB0aGUgdHJhZGUKICAgICAgbmFtZXMsIHRyYWRlbWFy\na3MsIHNlcnZpY2UgbWFya3MsIG9yIHByb2R1Y3QgbmFtZXMgb2YgdGhlIExp\nY2Vuc29yLAogICAgICBleGNlcHQgYXMgcmVxdWlyZWQgZm9yIHJlYXNvbmFi\nbGUgYW5kIGN1c3RvbWFyeSB1c2UgaW4gZGVzY3JpYmluZyB0aGUKICAgICAg\nb3JpZ2luIG9mIHRoZSBXb3JrIGFuZCByZXByb2R1Y2luZyB0aGUgY29udGVu\ndCBvZiB0aGUgTk9USUNFIGZpbGUuCgogICA3LiBEaXNjbGFpbWVyIG9mIFdh\ncnJhbnR5LiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IK\nICAgICAgYWdyZWVkIHRvIGluIHdyaXRpbmcsIExpY2Vuc29yIHByb3ZpZGVz\nIHRoZSBXb3JrIChhbmQgZWFjaAogICAgICBDb250cmlidXRvciBwcm92aWRl\ncyBpdHMgQ29udHJpYnV0aW9ucykgb24gYW4gIkFTIElTIiBCQVNJUywKICAg\nICAgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJ\nTkQsIGVpdGhlciBleHByZXNzIG9yCiAgICAgIGltcGxpZWQsIGluY2x1ZGlu\nZywgd2l0aG91dCBsaW1pdGF0aW9uLCBhbnkgd2FycmFudGllcyBvciBjb25k\naXRpb25zCiAgICAgIG9mIFRJVExFLCBOT04tSU5GUklOR0VNRU5ULCBNRVJD\nSEFOVEFCSUxJVFksIG9yIEZJVE5FU1MgRk9SIEEKICAgICAgUEFSVElDVUxB\nUiBQVVJQT1NFLiBZb3UgYXJlIHNvbGVseSByZXNwb25zaWJsZSBmb3IgZGV0\nZXJtaW5pbmcgdGhlCiAgICAgIGFwcHJvcHJpYXRlbmVzcyBvZiB1c2luZyBv\nciByZWRpc3RyaWJ1dGluZyB0aGUgV29yayBhbmQgYXNzdW1lIGFueQogICAg\nICByaXNrcyBhc3NvY2lhdGVkIHdpdGggWW91ciBleGVyY2lzZSBvZiBwZXJt\naXNzaW9ucyB1bmRlciB0aGlzIExpY2Vuc2UuCgogICA4LiBMaW1pdGF0aW9u\nIG9mIExpYWJpbGl0eS4gSW4gbm8gZXZlbnQgYW5kIHVuZGVyIG5vIGxlZ2Fs\nIHRoZW9yeSwKICAgICAgd2hldGhlciBpbiB0b3J0IChpbmNsdWRpbmcgbmVn\nbGlnZW5jZSksIGNvbnRyYWN0LCBvciBvdGhlcndpc2UsCiAgICAgIHVubGVz\ncyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyAoc3VjaCBhcyBkZWxpYmVy\nYXRlIGFuZCBncm9zc2x5CiAgICAgIG5lZ2xpZ2VudCBhY3RzKSBvciBhZ3Jl\nZWQgdG8gaW4gd3JpdGluZywgc2hhbGwgYW55IENvbnRyaWJ1dG9yIGJlCiAg\nICAgIGxpYWJsZSB0byBZb3UgZm9yIGRhbWFnZXMsIGluY2x1ZGluZyBhbnkg\nZGlyZWN0LCBpbmRpcmVjdCwgc3BlY2lhbCwKICAgICAgaW5jaWRlbnRhbCwg\nb3IgY29uc2VxdWVudGlhbCBkYW1hZ2VzIG9mIGFueSBjaGFyYWN0ZXIgYXJp\nc2luZyBhcyBhCiAgICAgIHJlc3VsdCBvZiB0aGlzIExpY2Vuc2Ugb3Igb3V0\nIG9mIHRoZSB1c2Ugb3IgaW5hYmlsaXR5IHRvIHVzZSB0aGUKICAgICAgV29y\nayAoaW5jbHVkaW5nIGJ1dCBub3QgbGltaXRlZCB0byBkYW1hZ2VzIGZvciBs\nb3NzIG9mIGdvb2R3aWxsLAogICAgICB3b3JrIHN0b3BwYWdlLCBjb21wdXRl\nciBmYWlsdXJlIG9yIG1hbGZ1bmN0aW9uLCBvciBhbnkgYW5kIGFsbAogICAg\nICBvdGhlciBjb21tZXJjaWFsIGRhbWFnZXMgb3IgbG9zc2VzKSwgZXZlbiBp\nZiBzdWNoIENvbnRyaWJ1dG9yCiAgICAgIGhhcyBiZWVuIGFkdmlzZWQgb2Yg\ndGhlIHBvc3NpYmlsaXR5IG9mIHN1Y2ggZGFtYWdlcy4KCiAgIDkuIEFjY2Vw\ndGluZyBXYXJyYW50eSBvciBBZGRpdGlvbmFsIExpYWJpbGl0eS4gV2hpbGUg\ncmVkaXN0cmlidXRpbmcKICAgICAgdGhlIFdvcmsgb3IgRGVyaXZhdGl2ZSBX\nb3JrcyB0aGVyZW9mLCBZb3UgbWF5IGNob29zZSB0byBvZmZlciwKICAgICAg\nYW5kIGNoYXJnZSBhIGZlZSBmb3IsIGFjY2VwdGFuY2Ugb2Ygc3VwcG9ydCwg\nd2FycmFudHksIGluZGVtbml0eSwKICAgICAgb3Igb3RoZXIgbGlhYmlsaXR5\nIG9ibGlnYXRpb25zIGFuZC9vciByaWdodHMgY29uc2lzdGVudCB3aXRoIHRo\naXMKICAgICAgTGljZW5zZS4gSG93ZXZlciwgaW4gYWNjZXB0aW5nIHN1Y2gg\nb2JsaWdhdGlvbnMsIFlvdSBtYXkgYWN0IG9ubHkKICAgICAgb24gWW91ciBv\nd24gYmVoYWxmIGFuZCBvbiBZb3VyIHNvbGUgcmVzcG9uc2liaWxpdHksIG5v\ndCBvbiBiZWhhbGYKICAgICAgb2YgYW55IG90aGVyIENvbnRyaWJ1dG9yLCBh\nbmQgb25seSBpZiBZb3UgYWdyZWUgdG8gaW5kZW1uaWZ5LAogICAgICBkZWZl\nbmQsIGFuZCBob2xkIGVhY2ggQ29udHJpYnV0b3IgaGFybWxlc3MgZm9yIGFu\neSBsaWFiaWxpdHkKICAgICAgaW5jdXJyZWQgYnksIG9yIGNsYWltcyBhc3Nl\ncnRlZCBhZ2FpbnN0LCBzdWNoIENvbnRyaWJ1dG9yIGJ5IHJlYXNvbgogICAg\nICBvZiB5b3VyIGFjY2VwdGluZyBhbnkgc3VjaCB3YXJyYW50eSBvciBhZGRp\ndGlvbmFsIGxpYWJpbGl0eS4KCiAgIEVORCBPRiBURVJNUyBBTkQgQ09ORElU\nSU9OUwoKICAgQVBQRU5ESVg6IEhvdyB0byBhcHBseSB0aGUgQXBhY2hlIExp\nY2Vuc2UgdG8geW91ciB3b3JrLgoKICAgICAgVG8gYXBwbHkgdGhlIEFwYWNo\nZSBMaWNlbnNlIHRvIHlvdXIgd29yaywgYXR0YWNoIHRoZSBmb2xsb3dpbmcK\nICAgICAgYm9pbGVycGxhdGUgbm90aWNlLCB3aXRoIHRoZSBmaWVsZHMgZW5j\nbG9zZWQgYnkgYnJhY2tldHMgIltdIgogICAgICByZXBsYWNlZCB3aXRoIHlv\ndXIgb3duIGlkZW50aWZ5aW5nIGluZm9ybWF0aW9uLiAoRG9uJ3QgaW5jbHVk\nZQogICAgICB0aGUgYnJhY2tldHMhKSAgVGhlIHRleHQgc2hvdWxkIGJlIGVu\nY2xvc2VkIGluIHRoZSBhcHByb3ByaWF0ZQogICAgICBjb21tZW50IHN5bnRh\neCBmb3IgdGhlIGZpbGUgZm9ybWF0LiBXZSBhbHNvIHJlY29tbWVuZCB0aGF0\nIGEKICAgICAgZmlsZSBvciBjbGFzcyB2YWx1ZSBhbmQgZGVzY3JpcHRpb24g\nb2YgcHVycG9zZSBiZSBpbmNsdWRlZCBvbiB0aGUKICAgICAgc2FtZSAicHJp\nbnRlZCBwYWdlIiBhcyB0aGUgY29weXJpZ2h0IG5vdGljZSBmb3IgZWFzaWVy\nCiAgICAgIGlkZW50aWZpY2F0aW9uIHdpdGhpbiB0aGlyZC1wYXJ0eSBhcmNo\naXZlcy4KCiAgIENvcHlyaWdodCBbeXl5eV0gW3ZhbHVlIG9mIGNvcHlyaWdo\ndCBvd25lcl0KCiAgIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5z\nZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOwogICB5b3UgbWF5IG5v\ndCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhl\nIExpY2Vuc2UuCiAgIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGlj\nZW5zZSBhdAoKICAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNl\ncy9MSUNFTlNFLTIuMAoKICAgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2Fi\nbGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQogICBk\naXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBv\nbiBhbiAiQVMgSVMiIEJBU0lTLAogICBXSVRIT1VUIFdBUlJBTlRJRVMgT1Ig\nQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1w\nbGllZC4KICAgU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFu\nZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAogICBsaW1pdGF0aW9u\ncyB1bmRlciB0aGUgTGljZW5zZS4K\n", + "encoding": "base64", + "_links": { + "self": "https://api.github.com/repos/pomes/pomes/contents/LICENSE?ref=master", + "git": "https://api.github.com/repos/pomes/pomes/git/blobs/8371492840f9485d7baf719dc2ae3e4cb9e8c03b", + "html": "https://github.com/pomes/pomes/blob/master/LICENSE" + }, + "license": { + "key": "apache-2.0", + "name": "Apache License 2.0", + "spdx_id": "Apache-2.0", + "url": "https://api.github.com/licenses/apache-2.0", + "node_id": "MDc6TGljZW5zZTI=" + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/__files/user-f33aa0eb-ef47-4106-b877-b8938a450623.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/__files/user-f33aa0eb-ef47-4106-b877-b8938a450623.json new file mode 100644 index 0000000000..41fc9e3d00 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/__files/user-f33aa0eb-ef47-4106-b877-b8938a450623.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 168, + "public_gists": 4, + "followers": 136, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/mappings/repos_pomes_pomes-2-c9deed.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/mappings/repos_pomes_pomes-2-c9deed.json new file mode 100644 index 0000000000..710799cabb --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/mappings/repos_pomes_pomes-2-c9deed.json @@ -0,0 +1,43 @@ +{ + "id": "c9deed07-bd75-4016-bc8e-ee09b582b604", + "name": "repos_pomes_pomes", + "request": { + "url": "/repos/pomes/pomes", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "repos_pomes_pomes-c9deed07-bd75-4016-bc8e-ee09b582b604.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:39 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4562", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"66e425cde189cc71851c3869a89f8541\"", + "Last-Modified": "Sun, 26 Jun 2016 05:41:12 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C174:361C:AC6AF8:CD8FD1:5D978182" + } + }, + "uuid": "c9deed07-bd75-4016-bc8e-ee09b582b604", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/mappings/repos_pomes_pomes_license-3-47a3f2.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/mappings/repos_pomes_pomes_license-3-47a3f2.json new file mode 100644 index 0000000000..88cd9be747 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/mappings/repos_pomes_pomes_license-3-47a3f2.json @@ -0,0 +1,43 @@ +{ + "id": "47a3f209-8281-4238-b926-f199992b4cdf", + "name": "repos_pomes_pomes_license", + "request": { + "url": "/repos/pomes/pomes/license", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "repos_pomes_pomes_license-47a3f209-8281-4238-b926-f199992b4cdf.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:39 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4561", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"9c9e74dccdac3dc6904a9b3926a63906\"", + "Last-Modified": "Sun, 14 Aug 2016 23:16:59 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C174:361C:AC6B02:CD900F:5D978183" + } + }, + "uuid": "47a3f209-8281-4238-b926-f199992b4cdf", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/mappings/user-1-f33aa0.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/mappings/user-1-f33aa0.json new file mode 100644 index 0000000000..191fa4ce8b --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicensePomes/mappings/user-1-f33aa0.json @@ -0,0 +1,43 @@ +{ + "id": "f33aa0eb-ef47-4106-b877-b8938a450623", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-f33aa0eb-ef47-4106-b877-b8938a450623.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:38 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4564", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C174:361C:AC6ACA:CD8FC8:5D978182" + } + }, + "uuid": "f33aa0eb-ef47-4106-b877-b8938a450623", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryWithoutLicense/__files/repos_github-api-test-org_empty-ed789279-0e18-43b9-8ee5-4a9a40160834.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryWithoutLicense/__files/repos_github-api-test-org_empty-ed789279-0e18-43b9-8ee5-4a9a40160834.json new file mode 100644 index 0000000000..5179da1394 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryWithoutLicense/__files/repos_github-api-test-org_empty-ed789279-0e18-43b9-8ee5-4a9a40160834.json @@ -0,0 +1,124 @@ +{ + "id": 60391080, + "node_id": "MDEwOlJlcG9zaXRvcnk2MDM5MTA4MA==", + "name": "empty", + "full_name": "github-api-test-org/empty", + "private": false, + "owner": { + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api-test-org", + "html_url": "https://github.com/github-api-test-org", + "followers_url": "https://api.github.com/users/github-api-test-org/followers", + "following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/github-api-test-org/orgs", + "repos_url": "https://api.github.com/users/github-api-test-org/repos", + "events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/github-api-test-org/empty", + "description": "Repository that has no contributor", + "fork": false, + "url": "https://api.github.com/repos/github-api-test-org/empty", + "forks_url": "https://api.github.com/repos/github-api-test-org/empty/forks", + "keys_url": "https://api.github.com/repos/github-api-test-org/empty/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api-test-org/empty/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api-test-org/empty/teams", + "hooks_url": "https://api.github.com/repos/github-api-test-org/empty/hooks", + "issue_events_url": "https://api.github.com/repos/github-api-test-org/empty/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api-test-org/empty/events", + "assignees_url": "https://api.github.com/repos/github-api-test-org/empty/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api-test-org/empty/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api-test-org/empty/tags", + "blobs_url": "https://api.github.com/repos/github-api-test-org/empty/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api-test-org/empty/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api-test-org/empty/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api-test-org/empty/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api-test-org/empty/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api-test-org/empty/languages", + "stargazers_url": "https://api.github.com/repos/github-api-test-org/empty/stargazers", + "contributors_url": "https://api.github.com/repos/github-api-test-org/empty/contributors", + "subscribers_url": "https://api.github.com/repos/github-api-test-org/empty/subscribers", + "subscription_url": "https://api.github.com/repos/github-api-test-org/empty/subscription", + "commits_url": "https://api.github.com/repos/github-api-test-org/empty/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api-test-org/empty/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api-test-org/empty/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api-test-org/empty/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api-test-org/empty/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api-test-org/empty/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api-test-org/empty/merges", + "archive_url": "https://api.github.com/repos/github-api-test-org/empty/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api-test-org/empty/downloads", + "issues_url": "https://api.github.com/repos/github-api-test-org/empty/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api-test-org/empty/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api-test-org/empty/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api-test-org/empty/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api-test-org/empty/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api-test-org/empty/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api-test-org/empty/deployments", + "created_at": "2016-06-04T03:22:22Z", + "updated_at": "2016-06-04T03:22:22Z", + "pushed_at": "2016-06-04T03:22:23Z", + "git_url": "git://github.com/github-api-test-org/empty.git", + "ssh_url": "git@github.com:github-api-test-org/empty.git", + "clone_url": "https://github.com/github-api-test-org/empty.git", + "svn_url": "https://github.com/github-api-test-org/empty", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api-test-org", + "html_url": "https://github.com/github-api-test-org", + "followers_url": "https://api.github.com/users/github-api-test-org/followers", + "following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/github-api-test-org/orgs", + "repos_url": "https://api.github.com/users/github-api-test-org/repos", + "events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 0, + "subscribers_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryWithoutLicense/__files/user-3003d0dd-7267-40ad-a499-e3fb8ce52a3f.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryWithoutLicense/__files/user-3003d0dd-7267-40ad-a499-e3fb8ce52a3f.json new file mode 100644 index 0000000000..41fc9e3d00 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryWithoutLicense/__files/user-3003d0dd-7267-40ad-a499-e3fb8ce52a3f.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 168, + "public_gists": 4, + "followers": 136, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryWithoutLicense/mappings/repos_github-api-test-org_empty-2-ed7892.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryWithoutLicense/mappings/repos_github-api-test-org_empty-2-ed7892.json new file mode 100644 index 0000000000..b396ce7b77 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryWithoutLicense/mappings/repos_github-api-test-org_empty-2-ed7892.json @@ -0,0 +1,43 @@ +{ + "id": "ed789279-0e18-43b9-8ee5-4a9a40160834", + "name": "repos_github-api-test-org_empty", + "request": { + "url": "/repos/github-api-test-org/empty", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api-test-org_empty-ed789279-0e18-43b9-8ee5-4a9a40160834.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:35 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4580", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"71a57ee919c57e5e9eb076f615232a66\"", + "Last-Modified": "Sat, 04 Jun 2016 03:22:22 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C164:78ED:1CE7E15:22775EE:5D97817F" + } + }, + "uuid": "ed789279-0e18-43b9-8ee5-4a9a40160834", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryWithoutLicense/mappings/repos_github-api-test-org_empty_license-3-fb7ab8.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryWithoutLicense/mappings/repos_github-api-test-org_empty_license-3-fb7ab8.json new file mode 100644 index 0000000000..3374cb9d2c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryWithoutLicense/mappings/repos_github-api-test-org_empty_license-3-fb7ab8.json @@ -0,0 +1,36 @@ +{ + "id": "fb7ab87e-4ea2-4c1a-8b5e-a3116734964d", + "name": "repos_github-api-test-org_empty_license", + "request": { + "url": "/repos/github-api-test-org/empty/license", + "method": "GET" + }, + "response": { + "status": 404, + "body": "{\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3/licenses/#get-the-contents-of-a-repositorys-license\"}", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:36 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "404 Not Found", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4579", + "X-RateLimit-Reset": "1570212957", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C164:78ED:1CE7E25:2277611:5D97817F" + } + }, + "uuid": "fb7ab87e-4ea2-4c1a-8b5e-a3116734964d", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryWithoutLicense/mappings/user-1-3003d0.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryWithoutLicense/mappings/user-1-3003d0.json new file mode 100644 index 0000000000..badb8bc2b5 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryWithoutLicense/mappings/user-1-3003d0.json @@ -0,0 +1,43 @@ +{ + "id": "3003d0dd-7267-40ad-a499-e3fb8ce52a3f", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-3003d0dd-7267-40ad-a499-e3fb8ce52a3f.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:35 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4582", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C164:78ED:1CE7DF6:22775DB:5D97817F" + } + }, + "uuid": "3003d0dd-7267-40ad-a499-e3fb8ce52a3f", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/getLicense/__files/licenses_mit-2182eadf-58a8-487f-89af-e6f6e8c527fe.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/getLicense/__files/licenses_mit-2182eadf-58a8-487f-89af-e6f6e8c527fe.json new file mode 100644 index 0000000000..b8c174e94b --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/getLicense/__files/licenses_mit-2182eadf-58a8-487f-89af-e6f6e8c527fe.json @@ -0,0 +1,25 @@ +{ + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz", + "html_url": "http://choosealicense.com/licenses/mit/", + "description": "A short and simple permissive license with conditions only requiring preservation of copyright and license notices. Licensed works, modifications, and larger works may be distributed under different terms and without source code.", + "implementation": "Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file. Replace [year] with the current year and [fullname] with the name (or names) of the copyright holders.", + "permissions": [ + "commercial-use", + "modifications", + "distribution", + "private-use" + ], + "conditions": [ + "include-copyright" + ], + "limitations": [ + "liability", + "warranty" + ], + "body": "MIT License\n\nCopyright (c) [year] [fullname]\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", + "featured": true +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/getLicense/__files/user-38876ae8-0962-4f1b-97cf-78ca1fb1fcb9.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/getLicense/__files/user-38876ae8-0962-4f1b-97cf-78ca1fb1fcb9.json new file mode 100644 index 0000000000..41fc9e3d00 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/getLicense/__files/user-38876ae8-0962-4f1b-97cf-78ca1fb1fcb9.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 168, + "public_gists": 4, + "followers": 136, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/getLicense/mappings/licenses_mit-2-2182ea.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/getLicense/mappings/licenses_mit-2-2182ea.json new file mode 100644 index 0000000000..8e57d98cef --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/getLicense/mappings/licenses_mit-2-2182ea.json @@ -0,0 +1,42 @@ +{ + "id": "2182eadf-58a8-487f-89af-e6f6e8c527fe", + "name": "licenses_mit", + "request": { + "url": "/licenses/mit", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "licenses_mit-2182eadf-58a8-487f-89af-e6f6e8c527fe.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:38 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4565", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"cdc71ea0b0e60f4cdbf00107bcf1035c\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C171:9576:93A2DE:B07C4A:5D978182" + } + }, + "uuid": "2182eadf-58a8-487f-89af-e6f6e8c527fe", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/getLicense/mappings/user-1-38876a.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/getLicense/mappings/user-1-38876a.json new file mode 100644 index 0000000000..8c6e8ac28f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/getLicense/mappings/user-1-38876a.json @@ -0,0 +1,43 @@ +{ + "id": "38876ae8-0962-4f1b-97cf-78ca1fb1fcb9", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-38876ae8-0962-4f1b-97cf-78ca1fb1fcb9.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:38 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4567", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C171:9576:93A2D3:B07C45:5D978182" + } + }, + "uuid": "38876ae8-0962-4f1b-97cf-78ca1fb1fcb9", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicenses/__files/licenses-b3d307b7-ab1a-4a9e-9b89-d0a7e8fcd2e8.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicenses/__files/licenses-b3d307b7-ab1a-4a9e-9b89-d0a7e8fcd2e8.json new file mode 100644 index 0000000000..cdbd51e907 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicenses/__files/licenses-b3d307b7-ab1a-4a9e-9b89-d0a7e8fcd2e8.json @@ -0,0 +1,86 @@ +[ + { + "key": "agpl-3.0", + "name": "GNU Affero General Public License v3.0", + "spdx_id": "AGPL-3.0", + "url": "https://api.github.com/licenses/agpl-3.0", + "node_id": "MDc6TGljZW5zZTE=" + }, + { + "key": "apache-2.0", + "name": "Apache License 2.0", + "spdx_id": "Apache-2.0", + "url": "https://api.github.com/licenses/apache-2.0", + "node_id": "MDc6TGljZW5zZTI=" + }, + { + "key": "bsd-2-clause", + "name": "BSD 2-Clause \"Simplified\" License", + "spdx_id": "BSD-2-Clause", + "url": "https://api.github.com/licenses/bsd-2-clause", + "node_id": "MDc6TGljZW5zZTQ=" + }, + { + "key": "bsd-3-clause", + "name": "BSD 3-Clause \"New\" or \"Revised\" License", + "spdx_id": "BSD-3-Clause", + "url": "https://api.github.com/licenses/bsd-3-clause", + "node_id": "MDc6TGljZW5zZTU=" + }, + { + "key": "epl-2.0", + "name": "Eclipse Public License 2.0", + "spdx_id": "EPL-2.0", + "url": "https://api.github.com/licenses/epl-2.0", + "node_id": "MDc6TGljZW5zZTMy" + }, + { + "key": "gpl-2.0", + "name": "GNU General Public License v2.0", + "spdx_id": "GPL-2.0", + "url": "https://api.github.com/licenses/gpl-2.0", + "node_id": "MDc6TGljZW5zZTg=" + }, + { + "key": "gpl-3.0", + "name": "GNU General Public License v3.0", + "spdx_id": "GPL-3.0", + "url": "https://api.github.com/licenses/gpl-3.0", + "node_id": "MDc6TGljZW5zZTk=" + }, + { + "key": "lgpl-2.1", + "name": "GNU Lesser General Public License v2.1", + "spdx_id": "LGPL-2.1", + "url": "https://api.github.com/licenses/lgpl-2.1", + "node_id": "MDc6TGljZW5zZTEx" + }, + { + "key": "lgpl-3.0", + "name": "GNU Lesser General Public License v3.0", + "spdx_id": "LGPL-3.0", + "url": "https://api.github.com/licenses/lgpl-3.0", + "node_id": "MDc6TGljZW5zZTEy" + }, + { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + { + "key": "mpl-2.0", + "name": "Mozilla Public License 2.0", + "spdx_id": "MPL-2.0", + "url": "https://api.github.com/licenses/mpl-2.0", + "node_id": "MDc6TGljZW5zZTE0" + }, + { + "key": "unlicense", + "name": "The Unlicense", + "spdx_id": "Unlicense", + "url": "https://api.github.com/licenses/unlicense", + "node_id": "MDc6TGljZW5zZTE1" + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicenses/__files/user-dfe7f772-b859-48ce-919e-54ccde4cdd28.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicenses/__files/user-dfe7f772-b859-48ce-919e-54ccde4cdd28.json new file mode 100644 index 0000000000..41fc9e3d00 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicenses/__files/user-dfe7f772-b859-48ce-919e-54ccde4cdd28.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 168, + "public_gists": 4, + "followers": 136, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicenses/mappings/licenses-2-b3d307.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicenses/mappings/licenses-2-b3d307.json new file mode 100644 index 0000000000..789b180eec --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicenses/mappings/licenses-2-b3d307.json @@ -0,0 +1,42 @@ +{ + "id": "b3d307b7-ab1a-4a9e-9b89-d0a7e8fcd2e8", + "name": "licenses", + "request": { + "url": "/licenses", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "licenses-b3d307b7-ab1a-4a9e-9b89-d0a7e8fcd2e8.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:40 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4558", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"817ce11d2bcbc6e73bfd956126377438\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C177:67D6:1D2C942:22B621B:5D978183" + } + }, + "uuid": "b3d307b7-ab1a-4a9e-9b89-d0a7e8fcd2e8", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicenses/mappings/user-1-dfe7f7.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicenses/mappings/user-1-dfe7f7.json new file mode 100644 index 0000000000..864b3732a8 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicenses/mappings/user-1-dfe7f7.json @@ -0,0 +1,43 @@ +{ + "id": "dfe7f772-b859-48ce-919e-54ccde4cdd28", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-dfe7f772-b859-48ce-919e-54ccde4cdd28.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:39 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4560", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C177:67D6:1D2C91A:22B6203:5D978183" + } + }, + "uuid": "dfe7f772-b859-48ce-919e-54ccde4cdd28", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicensesCheckIndividualLicense/__files/licenses-f00fa680-0dd6-401b-a35f-1ed72d7587a7.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicensesCheckIndividualLicense/__files/licenses-f00fa680-0dd6-401b-a35f-1ed72d7587a7.json new file mode 100644 index 0000000000..cdbd51e907 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicensesCheckIndividualLicense/__files/licenses-f00fa680-0dd6-401b-a35f-1ed72d7587a7.json @@ -0,0 +1,86 @@ +[ + { + "key": "agpl-3.0", + "name": "GNU Affero General Public License v3.0", + "spdx_id": "AGPL-3.0", + "url": "https://api.github.com/licenses/agpl-3.0", + "node_id": "MDc6TGljZW5zZTE=" + }, + { + "key": "apache-2.0", + "name": "Apache License 2.0", + "spdx_id": "Apache-2.0", + "url": "https://api.github.com/licenses/apache-2.0", + "node_id": "MDc6TGljZW5zZTI=" + }, + { + "key": "bsd-2-clause", + "name": "BSD 2-Clause \"Simplified\" License", + "spdx_id": "BSD-2-Clause", + "url": "https://api.github.com/licenses/bsd-2-clause", + "node_id": "MDc6TGljZW5zZTQ=" + }, + { + "key": "bsd-3-clause", + "name": "BSD 3-Clause \"New\" or \"Revised\" License", + "spdx_id": "BSD-3-Clause", + "url": "https://api.github.com/licenses/bsd-3-clause", + "node_id": "MDc6TGljZW5zZTU=" + }, + { + "key": "epl-2.0", + "name": "Eclipse Public License 2.0", + "spdx_id": "EPL-2.0", + "url": "https://api.github.com/licenses/epl-2.0", + "node_id": "MDc6TGljZW5zZTMy" + }, + { + "key": "gpl-2.0", + "name": "GNU General Public License v2.0", + "spdx_id": "GPL-2.0", + "url": "https://api.github.com/licenses/gpl-2.0", + "node_id": "MDc6TGljZW5zZTg=" + }, + { + "key": "gpl-3.0", + "name": "GNU General Public License v3.0", + "spdx_id": "GPL-3.0", + "url": "https://api.github.com/licenses/gpl-3.0", + "node_id": "MDc6TGljZW5zZTk=" + }, + { + "key": "lgpl-2.1", + "name": "GNU Lesser General Public License v2.1", + "spdx_id": "LGPL-2.1", + "url": "https://api.github.com/licenses/lgpl-2.1", + "node_id": "MDc6TGljZW5zZTEx" + }, + { + "key": "lgpl-3.0", + "name": "GNU Lesser General Public License v3.0", + "spdx_id": "LGPL-3.0", + "url": "https://api.github.com/licenses/lgpl-3.0", + "node_id": "MDc6TGljZW5zZTEy" + }, + { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + { + "key": "mpl-2.0", + "name": "Mozilla Public License 2.0", + "spdx_id": "MPL-2.0", + "url": "https://api.github.com/licenses/mpl-2.0", + "node_id": "MDc6TGljZW5zZTE0" + }, + { + "key": "unlicense", + "name": "The Unlicense", + "spdx_id": "Unlicense", + "url": "https://api.github.com/licenses/unlicense", + "node_id": "MDc6TGljZW5zZTE1" + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicensesCheckIndividualLicense/__files/user-b8102c16-0e43-4f4d-96c1-7d6cfb5981c2.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicensesCheckIndividualLicense/__files/user-b8102c16-0e43-4f4d-96c1-7d6cfb5981c2.json new file mode 100644 index 0000000000..41fc9e3d00 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicensesCheckIndividualLicense/__files/user-b8102c16-0e43-4f4d-96c1-7d6cfb5981c2.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 168, + "public_gists": 4, + "followers": 136, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicensesCheckIndividualLicense/mappings/licenses-2-f00fa6.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicensesCheckIndividualLicense/mappings/licenses-2-f00fa6.json new file mode 100644 index 0000000000..c7138f1249 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicensesCheckIndividualLicense/mappings/licenses-2-f00fa6.json @@ -0,0 +1,42 @@ +{ + "id": "f00fa680-0dd6-401b-a35f-1ed72d7587a7", + "name": "licenses", + "request": { + "url": "/licenses", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "licenses-f00fa680-0dd6-401b-a35f-1ed72d7587a7.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:38 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4568", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"817ce11d2bcbc6e73bfd956126377438\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C16E:78E9:15A3A1A:19D2447:5D978181" + } + }, + "uuid": "f00fa680-0dd6-401b-a35f-1ed72d7587a7", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicensesCheckIndividualLicense/mappings/user-1-b8102c.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicensesCheckIndividualLicense/mappings/user-1-b8102c.json new file mode 100644 index 0000000000..75754a0027 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/listLicensesCheckIndividualLicense/mappings/user-1-b8102c.json @@ -0,0 +1,43 @@ +{ + "id": "b8102c16-0e43-4f4d-96c1-7d6cfb5981c2", + "name": "user", + "request": { + "url": "/user", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "user-b8102c16-0e43-4f4d-96c1-7d6cfb5981c2.json", + "headers": { + "Date": "Fri, 04 Oct 2019 17:29:37 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4570", + "X-RateLimit-Reset": "1570212957", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C16E:78E9:15A39FF:19D2438:5D978181" + } + }, + "uuid": "b8102c16-0e43-4f4d-96c1-7d6cfb5981c2", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file From 20cfb26a7fedf95951ea7016ec5787bb3417db59 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Fri, 4 Oct 2019 10:36:09 -0700 Subject: [PATCH 5/8] Disable Licence content test Need to mock raw.githubusercontent.com to make this work --- pom.xml | 8 ++++++++ src/test/java/org/kohsuke/github/GHLicenseTest.java | 2 ++ 2 files changed, 10 insertions(+) diff --git a/pom.xml b/pom.xml index 71e8021b48..3ab4165574 100644 --- a/pom.xml +++ b/pom.xml @@ -38,6 +38,14 @@ + + + src/test/resources + + **/wiremock/** + + + maven-compiler-plugin diff --git a/src/test/java/org/kohsuke/github/GHLicenseTest.java b/src/test/java/org/kohsuke/github/GHLicenseTest.java index 2ddbd50c8e..e16831c5b3 100644 --- a/src/test/java/org/kohsuke/github/GHLicenseTest.java +++ b/src/test/java/org/kohsuke/github/GHLicenseTest.java @@ -169,6 +169,8 @@ public void checkRepositoryFullLicense() throws IOException { */ @Test public void checkRepositoryLicenseContent() throws IOException { + requireProxy("Uses https://raw.githubusercontent.com which is not wiremocked yet."); + GHRepository repo = gitHub.getRepository("pomes/pomes"); GHContent content = repo.getLicenseContent(); assertNotNull("The license content is populated", content); From 41c51646fef8ec8c071eb1d3e27c6b8807eb75e7 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Fri, 4 Oct 2019 21:02:44 -0700 Subject: [PATCH 6/8] Rename GitHubApiWireMockRule to GitHubWireMockRule --- .../junit/{GitHubApiWireMockRule.java => GitHubWireMockRule.java} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/test/java/org/kohsuke/github/junit/{GitHubApiWireMockRule.java => GitHubWireMockRule.java} (100%) diff --git a/src/test/java/org/kohsuke/github/junit/GitHubApiWireMockRule.java b/src/test/java/org/kohsuke/github/junit/GitHubWireMockRule.java similarity index 100% rename from src/test/java/org/kohsuke/github/junit/GitHubApiWireMockRule.java rename to src/test/java/org/kohsuke/github/junit/GitHubWireMockRule.java From 552edf86988137c2a836f57259636476a0bebc29 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Fri, 4 Oct 2019 21:06:00 -0700 Subject: [PATCH 7/8] Switch to WireMockMultiServerRule as base --- .../github/AbstractGitHubApiTestBase.java | 4 +- ...t.java => AbstractGitHubWireMockTest.java} | 30 +-- src/test/java/org/kohsuke/github/AppTest.java | 10 +- .../java/org/kohsuke/github/CommitTest.java | 2 +- .../java/org/kohsuke/github/GHAppTest.java | 2 +- .../kohsuke/github/GHOrganizationTest.java | 4 +- .../org/kohsuke/github/GHProjectCardTest.java | 4 +- .../kohsuke/github/GHProjectColumnTest.java | 4 +- .../org/kohsuke/github/GHProjectTest.java | 4 +- .../org/kohsuke/github/GHPullRequestTest.java | 4 +- .../org/kohsuke/github/GHRepositoryTest.java | 2 +- .../java/org/kohsuke/github/GHTeamTest.java | 2 +- .../java/org/kohsuke/github/GistTest.java | 2 +- .../java/org/kohsuke/github/UserTest.java | 2 +- .../github/WireMockStatusReporterTest.java | 30 +-- .../github/extras/OkHttpConnectorTest.java | 34 ++- .../extras/okhttp3/OkHttpConnectorTest.java | 34 +-- .../github/junit/GitHubWireMockRule.java | 200 +++++++++++------- .../github/junit/WireMockMultiServerRule.java | 165 +++++++++++++++ .../kohsuke/github/junit/WireMockRule.java | 124 +---------- .../junit/WireMockRuleConfiguration.java | 176 +++++++++++++++ 21 files changed, 552 insertions(+), 287 deletions(-) rename src/test/java/org/kohsuke/github/{AbstractGitHubApiWireMockTest.java => AbstractGitHubWireMockTest.java} (80%) create mode 100644 src/test/java/org/kohsuke/github/junit/WireMockMultiServerRule.java create mode 100644 src/test/java/org/kohsuke/github/junit/WireMockRuleConfiguration.java diff --git a/src/test/java/org/kohsuke/github/AbstractGitHubApiTestBase.java b/src/test/java/org/kohsuke/github/AbstractGitHubApiTestBase.java index d3c5d5e311..0c5010c32c 100644 --- a/src/test/java/org/kohsuke/github/AbstractGitHubApiTestBase.java +++ b/src/test/java/org/kohsuke/github/AbstractGitHubApiTestBase.java @@ -17,11 +17,11 @@ /** * @author Kohsuke Kawaguchi */ -public abstract class AbstractGitHubApiTestBase extends AbstractGitHubApiWireMockTest { +public abstract class AbstractGitHubApiTestBase extends AbstractGitHubWireMockTest { @Before public void setUp() throws Exception { - assumeTrue("All tests inheriting from this class are not guaranteed to work without proxy", githubApi.isUseProxy()); + assumeTrue("All tests inheriting from this class are not guaranteed to work without proxy", mockGitHub.isUseProxy()); } protected void kohsuke() { diff --git a/src/test/java/org/kohsuke/github/AbstractGitHubApiWireMockTest.java b/src/test/java/org/kohsuke/github/AbstractGitHubWireMockTest.java similarity index 80% rename from src/test/java/org/kohsuke/github/AbstractGitHubApiWireMockTest.java rename to src/test/java/org/kohsuke/github/AbstractGitHubWireMockTest.java index 24f0716214..dfe14af886 100644 --- a/src/test/java/org/kohsuke/github/AbstractGitHubApiWireMockTest.java +++ b/src/test/java/org/kohsuke/github/AbstractGitHubWireMockTest.java @@ -1,34 +1,24 @@ package org.kohsuke.github; -import com.github.tomakehurst.wiremock.common.FileSource; import com.github.tomakehurst.wiremock.core.WireMockConfiguration; -import com.github.tomakehurst.wiremock.extension.Parameters; -import com.github.tomakehurst.wiremock.extension.ResponseTransformer; -import com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer; -import com.github.tomakehurst.wiremock.http.Request; -import com.github.tomakehurst.wiremock.http.Response; import org.apache.commons.io.IOUtils; -import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Rule; -import org.junit.rules.TestWatcher; -import org.kohsuke.github.junit.GitHubApiWireMockRule; -import org.kohsuke.github.junit.WireMockRule; +import org.kohsuke.github.junit.GitHubWireMockRule; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.util.Properties; -import static com.github.tomakehurst.wiremock.client.WireMock.*; import static org.junit.Assume.assumeFalse; import static org.junit.Assume.assumeTrue; /** * @author Liam Newman */ -public abstract class AbstractGitHubApiWireMockTest extends Assert { +public abstract class AbstractGitHubWireMockTest extends Assert { private final GitHubBuilder githubBuilder = createGitHubBuilder(); @@ -56,10 +46,10 @@ public abstract class AbstractGitHubApiWireMockTest extends Assert { protected final String baseRecordPath = "src/test/resources/" + baseFilesClassPath + "/wiremock"; @Rule - public final GitHubApiWireMockRule githubApi; + public final GitHubWireMockRule mockGitHub; - public AbstractGitHubApiWireMockTest() { - githubApi = new GitHubApiWireMockRule( + public AbstractGitHubWireMockTest() { + mockGitHub = new GitHubWireMockRule( this.getWireMockOptions() ); } @@ -103,7 +93,7 @@ private static GitHubBuilder createGitHubBuilder() { protected GitHubBuilder getGitHubBuilder() { GitHubBuilder builder = githubBuilder.clone(); - if (!githubApi.isUseProxy()) { + if (!mockGitHub.isUseProxy()) { // This sets the user and password to a placeholder for wiremock testing // This makes the tests believe they are running with permissions // The recorded stubs will behave like they running with permissions @@ -117,14 +107,14 @@ protected GitHubBuilder getGitHubBuilder() { @Before public void wireMockSetup() throws Exception { GitHubBuilder builder = getGitHubBuilder() - .withEndpoint(githubApi.baseUrl()); + .withEndpoint(mockGitHub.apiServer().baseUrl()); if (useDefaultGitHub) { gitHub = builder .build(); } - if (githubApi.isUseProxy()) { + if (mockGitHub.isUseProxy()) { gitHubBeforeAfter = getGitHubBuilder() .withEndpoint("https://api.github.com/") .build(); @@ -134,11 +124,11 @@ public void wireMockSetup() throws Exception { } protected void snapshotNotAllowed() { - assumeFalse("Test contains hand written mappings. Only valid when not taking a snapshot.", githubApi.isTakeSnapshot()); + assumeFalse("Test contains hand written mappings. Only valid when not taking a snapshot.", mockGitHub.isTakeSnapshot()); } protected void requireProxy(String reason) { - assumeTrue("Test only valid when proxying (-Dtest.github.useProxy to enable): " + reason, githubApi.isUseProxy()); + assumeTrue("Test only valid when proxying (-Dtest.github.useProxy to enable): " + reason, mockGitHub.isUseProxy()); } protected GHUser getUser() { diff --git a/src/test/java/org/kohsuke/github/AppTest.java b/src/test/java/org/kohsuke/github/AppTest.java index 570f61cc32..dba81544b2 100755 --- a/src/test/java/org/kohsuke/github/AppTest.java +++ b/src/test/java/org/kohsuke/github/AppTest.java @@ -24,7 +24,7 @@ /** * Unit test for simple App. */ -public class AppTest extends AbstractGitHubApiWireMockTest { +public class AppTest extends AbstractGitHubWireMockTest { static final String GITHUB_API_TEST_REPO = "github-api-test"; private String getTestRepositoryName() throws IOException { @@ -59,7 +59,7 @@ public void testRepositoryWithAutoInitializationCRUD() throws Exception { r.enableIssueTracker(false); r.enableDownloads(false); r.enableWiki(false); - if (githubApi.isUseProxy()) { + if (mockGitHub.isUseProxy()) { Thread.sleep(3000); } assertNotNull(r.getReadme()); @@ -67,7 +67,7 @@ public void testRepositoryWithAutoInitializationCRUD() throws Exception { } private void cleanupRepository(final String name) throws IOException { - if (githubApi.isUseProxy()) { + if (mockGitHub.isUseProxy()) { GHRepository repository = getUser(gitHubBeforeAfter).getRepository(name); if (repository != null) { repository.delete(); @@ -154,7 +154,7 @@ public void testGetIssues() throws Exception { private GHRepository getTestRepository() throws IOException { - if (githubApi.isUseProxy()) { + if (mockGitHub.isUseProxy()) { GHRepository repository = gitHubBeforeAfter .getOrganization(GITHUB_API_TEST_ORG) .getRepository(GITHUB_API_TEST_REPO); @@ -460,7 +460,7 @@ public void tryHook() throws Exception { GHHook hook = r.createWebHook(new URL("http://www.google.com/")); System.out.println(hook); - if (githubApi.isUseProxy()) { + if (mockGitHub.isUseProxy()) { r = gitHubBeforeAfter.getOrganization(GITHUB_API_TEST_ORG).getRepository("github-api"); for (GHHook h : r.getHooks()) { h.delete(); diff --git a/src/test/java/org/kohsuke/github/CommitTest.java b/src/test/java/org/kohsuke/github/CommitTest.java index 9a199700ad..0e6e2e5ff4 100644 --- a/src/test/java/org/kohsuke/github/CommitTest.java +++ b/src/test/java/org/kohsuke/github/CommitTest.java @@ -8,7 +8,7 @@ /** * @author Kohsuke Kawaguchi */ -public class CommitTest extends AbstractGitHubApiWireMockTest { +public class CommitTest extends AbstractGitHubWireMockTest { @Test // issue 152 public void lastStatus() throws IOException { GHTag t = gitHub.getRepository("stapler/stapler").listTags().iterator().next(); diff --git a/src/test/java/org/kohsuke/github/GHAppTest.java b/src/test/java/org/kohsuke/github/GHAppTest.java index 342312ff28..baf5a12cfd 100644 --- a/src/test/java/org/kohsuke/github/GHAppTest.java +++ b/src/test/java/org/kohsuke/github/GHAppTest.java @@ -15,7 +15,7 @@ * * @author Paulo Miguel Almeida */ -public class GHAppTest extends AbstractGitHubApiWireMockTest { +public class GHAppTest extends AbstractGitHubWireMockTest { protected GitHubBuilder getGitHubBuilder() { return super.getGitHubBuilder() diff --git a/src/test/java/org/kohsuke/github/GHOrganizationTest.java b/src/test/java/org/kohsuke/github/GHOrganizationTest.java index 762131c1df..16a8a84f61 100644 --- a/src/test/java/org/kohsuke/github/GHOrganizationTest.java +++ b/src/test/java/org/kohsuke/github/GHOrganizationTest.java @@ -6,7 +6,7 @@ import java.io.IOException; -public class GHOrganizationTest extends AbstractGitHubApiWireMockTest { +public class GHOrganizationTest extends AbstractGitHubWireMockTest { public static final String GITHUB_API_TEST = "github-api-test"; @@ -36,7 +36,7 @@ public void testCreateRepositoryWithAutoInitialization() throws IOException { @After public void cleanUp() throws IOException { - if (githubApi.isUseProxy()) { + if (mockGitHub.isUseProxy()) { GHRepository repository = gitHubBeforeAfter.getOrganization(GITHUB_API_TEST_ORG).getRepository(GITHUB_API_TEST); if (repository != null) { repository.delete(); diff --git a/src/test/java/org/kohsuke/github/GHProjectCardTest.java b/src/test/java/org/kohsuke/github/GHProjectCardTest.java index a8add9b460..e155f86024 100644 --- a/src/test/java/org/kohsuke/github/GHProjectCardTest.java +++ b/src/test/java/org/kohsuke/github/GHProjectCardTest.java @@ -11,7 +11,7 @@ /** * @author Gunnar Skjold */ -public class GHProjectCardTest extends AbstractGitHubApiWireMockTest { +public class GHProjectCardTest extends AbstractGitHubWireMockTest { private GHOrganization org; private GHProject project; private GHProjectColumn column; @@ -72,7 +72,7 @@ public void testDeleteCard() throws IOException { @After public void after() throws IOException { - if(githubApi.isUseProxy()) { + if(mockGitHub.isUseProxy()) { if (card != null) { card = gitHubBeforeAfter.getProjectCard(card.getId()); try { diff --git a/src/test/java/org/kohsuke/github/GHProjectColumnTest.java b/src/test/java/org/kohsuke/github/GHProjectColumnTest.java index fe105191b8..db3003da61 100644 --- a/src/test/java/org/kohsuke/github/GHProjectColumnTest.java +++ b/src/test/java/org/kohsuke/github/GHProjectColumnTest.java @@ -11,7 +11,7 @@ /** * @author Gunnar Skjold */ -public class GHProjectColumnTest extends AbstractGitHubApiWireMockTest { +public class GHProjectColumnTest extends AbstractGitHubWireMockTest { private GHProject project; private GHProjectColumn column; @@ -48,7 +48,7 @@ public void testDeleteColumn() throws IOException { @After public void after() throws IOException { - if(githubApi.isUseProxy()) { + if(mockGitHub.isUseProxy()) { if (column != null) { column = gitHubBeforeAfter .getProjectColumn(column.getId()); diff --git a/src/test/java/org/kohsuke/github/GHProjectTest.java b/src/test/java/org/kohsuke/github/GHProjectTest.java index 97329cebaa..fe1722576d 100644 --- a/src/test/java/org/kohsuke/github/GHProjectTest.java +++ b/src/test/java/org/kohsuke/github/GHProjectTest.java @@ -11,7 +11,7 @@ /** * @author Gunnar Skjold */ -public class GHProjectTest extends AbstractGitHubApiWireMockTest { +public class GHProjectTest extends AbstractGitHubWireMockTest { private GHProject project; @Before @@ -69,7 +69,7 @@ public void testDeleteProject() throws IOException { @After public void after() throws IOException { - if (githubApi.isUseProxy()) { + if (mockGitHub.isUseProxy()) { if (project != null) { project = gitHubBeforeAfter .getProject(project.getId()); diff --git a/src/test/java/org/kohsuke/github/GHPullRequestTest.java b/src/test/java/org/kohsuke/github/GHPullRequestTest.java index a628b1b26c..2a948548b2 100644 --- a/src/test/java/org/kohsuke/github/GHPullRequestTest.java +++ b/src/test/java/org/kohsuke/github/GHPullRequestTest.java @@ -13,13 +13,13 @@ /** * @author Kohsuke Kawaguchi */ -public class GHPullRequestTest extends AbstractGitHubApiWireMockTest { +public class GHPullRequestTest extends AbstractGitHubWireMockTest { @Before @After public void cleanUp() throws Exception { // Cleanup is only needed when proxying - if (!githubApi.isUseProxy()) { + if (!mockGitHub.isUseProxy()) { return; } diff --git a/src/test/java/org/kohsuke/github/GHRepositoryTest.java b/src/test/java/org/kohsuke/github/GHRepositoryTest.java index 99c89fb2c6..fef2aa0bb2 100644 --- a/src/test/java/org/kohsuke/github/GHRepositoryTest.java +++ b/src/test/java/org/kohsuke/github/GHRepositoryTest.java @@ -12,7 +12,7 @@ /** * @author Liam Newman */ -public class GHRepositoryTest extends AbstractGitHubApiWireMockTest { +public class GHRepositoryTest extends AbstractGitHubWireMockTest { @Test public void archive() throws Exception { diff --git a/src/test/java/org/kohsuke/github/GHTeamTest.java b/src/test/java/org/kohsuke/github/GHTeamTest.java index 0d82ef4c57..0e636a9d8b 100644 --- a/src/test/java/org/kohsuke/github/GHTeamTest.java +++ b/src/test/java/org/kohsuke/github/GHTeamTest.java @@ -5,7 +5,7 @@ import java.io.IOException; import java.util.Random; -public class GHTeamTest extends AbstractGitHubApiWireMockTest { +public class GHTeamTest extends AbstractGitHubWireMockTest { @Test public void testSetDescription() throws IOException { diff --git a/src/test/java/org/kohsuke/github/GistTest.java b/src/test/java/org/kohsuke/github/GistTest.java index c0a090a920..5fbb75a400 100644 --- a/src/test/java/org/kohsuke/github/GistTest.java +++ b/src/test/java/org/kohsuke/github/GistTest.java @@ -11,7 +11,7 @@ /** * @author Kohsuke Kawaguchi */ -public class GistTest extends AbstractGitHubApiWireMockTest { +public class GistTest extends AbstractGitHubWireMockTest { /** * CRUD operation. */ diff --git a/src/test/java/org/kohsuke/github/UserTest.java b/src/test/java/org/kohsuke/github/UserTest.java index d37923c1e3..0c974ada5c 100644 --- a/src/test/java/org/kohsuke/github/UserTest.java +++ b/src/test/java/org/kohsuke/github/UserTest.java @@ -8,7 +8,7 @@ /** * @author Kohsuke Kawaguchi */ -public class UserTest extends AbstractGitHubApiWireMockTest { +public class UserTest extends AbstractGitHubWireMockTest { @Test public void listFollowsAndFollowers() throws IOException { GHUser u = gitHub.getUser("rtyler"); diff --git a/src/test/java/org/kohsuke/github/WireMockStatusReporterTest.java b/src/test/java/org/kohsuke/github/WireMockStatusReporterTest.java index f7270158cb..b903d82c8b 100644 --- a/src/test/java/org/kohsuke/github/WireMockStatusReporterTest.java +++ b/src/test/java/org/kohsuke/github/WireMockStatusReporterTest.java @@ -11,13 +11,13 @@ /** - * Tests in this class are meant to show the behavior of {@link AbstractGitHubApiWireMockTest} with proxying on or off. + * Tests in this class are meant to show the behavior of {@link AbstractGitHubWireMockTest} with proxying on or off. *

* The wiremock data for these tests should only be modified by hand - thus most are skipped when snapshotting. * * @author Liam Newman */ -public class WireMockStatusReporterTest extends AbstractGitHubApiWireMockTest { +public class WireMockStatusReporterTest extends AbstractGitHubWireMockTest { @Test public void user_whenProxying_AuthCorrectlyConfigured() throws Exception { @@ -45,7 +45,7 @@ public void user_whenProxying_AuthCorrectlyConfigured() throws Exception { public void user_whenNotProxying_Stubbed() throws Exception { snapshotNotAllowed(); - assumeFalse("Test only valid when not proxying", githubApi.isUseProxy()); + assumeFalse("Test only valid when not proxying", mockGitHub.isUseProxy()); assertThat(gitHub.isAnonymous(), is(false)); assertThat(gitHub.login, equalTo(STUBBED_USER_LOGIN)); @@ -59,10 +59,11 @@ public void user_whenNotProxying_Stubbed() throws Exception { System.out.println("GitHub proxying and user auth correctly configured for user login: " + user.getLogin()); } + @Ignore("Can't run this as WireMock will report failure after the test method completes.") @Test public void BasicBehaviors_whenNotProxying() throws Exception { snapshotNotAllowed(); - assumeFalse("Test only valid when not proxying", githubApi.isUseProxy()); + assumeFalse("Test only valid when not proxying", mockGitHub.isUseProxy()); Exception e = null; GHRepository repo = null; @@ -71,18 +72,18 @@ public void BasicBehaviors_whenNotProxying() throws Exception { repo = gitHub.getRepository("github-api/github-api"); assertThat(repo.getDescription(), equalTo("this is a stubbed description")); - // Valid repository, without stub - fails 500 when not proxying + // Invalid repository, without stub - fails 404 when not proxying try { gitHub.getRepository("jenkinsci/jenkins"); fail(); } catch (Exception ex) { e = ex; } - assertThat(e, Matchers.instanceOf(HttpException.class)); - assertThat("Status should be 500 for missing stubs", ((HttpException) e).getResponseCode(), equalTo(500)); - assertThat(e.getMessage(), equalTo("Stubbed data not found. Set test.github.use-proxy to have WireMock proxy to github")); - // Invalid repository, without stub - fails 500 when not proxying + assertThat(e, Matchers.instanceOf(GHFileNotFoundException.class)); + assertThat(e.getMessage(), containsString("Request was not matched")); + + // Invalid repository, without stub - fails 404 when not proxying e = null; try { gitHub.getRepository("github-api/non-existant-repository"); @@ -91,9 +92,8 @@ public void BasicBehaviors_whenNotProxying() throws Exception { e = ex; } - assertThat(e, Matchers.instanceOf(HttpException.class)); - assertThat("Status should be 500 for missing stubs", ((HttpException) e).getResponseCode(), equalTo(500)); - assertThat(e.getMessage(), equalTo("Stubbed data not found. Set test.github.use-proxy to have WireMock proxy to github")); + assertThat(e, Matchers.instanceOf(GHFileNotFoundException.class)); + assertThat(e.getMessage(), containsString("Request was not matched")); } @Test @@ -126,15 +126,15 @@ public void BasicBehaviors_whenProxying() throws Exception { @Test public void whenSnapshot_EnsureProxy() throws Exception { - assumeTrue("Test only valid when Snapshotting (-Dtest.github.takeSnapshot to enable)", githubApi.isTakeSnapshot()); + assumeTrue("Test only valid when Snapshotting (-Dtest.github.takeSnapshot to enable)", mockGitHub.isTakeSnapshot()); - assertTrue("When taking a snapshot, proxy should automatically be enabled", githubApi.isUseProxy()); + assertTrue("When taking a snapshot, proxy should automatically be enabled", mockGitHub.isUseProxy()); } @Ignore("Not implemented yet") @Test public void whenSnapshot_EnsureRecordToExpectedLocation() throws Exception { - assumeTrue("Test only valid when Snapshotting (-Dtest.github.takeSnapshot to enable)", githubApi.isTakeSnapshot()); + assumeTrue("Test only valid when Snapshotting (-Dtest.github.takeSnapshot to enable)", mockGitHub.isTakeSnapshot()); } } diff --git a/src/test/java/org/kohsuke/github/extras/OkHttpConnectorTest.java b/src/test/java/org/kohsuke/github/extras/OkHttpConnectorTest.java index a8733301a2..cc3d1b88b7 100644 --- a/src/test/java/org/kohsuke/github/extras/OkHttpConnectorTest.java +++ b/src/test/java/org/kohsuke/github/extras/OkHttpConnectorTest.java @@ -11,10 +11,8 @@ import org.junit.Test; import org.kohsuke.github.*; -import javax.xml.datatype.Duration; import java.io.File; import java.io.IOException; -import java.util.Objects; import static org.hamcrest.Matchers.*; import static org.hamcrest.core.Is.is; @@ -41,7 +39,7 @@ * * @author Liam Newman */ -public class OkHttpConnectorTest extends AbstractGitHubApiWireMockTest { +public class OkHttpConnectorTest extends AbstractGitHubWireMockTest { public OkHttpConnectorTest() { useDefaultGitHub = false; @@ -79,7 +77,7 @@ protected WireMockConfiguration getWireMockOptions() { @Before public void setupRepo() throws Exception { - if (githubApi.isUseProxy()) { + if (mockGitHub.isUseProxy()) { GHRepository repo = getRepository(gitHubBeforeAfter); repo.setDescription("Resetting"); @@ -93,7 +91,7 @@ public void setupRepo() throws Exception { public void DefaultConnector() throws Exception { this.gitHub = getGitHubBuilder() - .withEndpoint(githubApi.baseUrl()) + .withEndpoint(mockGitHub.apiServer().baseUrl()) .build(); doTestActions(); @@ -112,7 +110,7 @@ public void OkHttpConnector_NoCache() throws Exception { OkHttpConnector connector = new OkHttpConnector(new OkUrlFactory(client)); this.gitHub = getGitHubBuilder() - .withEndpoint(githubApi.baseUrl()) + .withEndpoint(mockGitHub.apiServer().baseUrl()) .withConnector(connector) .build(); @@ -139,7 +137,7 @@ public void OkHttpConnector_Cache_MaxAgeNone() throws Exception { OkHttpConnector connector = new OkHttpConnector(new OkUrlFactory(client), -1); this.gitHub = getGitHubBuilder() - .withEndpoint(githubApi.baseUrl()) + .withEndpoint(mockGitHub.apiServer().baseUrl()) .withConnector(connector) .build(); @@ -148,7 +146,7 @@ public void OkHttpConnector_Cache_MaxAgeNone() throws Exception { // Testing behavior after change // NOTE: this is wrong! The live data changed! // Due to max-age (default 60 from response) the cache returns the old data. - assertThat(getRepository(gitHub).getDescription(), is(githubApi.getMethodName())); + assertThat(getRepository(gitHub).getDescription(), is(mockGitHub.getMethodName())); checkRequestAndLimit(maxAgeNoneNetworkRequestCount, maxAgeNoneRateLimitUsed); @@ -164,15 +162,15 @@ public void OkHttpConnector_Cache_MaxAge_Three() throws Exception { // NOTE: This test is very timing sensitive. // It can be run locally to verify behavior but snapshot data is to touchy - assumeFalse("Test only valid when not taking a snapshot", githubApi.isTakeSnapshot()); - assumeTrue("Test only valid when proxying (-Dtest.github.useProxy to enable)", githubApi.isUseProxy()); + assumeFalse("Test only valid when not taking a snapshot", mockGitHub.isTakeSnapshot()); + assumeTrue("Test only valid when proxying (-Dtest.github.useProxy to enable)", mockGitHub.isUseProxy()); OkHttpClient client = createClient(true); OkHttpConnector connector = new OkHttpConnector(new OkUrlFactory(client), 3); this.gitHub = getGitHubBuilder() - .withEndpoint(githubApi.baseUrl()) + .withEndpoint(mockGitHub.apiServer().baseUrl()) .withConnector(connector) .build(); @@ -198,7 +196,7 @@ public void OkHttpConnector_Cache_MaxAgeDefault_Zero() throws Exception { OkHttpConnector connector = new OkHttpConnector(new OkUrlFactory(client)); this.gitHub = getGitHubBuilder() - .withEndpoint(githubApi.baseUrl()) + .withEndpoint(mockGitHub.apiServer().baseUrl()) .withConnector(connector) .build(); @@ -228,14 +226,14 @@ private void checkRequestAndLimit(int networkRequestCount, int rateLimitUsed) th } private int getRequestCount() { - return githubApi.countRequestsMatching(RequestPatternBuilder.allRequests().build()).getCount(); + return mockGitHub.apiServer().countRequestsMatching(RequestPatternBuilder.allRequests().build()).getCount(); } private OkHttpClient createClient(boolean useCache) throws IOException { OkHttpClient client = new OkHttpClient(); if (useCache) { - File cacheDir = new File("target/cache/" + baseFilesClassPath + "/" + githubApi.getMethodName()); + File cacheDir = new File("target/cache/" + baseFilesClassPath + "/" + mockGitHub.getMethodName()); cacheDir.mkdirs(); FileUtils.cleanDirectory(cacheDir); Cache cache = new Cache(cacheDir, 100 * 1024L * 1024L); @@ -255,7 +253,7 @@ private OkHttpClient createClient(boolean useCache) throws IOException { private void doTestActions() throws Exception { rateLimitBefore = gitHub.getRateLimit(); - String name = githubApi.getMethodName(); + String name = mockGitHub.getMethodName(); GHRepository repo = getRepository(gitHub); @@ -273,7 +271,7 @@ private void doTestActions() throws Exception { // Get Tricky - make a change via a different client - if (githubApi.isUseProxy()) { + if (mockGitHub.isUseProxy()) { GHRepository altRepo = getRepository(gitHubBeforeAfter); altRepo.setDescription("Tricky"); } @@ -288,13 +286,13 @@ private void pollForChange(String name) throws IOException, InterruptedException getRepository(gitHub).getDescription(); //This is only interesting when running the max-age=3 test which currently only runs with proxy //Disabled to speed up the tests - if (githubApi.isUseProxy()) { + if (mockGitHub.isUseProxy()) { Thread.sleep(1000); } getRepository(gitHub).getDescription(); //This is only interesting when running the max-age=3 test which currently only runs with proxy //Disabled to speed up the tests - if (githubApi.isUseProxy()) { + if (mockGitHub.isUseProxy()) { Thread.sleep(4000); } } diff --git a/src/test/java/org/kohsuke/github/extras/okhttp3/OkHttpConnectorTest.java b/src/test/java/org/kohsuke/github/extras/okhttp3/OkHttpConnectorTest.java index 801fe3e203..a8abb68025 100644 --- a/src/test/java/org/kohsuke/github/extras/okhttp3/OkHttpConnectorTest.java +++ b/src/test/java/org/kohsuke/github/extras/okhttp3/OkHttpConnectorTest.java @@ -8,7 +8,7 @@ import org.apache.commons.io.FileUtils; import org.junit.Before; import org.junit.Test; -import org.kohsuke.github.AbstractGitHubApiWireMockTest; +import org.kohsuke.github.AbstractGitHubWireMockTest; import org.kohsuke.github.GHRateLimit; import org.kohsuke.github.GHRepository; import org.kohsuke.github.GitHub; @@ -42,7 +42,7 @@ * * @author Liam Newman */ -public class OkHttpConnectorTest extends AbstractGitHubApiWireMockTest { +public class OkHttpConnectorTest extends AbstractGitHubWireMockTest { public OkHttpConnectorTest() { useDefaultGitHub = false; @@ -82,7 +82,7 @@ protected WireMockConfiguration getWireMockOptions() { @Before public void setupRepo() throws Exception { - if (githubApi.isUseProxy()) { + if (mockGitHub.isUseProxy()) { GHRepository repo = getRepository(gitHubBeforeAfter); repo.setDescription("Resetting"); @@ -96,7 +96,7 @@ public void setupRepo() throws Exception { public void DefaultConnector() throws Exception { this.gitHub = getGitHubBuilder() - .withEndpoint(githubApi.baseUrl()) + .withEndpoint(mockGitHub.apiServer().baseUrl()) .build(); doTestActions(); @@ -115,7 +115,7 @@ public void OkHttpConnector_NoCache() throws Exception { OkHttpConnector connector = new OkHttpConnector(client); this.gitHub = getGitHubBuilder() - .withEndpoint(githubApi.baseUrl()) + .withEndpoint(mockGitHub.apiServer().baseUrl()) .withConnector(connector) .build(); @@ -142,7 +142,7 @@ public void OkHttpConnector_Cache_MaxAgeNone() throws Exception { OkHttpConnector connector = new OkHttpConnector(client, -1); this.gitHub = getGitHubBuilder() - .withEndpoint(githubApi.baseUrl()) + .withEndpoint(mockGitHub.apiServer().baseUrl()) .withConnector(connector) .build(); @@ -151,7 +151,7 @@ public void OkHttpConnector_Cache_MaxAgeNone() throws Exception { // Testing behavior after change // NOTE: this is wrong! The live data changed! // Due to max-age (default 60 from response) the cache returns the old data. - assertThat(getRepository(gitHub).getDescription(), is(githubApi.getMethodName())); + assertThat(getRepository(gitHub).getDescription(), is(mockGitHub.getMethodName())); checkRequestAndLimit(maxAgeNoneNetworkRequestCount, maxAgeNoneRateLimitUsed); @@ -167,15 +167,15 @@ public void OkHttpConnector_Cache_MaxAge_Three() throws Exception { // NOTE: This test is very timing sensitive. // It can be run locally to verify behavior but snapshot data is to touchy - assumeFalse("Test only valid when not taking a snapshot", githubApi.isTakeSnapshot()); - assumeTrue("Test only valid when proxying (-Dtest.github.useProxy to enable)", githubApi.isUseProxy()); + assumeFalse("Test only valid when not taking a snapshot", mockGitHub.isTakeSnapshot()); + assumeTrue("Test only valid when proxying (-Dtest.github.useProxy to enable)", mockGitHub.isUseProxy()); OkHttpClient client = createClient(true); OkHttpConnector connector = new OkHttpConnector(client, 3); this.gitHub = getGitHubBuilder() - .withEndpoint(githubApi.baseUrl()) + .withEndpoint(mockGitHub.apiServer().baseUrl()) .withConnector(connector) .build(); @@ -201,7 +201,7 @@ public void OkHttpConnector_Cache_MaxAgeDefault_Zero() throws Exception { OkHttpConnector connector = new OkHttpConnector(client); this.gitHub = getGitHubBuilder() - .withEndpoint(githubApi.baseUrl()) + .withEndpoint(mockGitHub.apiServer().baseUrl()) .withConnector(connector) .build(); @@ -231,14 +231,14 @@ private void checkRequestAndLimit(int networkRequestCount, int rateLimitUsed) th } private int getRequestCount() { - return githubApi.countRequestsMatching(RequestPatternBuilder.allRequests().build()).getCount(); + return mockGitHub.apiServer().countRequestsMatching(RequestPatternBuilder.allRequests().build()).getCount(); } private OkHttpClient createClient(boolean useCache) throws IOException { OkHttpClient.Builder builder = new OkHttpClient().newBuilder(); if (useCache) { - File cacheDir = new File("target/cache/" + baseFilesClassPath + "/" + githubApi.getMethodName()); + File cacheDir = new File("target/cache/" + baseFilesClassPath + "/" + mockGitHub.getMethodName()); cacheDir.mkdirs(); FileUtils.cleanDirectory(cacheDir); Cache cache = new Cache(cacheDir, 100 * 1024L * 1024L); @@ -258,7 +258,7 @@ private OkHttpClient createClient(boolean useCache) throws IOException { private void doTestActions() throws Exception { rateLimitBefore = gitHub.getRateLimit(); - String name = githubApi.getMethodName(); + String name = mockGitHub.getMethodName(); GHRepository repo = getRepository(gitHub); @@ -276,7 +276,7 @@ private void doTestActions() throws Exception { // Get Tricky - make a change via a different client - if (githubApi.isUseProxy()) { + if (mockGitHub.isUseProxy()) { GHRepository altRepo = getRepository(gitHubBeforeAfter); altRepo.setDescription("Tricky"); } @@ -291,13 +291,13 @@ private void pollForChange(String name) throws IOException, InterruptedException getRepository(gitHub).getDescription(); //This is only interesting when running the max-age=3 test which currently only runs with proxy //Disabled to speed up the tests - if (githubApi.isUseProxy()) { + if (mockGitHub.isUseProxy()) { Thread.sleep(1000); } getRepository(gitHub).getDescription(); //This is only interesting when running the max-age=3 test which currently only runs with proxy //Disabled to speed up the tests - if (githubApi.isUseProxy()) { + if (mockGitHub.isUseProxy()) { Thread.sleep(4000); } } diff --git a/src/test/java/org/kohsuke/github/junit/GitHubWireMockRule.java b/src/test/java/org/kohsuke/github/junit/GitHubWireMockRule.java index 2f300f0e21..dcb744a9fc 100644 --- a/src/test/java/org/kohsuke/github/junit/GitHubWireMockRule.java +++ b/src/test/java/org/kohsuke/github/junit/GitHubWireMockRule.java @@ -1,36 +1,42 @@ package org.kohsuke.github.junit; +import com.github.tomakehurst.wiremock.WireMockServer; +import com.github.tomakehurst.wiremock.client.VerificationException; +import com.github.tomakehurst.wiremock.client.WireMock; import com.github.tomakehurst.wiremock.common.FileSource; -import com.github.tomakehurst.wiremock.common.InputStreamSource; +import com.github.tomakehurst.wiremock.core.Options; import com.github.tomakehurst.wiremock.core.WireMockConfiguration; import com.github.tomakehurst.wiremock.extension.Parameters; import com.github.tomakehurst.wiremock.extension.ResponseTransformer; -import com.github.tomakehurst.wiremock.http.HttpHeader; -import com.github.tomakehurst.wiremock.http.HttpHeaders; -import com.github.tomakehurst.wiremock.http.Request; -import com.github.tomakehurst.wiremock.http.Response; +import com.github.tomakehurst.wiremock.http.*; +import com.github.tomakehurst.wiremock.verification.*; import com.google.gson.*; -import com.jcraft.jsch.IO; +import org.junit.rules.MethodRule; +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.FrameworkMethod; +import org.junit.runners.model.Statement; -import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; -import java.io.InputStream; import java.lang.reflect.Type; import java.nio.file.Files; import java.nio.file.Path; import java.util.Collection; +import java.util.List; import java.util.Map; import static com.github.tomakehurst.wiremock.client.WireMock.*; -import static com.github.tomakehurst.wiremock.client.WireMock.status; -import static com.github.tomakehurst.wiremock.common.Gzip.gzip; import static com.github.tomakehurst.wiremock.common.Gzip.unGzipToString; /** + * The standard WireMockRule eagerly initializes a WireMockServer. + * This version suptakes a laze approach allowing us to automatically isolate snapshots + * for each method. + * * @author Liam Newman */ -public class GitHubApiWireMockRule extends WireMockRule { +public class GitHubWireMockRule extends WireMockMultiServerRule { // By default the wiremock tests will run without proxy or taking a snapshot. // The tests will use only the stubbed data and will fail if requests are made for missing data. @@ -39,105 +45,87 @@ public class GitHubApiWireMockRule extends WireMockRule { private final static boolean takeSnapshot = System.getProperty("test.github.takeSnapshot", "false") != "false"; private final static boolean useProxy = takeSnapshot || System.getProperty("test.github.useProxy", "false") != "false"; - public GitHubApiWireMockRule(WireMockConfiguration options) { - this(options, true); - } - - public GitHubApiWireMockRule(WireMockConfiguration options, boolean failOnUnmatchedRequests) { - super(options - .extensions( - new ResponseTransformer() { - @Override - public Response transform(Request request, Response response, FileSource files, - Parameters parameters) { - Response.Builder builder = Response.Builder.like(response); - Collection headers = response.getHeaders().all(); - HttpHeader linkHeader = response.getHeaders().getHeader("Link"); - if (linkHeader.isPresent()) { - headers.removeIf(item -> item.keyEquals("Link")); - headers.add(HttpHeader.httpHeader("Link", linkHeader.firstValue() - .replace("https://api.github.com/", - "http://localhost:" + request.getPort() + "/"))); - } - - if ("application/json" - .equals(response.getHeaders().getContentTypeHeader().mimeTypePart())) { - String body; - if (response.getHeaders().getHeader("Content-Encoding").containsValue("gzip")) { - headers.removeIf(item -> item.keyEquals("Content-Encoding")); - body = unGzipToString(response.getBody()); - } else { - body = response.getBodyAsString(); - } + public GitHubWireMockRule() { + this(WireMockConfiguration.options()); + } - builder.body(body - .replace("https://api.github.com/", - "http://localhost:" + request.getPort() + "/")); + public GitHubWireMockRule(WireMockConfiguration options) { + this(options, true); + } - } - builder.headers(new HttpHeaders(headers)); + public GitHubWireMockRule(WireMockConfiguration options, boolean failOnUnmatchedRequests) { + super(options, failOnUnmatchedRequests); + } - return builder.build(); - } + public WireMockServer apiServer() { + return servers.get("default"); + } - @Override - public String getName() { - return "github-api-url-rewrite"; - } - }), - failOnUnmatchedRequests); + public WireMockServer rawServer() { + return servers.get("raw"); } public boolean isUseProxy() { - return GitHubApiWireMockRule.useProxy; + return GitHubWireMockRule.useProxy; } public boolean isTakeSnapshot() { - return GitHubApiWireMockRule.takeSnapshot; + return GitHubWireMockRule.takeSnapshot; + } + + @Override + protected void initializeServers() { + super.initializeServers(); + initializeServer("raw"); + initializeServer("default", new GitHubApiResponseTransformer(this)); } @Override protected void before() { super.before(); if (isUseProxy()) { - this.stubFor( - proxyAllTo("https://api.github.com/") + this.apiServer().stubFor( + proxyAllTo("https://api.github.com") + .atPriority(100) + ); + this.rawServer().stubFor( + proxyAllTo("https://raw.githubusercontent.com") .atPriority(100) ); - } else { - // Just to be super clear - this.stubFor( - any(urlPathMatching(".*")) - .willReturn(status(500).withBody("Stubbed data not found. Set test.github.use-proxy to have WireMock proxy to github")) - .atPriority(100)); } } @Override protected void after() { super.after(); - // To reformat everything - //formatJsonFiles(new File("src/test/resources").toPath()); - if (isTakeSnapshot()) { - this.snapshotRecord(recordSpec() + this.apiServer().snapshotRecord(recordSpec() .forTarget("https://api.github.com") .captureHeader("If-None-Match") .extractTextBodiesOver(255)); + this.rawServer().snapshotRecord(recordSpec() + .forTarget("https://raw.githubusercontent.com") + .captureHeader("If-None-Match") + .extractTextBodiesOver(255)); + // After taking the snapshot, format the output - formatJsonFiles(new File(this.getOptions().filesRoot().getPath()).toPath()); + formatJsonFiles(new File(this.apiServer().getOptions().filesRoot().getPath()).toPath()); + + // For raw server, only fix up mapping files + formatJsonFiles(new File(this.rawServer().getOptions().filesRoot().child("mappings").getPath()).toPath()); } } private void formatJsonFiles(Path path) { // The more consistent we can make the json output the more meaningful it will be. - // TODO: For understandability, rename the files to include the response order Gson g = new Gson().newBuilder().serializeNulls().disableHtmlEscaping().setPrettyPrinting() .registerTypeAdapter(Double.class, new JsonSerializer() { @Override public JsonElement serialize(Double src, Type typeOfSrc, JsonSerializationContext context) { + // Gson by default output numbers as doubles - 0.0 + // Remove the tailing .0, as most most numbers are integer value if(src == src.longValue()) return new JsonPrimitive(src.longValue()); return new JsonPrimitive(src); @@ -153,8 +141,9 @@ public JsonElement serialize(Double src, Type typeOfSrc, JsonSerializationContex String fileText = new String(Files.readAllBytes(filePath)); // while recording responses we replaced all github calls localhost // now we reverse that for storage. - fileText = fileText.replace(this.baseUrl(), - "https://api.github.com"); + fileText = fileText + .replace(this.apiServer().baseUrl(), "https://api.github.com") + .replace(this.rawServer().baseUrl(), "https://raw.githubusercontent.com"); // Can be Array or Map Object parsedObject = g.fromJson(fileText, Object.class); if (parsedObject instanceof Map && filePath.toString().contains("mappings")) { @@ -173,6 +162,8 @@ public JsonElement serialize(Double src, Type typeOfSrc, JsonSerializationContex } private Path renameMappingFile(Path filePath, Map parsedObject) throws IOException { + // Shorten the file names + // For understandability, rename the files to include the response order Path targetPath = filePath; String id = (String)parsedObject.getOrDefault("id", null); Long insertionIndex = ((Double)parsedObject.getOrDefault("insertionIndex", 0.0)).longValue(); @@ -186,4 +177,69 @@ private Path renameMappingFile(Path filePath, Map parsedObject) return targetPath; } + + + /** + * A number of modifications are needed as runtime to make responses + * target the WireMock server and not accidentally switch to using the live + * github servers. + */ + private static class GitHubApiResponseTransformer extends ResponseTransformer { + private final GitHubWireMockRule rule; + + public GitHubApiResponseTransformer(GitHubWireMockRule rule) { + this.rule = rule; + } + + @Override + public Response transform(Request request, Response response, FileSource files, + Parameters parameters) { + Response.Builder builder = Response.Builder.like(response); + Collection headers = response.getHeaders().all(); + + fixListTraversalHeader(response, headers); + + if ("application/json" + .equals(response.getHeaders().getContentTypeHeader().mimeTypePart())) { + + String body; + body = getBodyAsString(response, headers); + + builder.body(body + .replace("https://api.github.com", rule.apiServer().baseUrl()) + .replace("https://raw.githubusercontent.com", rule.rawServer().baseUrl())); + + } + builder.headers(new HttpHeaders(headers)); + + return builder.build(); + } + + private String getBodyAsString(Response response, Collection headers) { + String body; + if (response.getHeaders().getHeader("Content-Encoding").containsValue("gzip")) { + headers.removeIf(item -> item.keyEquals("Content-Encoding")); + body = unGzipToString(response.getBody()); + } else { + body = response.getBodyAsString(); + } + return body; + } + + private void fixListTraversalHeader(Response response, Collection headers) { + HttpHeader linkHeader = response.getHeaders().getHeader("Link"); + if (linkHeader.isPresent()) { + headers.removeIf(item -> item.keyEquals("Link")); + headers.add(HttpHeader.httpHeader("Link", linkHeader.firstValue() + .replace("https://api.github.com", + rule.apiServer().baseUrl()))); + } + } + + @Override + public String getName() { + return "github-api-url-rewrite"; + } + } + } diff --git a/src/test/java/org/kohsuke/github/junit/WireMockMultiServerRule.java b/src/test/java/org/kohsuke/github/junit/WireMockMultiServerRule.java new file mode 100644 index 0000000000..660782272f --- /dev/null +++ b/src/test/java/org/kohsuke/github/junit/WireMockMultiServerRule.java @@ -0,0 +1,165 @@ +package org.kohsuke.github.junit; + +import com.github.tomakehurst.wiremock.WireMockServer; +import com.github.tomakehurst.wiremock.client.VerificationException; +import com.github.tomakehurst.wiremock.client.WireMock; +import com.github.tomakehurst.wiremock.core.Options; +import com.github.tomakehurst.wiremock.extension.Extension; +import com.github.tomakehurst.wiremock.verification.LoggedRequest; +import com.github.tomakehurst.wiremock.verification.NearMiss; +import org.junit.rules.MethodRule; +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.FrameworkMethod; +import org.junit.runners.model.Statement; + +import java.io.File; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * The standard WireMockRule eagerly initializes a WireMockServer. + * This version supports multiple servers in one rule and + * takes a lazy approach to intitialization allowing us to + * isolate files snapshots for each method. + * + * @author Liam Newman + */ +public class WireMockMultiServerRule implements MethodRule, TestRule { + + protected final Map servers = new HashMap<>(); + private boolean failOnUnmatchedRequests; + private final Options options; + + public String getMethodName() { + return methodName; + } + + private String methodName = null; + + + public WireMockMultiServerRule(Options options) { + this(options, true); + } + + public WireMockMultiServerRule(Options options, boolean failOnUnmatchedRequests) { + this.options = options; + this.failOnUnmatchedRequests = failOnUnmatchedRequests; + } + + public WireMockMultiServerRule() { + this(WireMockRuleConfiguration.wireMockConfig()); + } + + public Statement apply(Statement base, Description description) { + return this.apply(base, description.getMethodName()); + } + + public Statement apply(final Statement base, FrameworkMethod method, Object target) { + return this.apply(base, method.getName()); + } + + private Statement apply(final Statement base, final String methodName) { + return new Statement() { + public void evaluate() throws Throwable { + WireMockMultiServerRule.this.methodName = methodName; + initializeServers(); + WireMock.configureFor("localhost", + WireMockMultiServerRule.this.servers.get("default").port()); + + try { + WireMockMultiServerRule.this.before(); + base.evaluate(); + WireMockMultiServerRule.this.checkForUnmatchedRequests(); + } finally { + WireMockMultiServerRule.this.after(); + WireMockMultiServerRule.this.stop(); + WireMockMultiServerRule.this.methodName = null; + WireMockMultiServerRule.this.servers.clear(); + } + + } + }; + } + + protected void initializeServers() { + } + + protected final void initializeServer(String serverId, Extension... extensions) { + String directoryName = methodName; + if (!serverId.equals("default")) { + directoryName += "_" + serverId; + } + + final Options localOptions = new WireMockRuleConfiguration( + WireMockMultiServerRule.this.options, + directoryName, extensions); + + new File(localOptions.filesRoot().getPath(), "mappings").mkdirs(); + new File(localOptions.filesRoot().getPath(), "__files").mkdirs(); + + WireMockServer server = new WireMockServer(localOptions); + this.servers.put(serverId, server); + server.start(); + + if (!serverId.equals("default")) { + WireMock.configureFor("localhost", server.port()); + } + } + + protected void before() { + } + + protected void after() { + } + + private void checkForUnmatchedRequests() { + servers.values().forEach(server -> checkForUnmatchedRequests(server)); + } + + private void checkForUnmatchedRequests(WireMockServer server) { + if (this.failOnUnmatchedRequests) { + List unmatchedRequests = server.findAllUnmatchedRequests(); + if (!unmatchedRequests.isEmpty()) { + List nearMisses = server.findNearMissesForAllUnmatchedRequests(); + if (nearMisses.isEmpty()) { + throw VerificationException.forUnmatchedRequests(unmatchedRequests); + } + + throw VerificationException.forUnmatchedNearMisses(nearMisses); + } + } + + } + + private boolean deleteEmptyFolders(File path) { + boolean deleteable = path.isDirectory(); + if (deleteable) { + for (File file : path.listFiles()) { + // if at any point in tree we find something we can't delete + // we don't need to keep + if (!deleteEmptyFolders(file)) { + deleteable = false; + } + } + + if (deleteable) { + deleteable = deleteable && path.delete(); + } + } + return deleteable; + + } + + private void stop() { + servers.values().forEach(server -> { + server.stop(); + // server left behinds empty folders delete them + deleteEmptyFolders(new File(server.getOptions().filesRoot().getPath())); + }); + } + + + +} diff --git a/src/test/java/org/kohsuke/github/junit/WireMockRule.java b/src/test/java/org/kohsuke/github/junit/WireMockRule.java index 55cb83693f..aa60691379 100644 --- a/src/test/java/org/kohsuke/github/junit/WireMockRule.java +++ b/src/test/java/org/kohsuke/github/junit/WireMockRule.java @@ -78,7 +78,7 @@ public WireMockRule(int port, Integer httpsPort) { } public WireMockRule() { - this(WireMockConfiguration.wireMockConfig()); + this(WireMockRuleConfiguration.wireMockConfig()); } public Statement apply(Statement base, Description description) { @@ -93,7 +93,7 @@ private Statement apply(final Statement base, final String methodName) { return new Statement() { public void evaluate() throws Throwable { WireMockRule.this.methodName = methodName; - final Options localOptions = new WireMockOptions( + final Options localOptions = new WireMockRuleConfiguration( WireMockRule.this.options, methodName); @@ -139,126 +139,6 @@ protected void before() { protected void after() { } - - private class WireMockOptions implements Options { - - private final Options wireMockConfiguration; - private final String childDirectory; - private final FileSource childSource; - private final MappingsSource mappingsSource; - - public WireMockOptions(Options options, String childDirectory) { - wireMockConfiguration = options; - this.childDirectory = childDirectory; - childSource = wireMockConfiguration.filesRoot().child(childDirectory); - mappingsSource = new JsonFileMappingsSource(childSource.child("mappings")); - } - - public int portNumber() { - return wireMockConfiguration.portNumber(); - } - - public int containerThreads() { - return wireMockConfiguration.containerThreads(); - } - - public HttpsSettings httpsSettings() { - return wireMockConfiguration.httpsSettings(); - } - - public JettySettings jettySettings() { - return wireMockConfiguration.jettySettings(); - } - - public boolean browserProxyingEnabled() { - return wireMockConfiguration.browserProxyingEnabled(); - } - - public ProxySettings proxyVia() { - return wireMockConfiguration.proxyVia(); - } - - public FileSource filesRoot() { - return childSource; - } - - public MappingsLoader mappingsLoader() { - return mappingsSource; - } - - public MappingsSaver mappingsSaver() { - return mappingsSource; - } - - public Notifier notifier() { - return wireMockConfiguration.notifier(); - } - - public boolean requestJournalDisabled() { - return wireMockConfiguration.requestJournalDisabled(); - } - - public Optional maxRequestJournalEntries() { - return wireMockConfiguration.maxRequestJournalEntries(); - } - - public String bindAddress() { - return wireMockConfiguration.bindAddress(); - } - - public List matchingHeaders() { - return wireMockConfiguration.matchingHeaders(); - } - - public HttpServerFactory httpServerFactory() { - return wireMockConfiguration.httpServerFactory(); - } - - public ThreadPoolFactory threadPoolFactory() { - return wireMockConfiguration.threadPoolFactory(); - } - - public boolean shouldPreserveHostHeader() { - return wireMockConfiguration.shouldPreserveHostHeader(); - } - - public String proxyHostHeader() { - return wireMockConfiguration.proxyHostHeader(); - } - - public Map extensionsOfType(Class extensionType) { - return wireMockConfiguration.extensionsOfType(extensionType); - } - - public WiremockNetworkTrafficListener networkTrafficListener() { - return wireMockConfiguration.networkTrafficListener(); - } - - public Authenticator getAdminAuthenticator() { - return wireMockConfiguration.getAdminAuthenticator(); - } - - public boolean getHttpsRequiredForAdminApi() { - return wireMockConfiguration.getHttpsRequiredForAdminApi(); - } - - public NotMatchedRenderer getNotMatchedRenderer() { - return wireMockConfiguration.getNotMatchedRenderer(); - } - - public AsynchronousResponseSettings getAsynchronousResponseSettings() { - return wireMockConfiguration.getAsynchronousResponseSettings(); - } - - public ChunkedEncodingPolicy getChunkedEncodingPolicy() { - return wireMockConfiguration.getChunkedEncodingPolicy(); - } - - public boolean getGzipDisabled() { - return wireMockConfiguration.getGzipDisabled(); - } - } - public void loadMappingsUsing(MappingsLoader mappingsLoader) { wireMockServer.loadMappingsUsing(mappingsLoader); } diff --git a/src/test/java/org/kohsuke/github/junit/WireMockRuleConfiguration.java b/src/test/java/org/kohsuke/github/junit/WireMockRuleConfiguration.java new file mode 100644 index 0000000000..330afc2aaf --- /dev/null +++ b/src/test/java/org/kohsuke/github/junit/WireMockRuleConfiguration.java @@ -0,0 +1,176 @@ +package org.kohsuke.github.junit; + +import com.github.tomakehurst.wiremock.common.*; +import com.github.tomakehurst.wiremock.core.MappingsSaver; +import com.github.tomakehurst.wiremock.core.Options; +import com.github.tomakehurst.wiremock.core.WireMockConfiguration; +import com.github.tomakehurst.wiremock.extension.Extension; +import com.github.tomakehurst.wiremock.extension.ExtensionLoader; +import com.github.tomakehurst.wiremock.http.CaseInsensitiveKey; +import com.github.tomakehurst.wiremock.http.HttpServerFactory; +import com.github.tomakehurst.wiremock.http.ThreadPoolFactory; +import com.github.tomakehurst.wiremock.http.trafficlistener.WiremockNetworkTrafficListener; +import com.github.tomakehurst.wiremock.security.Authenticator; +import com.github.tomakehurst.wiremock.standalone.JsonFileMappingsSource; +import com.github.tomakehurst.wiremock.standalone.MappingsLoader; +import com.github.tomakehurst.wiremock.standalone.MappingsSource; +import com.github.tomakehurst.wiremock.verification.notmatched.NotMatchedRenderer; +import wiremock.com.google.common.base.Optional; +import wiremock.com.google.common.collect.Maps; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +public class WireMockRuleConfiguration implements Options { + + private final Options parent; + private final String childDirectory; + private MappingsSource mappingsSource; + private Map extensions = Maps.newLinkedHashMap(); + + WireMockRuleConfiguration() { + this(WireMockConfiguration.options(), null); + } + + WireMockRuleConfiguration(Options parent, String childDirectory, Extension... extensionInstances) { + this.parent = parent; + this.childDirectory = childDirectory; + this.extensions.putAll(ExtensionLoader.asMap(Arrays.asList(extensionInstances))); + } + + public static WireMockRuleConfiguration wireMockConfig() { + return new WireMockRuleConfiguration(); + } + + public static WireMockRuleConfiguration options() { + return wireMockConfig(); + } + + public WireMockRuleConfiguration forChildPath(String childPath) { + return new WireMockRuleConfiguration(this, childPath); + } + + private MappingsSource getMappingsSource() { + if (this.mappingsSource == null) { + this.mappingsSource = new JsonFileMappingsSource(this.filesRoot().child("mappings")); + } + + return this.mappingsSource; + } + + public FileSource filesRoot() { + return childDirectory != null ? parent.filesRoot().child(childDirectory) : parent.filesRoot(); + } + + public MappingsLoader mappingsLoader() { + return this.getMappingsSource(); + } + + public MappingsSaver mappingsSaver() { + return this.getMappingsSource(); + } + + public WireMockRuleConfiguration mappingSource(MappingsSource mappingsSource) { + this.mappingsSource = mappingsSource; + return this; + } + + public Map extensionsOfType(Class extensionType) { + Map result = Maps.newLinkedHashMap(this.parent.extensionsOfType(extensionType)); + result.putAll((Map)Maps.filterEntries(this.extensions, ExtensionLoader.valueAssignableFrom(extensionType))); + return result; + } + + + // Simple wrappers + + + public int portNumber() { + return parent.portNumber(); + } + + public int containerThreads() { + return parent.containerThreads(); + } + + public HttpsSettings httpsSettings() { + return parent.httpsSettings(); + } + + public JettySettings jettySettings() { + return parent.jettySettings(); + } + + public boolean browserProxyingEnabled() { + return parent.browserProxyingEnabled(); + } + + public ProxySettings proxyVia() { + return parent.proxyVia(); + } + + public Notifier notifier() { + return parent.notifier(); + } + + public boolean requestJournalDisabled() { + return parent.requestJournalDisabled(); + } + + public Optional maxRequestJournalEntries() { + return parent.maxRequestJournalEntries(); + } + + public String bindAddress() { + return parent.bindAddress(); + } + + public List matchingHeaders() { + return parent.matchingHeaders(); + } + + public HttpServerFactory httpServerFactory() { + return parent.httpServerFactory(); + } + + public ThreadPoolFactory threadPoolFactory() { + return parent.threadPoolFactory(); + } + + public boolean shouldPreserveHostHeader() { + return parent.shouldPreserveHostHeader(); + } + + public String proxyHostHeader() { + return parent.proxyHostHeader(); + } + + public WiremockNetworkTrafficListener networkTrafficListener() { + return parent.networkTrafficListener(); + } + + public Authenticator getAdminAuthenticator() { + return parent.getAdminAuthenticator(); + } + + public boolean getHttpsRequiredForAdminApi() { + return parent.getHttpsRequiredForAdminApi(); + } + + public NotMatchedRenderer getNotMatchedRenderer() { + return parent.getNotMatchedRenderer(); + } + + public AsynchronousResponseSettings getAsynchronousResponseSettings() { + return parent.getAsynchronousResponseSettings(); + } + + public ChunkedEncodingPolicy getChunkedEncodingPolicy() { + return parent.getChunkedEncodingPolicy(); + } + + public boolean getGzipDisabled() { + return parent.getGzipDisabled(); + } +} From dc2830d94f7bc404cc1c10f7114e627dca3cc90a Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Fri, 4 Oct 2019 21:06:15 -0700 Subject: [PATCH 8/8] Enable Content test --- .../org/kohsuke/github/GHLicenseTest.java | 16 +- ...e-050b93b9-0d3b-4dd2-bde1-a220548659e4.txt | 202 ++++++++++++++++++ .../pomes_pomes_master_license-1-050b93.json | 40 ++++ 3 files changed, 248 insertions(+), 10 deletions(-) create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent_raw/__files/pomes_pomes_master_license-050b93b9-0d3b-4dd2-bde1-a220548659e4.txt create mode 100644 src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent_raw/mappings/pomes_pomes_master_license-1-050b93.json diff --git a/src/test/java/org/kohsuke/github/GHLicenseTest.java b/src/test/java/org/kohsuke/github/GHLicenseTest.java index e16831c5b3..9a77972c34 100644 --- a/src/test/java/org/kohsuke/github/GHLicenseTest.java +++ b/src/test/java/org/kohsuke/github/GHLicenseTest.java @@ -25,8 +25,6 @@ package org.kohsuke.github; import org.apache.commons.io.IOUtils; -import org.junit.Assert; -import org.junit.Before; import org.junit.Test; import java.io.IOException; @@ -35,7 +33,7 @@ /** * @author Duncan Dickinson */ -public class GHLicenseTest extends AbstractGitHubApiWireMockTest { +public class GHLicenseTest extends AbstractGitHubWireMockTest { /** * Basic test to ensure that the list of licenses from {@link GitHub#listLicenses()} is returned @@ -59,7 +57,7 @@ public void listLicensesCheckIndividualLicense() throws IOException { PagedIterable licenses = gitHub.listLicenses(); for (GHLicense lic : licenses) { if (lic.getKey().equals("mit")) { - assertTrue(lic.getUrl().equals(new URL(githubApi.baseUrl() + "/licenses/mit"))); + assertTrue(lic.getUrl().equals(new URL(mockGitHub.apiServer().baseUrl() + "/licenses/mit"))); return; } } @@ -94,7 +92,7 @@ public void checkRepositoryLicense() throws IOException { assertNotNull("The license is populated", license); assertTrue("The key is correct", license.getKey().equals("mit")); assertTrue("The name is correct", license.getName().equals("MIT License")); - assertTrue("The URL is correct", license.getUrl().equals(new URL(githubApi.baseUrl() + "/licenses/mit"))); + assertTrue("The URL is correct", license.getUrl().equals(new URL(mockGitHub.apiServer().baseUrl() + "/licenses/mit"))); } /** @@ -110,7 +108,7 @@ public void checkRepositoryLicenseAtom() throws IOException { assertNotNull("The license is populated", license); assertTrue("The key is correct", license.getKey().equals("mit")); assertTrue("The name is correct", license.getName().equals("MIT License")); - assertTrue("The URL is correct", license.getUrl().equals(new URL(githubApi.baseUrl() + "/licenses/mit"))); + assertTrue("The URL is correct", license.getUrl().equals(new URL(mockGitHub.apiServer().baseUrl() + "/licenses/mit"))); } /** @@ -126,7 +124,7 @@ public void checkRepositoryLicensePomes() throws IOException { assertNotNull("The license is populated", license); assertTrue("The key is correct", license.getKey().equals("apache-2.0")); assertTrue("The name is correct", license.getName().equals("Apache License 2.0")); - assertTrue("The URL is correct", license.getUrl().equals(new URL(githubApi.baseUrl() + "/licenses/apache-2.0"))); + assertTrue("The URL is correct", license.getUrl().equals(new URL(mockGitHub.apiServer().baseUrl() + "/licenses/apache-2.0"))); } /** @@ -156,7 +154,7 @@ public void checkRepositoryFullLicense() throws IOException { assertNotNull("The license is populated", license); assertTrue("The key is correct", license.getKey().equals("mit")); assertTrue("The name is correct", license.getName().equals("MIT License")); - assertTrue("The URL is correct", license.getUrl().equals(new URL(githubApi.baseUrl() + "/licenses/mit"))); + assertTrue("The URL is correct", license.getUrl().equals(new URL(mockGitHub.apiServer().baseUrl() + "/licenses/mit"))); assertTrue("The HTML URL is correct", license.getHtmlUrl().equals(new URL("http://choosealicense.com/licenses/mit/"))); } @@ -169,8 +167,6 @@ public void checkRepositoryFullLicense() throws IOException { */ @Test public void checkRepositoryLicenseContent() throws IOException { - requireProxy("Uses https://raw.githubusercontent.com which is not wiremocked yet."); - GHRepository repo = gitHub.getRepository("pomes/pomes"); GHContent content = repo.getLicenseContent(); assertNotNull("The license content is populated", content); diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent_raw/__files/pomes_pomes_master_license-050b93b9-0d3b-4dd2-bde1-a220548659e4.txt b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent_raw/__files/pomes_pomes_master_license-050b93b9-0d3b-4dd2-bde1-a220548659e4.txt new file mode 100644 index 0000000000..8371492840 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent_raw/__files/pomes_pomes_master_license-050b93b9-0d3b-4dd2-bde1-a220548659e4.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by value) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class value and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [value of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent_raw/mappings/pomes_pomes_master_license-1-050b93.json b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent_raw/mappings/pomes_pomes_master_license-1-050b93.json new file mode 100644 index 0000000000..021d4f13ce --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHLicenseTest/wiremock/checkRepositoryLicenseContent_raw/mappings/pomes_pomes_master_license-1-050b93.json @@ -0,0 +1,40 @@ +{ + "id": "050b93b9-0d3b-4dd2-bde1-a220548659e4", + "name": "pomes_pomes_master_license", + "request": { + "url": "/pomes/pomes/master/LICENSE", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "pomes_pomes_master_license-050b93b9-0d3b-4dd2-bde1-a220548659e4.txt", + "headers": { + "Content-Security-Policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "deny", + "X-XSS-Protection": "1; mode=block", + "ETag": "\"8371492840f9485d7baf719dc2ae3e4cb9e8c03b\"", + "Content-Type": "text/plain; charset=utf-8", + "Cache-Control": "max-age=300", + "X-Geo-Block-List": "", + "X-GitHub-Request-Id": "D052:95E9:35B030:3EB19C:5D97BE56", + "Accept-Ranges": "bytes", + "Date": "Fri, 04 Oct 2019 21:51:06 GMT", + "Via": "1.1 varnish", + "Connection": "keep-alive", + "X-Served-By": "cache-sea1029-SEA", + "X-Cache": "HIT", + "X-Cache-Hits": "1", + "X-Timer": "S1570225867.643479,VS0,VE1", + "Vary": "Authorization,Accept-Encoding", + "Access-Control-Allow-Origin": "*", + "X-Fastly-Request-ID": "ed4498a6662707a954a7a5c0303bd74ec724215a", + "Expires": "Fri, 04 Oct 2019 21:56:06 GMT", + "Source-Age": "116" + } + }, + "uuid": "050b93b9-0d3b-4dd2-bde1-a220548659e4", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file