From 4953f4500d7534d759e69722d99f3cfc28d6af2d Mon Sep 17 00:00:00 2001 From: Bill Collins Date: Thu, 19 Nov 2020 09:07:10 +0000 Subject: [PATCH 1/4] Create check run updater --- .../java/org/kohsuke/github/GHCheckRun.java | 12 +++++++ .../org/kohsuke/github/GHCheckRunBuilder.java | 35 +++++++++++++------ 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/kohsuke/github/GHCheckRun.java b/src/main/java/org/kohsuke/github/GHCheckRun.java index 4f0bbe2730..33d62c8281 100644 --- a/src/main/java/org/kohsuke/github/GHCheckRun.java +++ b/src/main/java/org/kohsuke/github/GHCheckRun.java @@ -1,6 +1,7 @@ package org.kohsuke.github; import com.fasterxml.jackson.annotation.JsonProperty; +import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.IOException; @@ -292,4 +293,15 @@ public static enum AnnotationLevel { NOTICE, WARNING, FAILURE } + /** + * Updates this check run. + * + * @return a builder which you should customize, then call {@link GHCheckRunBuilder#create} + */ + @Preview + @Deprecated + public @NonNull GHCheckRunBuilder update() { + return new GHCheckRunBuilder(owner, getId()); + } + } diff --git a/src/main/java/org/kohsuke/github/GHCheckRunBuilder.java b/src/main/java/org/kohsuke/github/GHCheckRunBuilder.java index d71483c246..6554dec313 100644 --- a/src/main/java/org/kohsuke/github/GHCheckRunBuilder.java +++ b/src/main/java/org/kohsuke/github/GHCheckRunBuilder.java @@ -37,30 +37,45 @@ import java.util.Locale; /** - * Drafts a check run. + * Drafts or updates a check run. * * @see GHCheckRun * @see GHRepository#createCheckRun * @see documentation + * @see GHCheckRun#update() + * @see documentation */ @SuppressFBWarnings(value = "URF_UNREAD_FIELD", justification = "Jackson serializes these even without a getter") @Preview @Deprecated public final class GHCheckRunBuilder { - private final GHRepository repo; - private final Requester requester; + protected final GHRepository repo; + protected final Requester requester; private Output output; private List actions; - GHCheckRunBuilder(GHRepository repo, String name, String headSHA) { + private GHCheckRunBuilder(GHRepository repo, Requester requester) { this.repo = repo; - requester = repo.root.createRequest() - .withPreview(Previews.ANTIOPE) - .method("POST") - .with("name", name) - .with("head_sha", headSHA) - .withUrlPath(repo.getApiTailUrl("check-runs")); + this.requester = requester; + } + + GHCheckRunBuilder(GHRepository repo, String name, String headSHA) { + this(repo, + repo.root.createRequest() + .withPreview(Previews.ANTIOPE) + .method("POST") + .with("name", name) + .with("head_sha", headSHA) + .withUrlPath(repo.getApiTailUrl("check-runs"))); + } + + GHCheckRunBuilder(GHRepository repo, long checkId) { + this(repo, + repo.root.createRequest() + .withPreview(Previews.ANTIOPE) + .method("PATCH") + .withUrlPath(repo.getApiTailUrl("check-runs/" + checkId))); } public @NonNull GHCheckRunBuilder withDetailsURL(@CheckForNull String detailsURL) { From bde6ad9a06cc71db3d0b8b187bfab5f889175b5c Mon Sep 17 00:00:00 2001 From: Bill Collins Date: Thu, 19 Nov 2020 09:19:07 +0000 Subject: [PATCH 2/4] Add a test for check updates --- .../kohsuke/github/GHCheckRunBuilderTest.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/test/java/org/kohsuke/github/GHCheckRunBuilderTest.java b/src/test/java/org/kohsuke/github/GHCheckRunBuilderTest.java index be7a8a5d37..c4ccc1ca37 100644 --- a/src/test/java/org/kohsuke/github/GHCheckRunBuilderTest.java +++ b/src/test/java/org/kohsuke/github/GHCheckRunBuilderTest.java @@ -114,4 +114,26 @@ public void createCheckRunErrMissingConclusion() throws Exception { } } + @Test + public void updateCheckRun() throws Exception { + GHCheckRun checkRun = gitHub.getRepository("jglick/github-api-test") + .createCheckRun("foo", "4a929d464a2fae7ee899ce603250f7dab304bc4b") + .withStatus(GHCheckRun.Status.IN_PROGRESS) + .withStartedAt(new Date(999_999_000)) + .add(new GHCheckRunBuilder.Output("Some Title", "what happened…") + .add(new GHCheckRunBuilder.Annotation("stuff.txt", + 1, + GHCheckRun.AnnotationLevel.NOTICE, + "hello to you too").withTitle("Look here"))) + .create(); + GHCheckRun updated = checkRun.update() + .withStatus(GHCheckRun.Status.COMPLETED) + .withConclusion(GHCheckRun.Conclusion.SUCCESS) + .withCompletedAt(new Date(999_999_999)) + .create(); + assertEquals(updated.getStartedAt(), new Date(999_999_000)); + assertEquals(updated.getName(), "foo"); + assertEquals(1, checkRun.getOutput().getAnnotationsCount()); + } + } From 224d8c7cb473fa0d5290bcef176f9723a46bba65 Mon Sep 17 00:00:00 2001 From: Bill Collins Date: Thu, 19 Nov 2020 15:05:25 +0000 Subject: [PATCH 3/4] Add wiremocks for tests, move existing tests to test org --- .../github/AbstractGHAppInstallationTest.java | 77 +++++++++++ .../kohsuke/github/GHAppInstallationTest.java | 65 +--------- .../kohsuke/github/GHCheckRunBuilderTest.java | 39 +++--- .../ghapi-test-app-3.private-key.pem | 28 ++++ ...-0f55dc07-d441-4193-bec3-85b37825b863.json | 37 ++++++ ...-dde1b767-d20a-4af1-8643-bd7caf43d3b8.json | 45 +++++++ ...-73733d52-fafe-43ee-bc64-59da1776ca71.json | 121 ++++++++++++++++++ ...-b1eec35d-bc33-49b6-a44b-4dcf13cc0f1b.json | 61 +++++++++ .../repos_jglick_github-api-test-1.json | 102 --------------- ...s_jglick_github-api-test_check-runs-2.json | 61 --------- ...-0f55dc07-d441-4193-bec3-85b37825b863.json | 41 ++++++ ...-dde1b767-d20a-4af1-8643-bd7caf43d3b8.json | 41 ++++++ ...-cf0f4d64-2b1c-48db-9c9f-230250d40539.json | 48 +++++++ ...73733d52-fafe-43ee-bc64-59da1776ca71.json} | 32 ++--- ...b1eec35d-bc33-49b6-a44b-4dcf13cc0f1b.json} | 38 +++--- ...-26970c50-1a80-457f-8353-67086d9e73f9.json | 37 ++++++ ...-7f4e32ec-102a-4f04-802f-9b07e8fe11cf.json | 45 +++++++ ...-36f22d0c-fb63-4062-97f1-5bf0f49ba76f.json | 121 ++++++++++++++++++ .../repos_jglick_github-api-test-1.json | 102 --------------- ...-26970c50-1a80-457f-8353-67086d9e73f9.json | 41 ++++++ ...-7f4e32ec-102a-4f04-802f-9b07e8fe11cf.json | 41 ++++++ ...-b3e00f78-6280-4c12-b30c-4058f4c7d001.json | 48 +++++++ ...36f22d0c-fb63-4062-97f1-5bf0f49ba76f.json} | 32 ++--- ...a9b45df4-a52a-4ad4-916e-e199f8b0a56e.json} | 29 +++-- ...-d5ac21ed-d95f-497e-9391-599401628a54.json | 37 ++++++ ...-279b34ba-b004-436c-a881-18ac3bb9af92.json | 45 +++++++ ...-bc025b21-a941-4be8-b658-6eadfdc333f5.json | 121 ++++++++++++++++++ ...-0ee56d4a-d0d3-44e7-831b-84e299eaf47e.json | 61 +++++++++ ...-b00d927c-1c6c-4f49-b568-68327ef7d436.json | 61 +++++++++ ...-f3d54793-977e-48f8-857b-106af311ddea.json | 61 +++++++++ .../repos_jglick_github-api-test-1.json | 102 --------------- ...s_jglick_github-api-test_check-runs-2.json | 61 --------- ...ithub-api-test_check-runs_546384622-3.json | 61 --------- ...ithub-api-test_check-runs_546384622-4.json | 61 --------- ...-d5ac21ed-d95f-497e-9391-599401628a54.json | 41 ++++++ ...-279b34ba-b004-436c-a881-18ac3bb9af92.json | 41 ++++++ ...-29f22c8b-1bfb-45f2-9b5e-bdc1d9cc75b8.json | 48 +++++++ ...bc025b21-a941-4be8-b658-6eadfdc333f5.json} | 32 ++--- ...0ee56d4a-d0d3-44e7-831b-84e299eaf47e.json} | 38 +++--- ...b00d927c-1c6c-4f49-b568-68327ef7d436.json} | 34 ++--- ...f3d54793-977e-48f8-857b-106af311ddea.json} | 34 ++--- ...-823ea390-bde8-482d-a721-16d60f724869.json | 37 ++++++ ...-d364cb68-5447-4396-9201-2653c44aa36c.json | 45 +++++++ ...-2b35bcfa-5524-4f35-985a-5d5bff188b27.json | 121 ++++++++++++++++++ ...-a7a4c155-d928-4d41-8c9d-8a6caa5a851b.json | 61 +++++++++ .../repos_jglick_github-api-test-1.json | 102 --------------- ...s_jglick_github-api-test_check-runs-2.json | 61 --------- ...-823ea390-bde8-482d-a721-16d60f724869.json | 41 ++++++ ...-d364cb68-5447-4396-9201-2653c44aa36c.json | 41 ++++++ ...-da103579-7c4a-4f9b-bc1b-2946405f411b.json | 48 +++++++ ...-2b35bcfa-5524-4f35-985a-5d5bff188b27.json | 46 +++++++ ...a7a4c155-d928-4d41-8c9d-8a6caa5a851b.json} | 38 +++--- ...-e7a9b97e-28ab-4ca2-95c1-b1fc01fc4975.json | 37 ++++++ ...-6d86aab4-68f2-4e10-9e7a-96c591fb3beb.json | 45 +++++++ ...-57003cf3-5da3-415a-b57a-df15cb860c7e.json | 121 ++++++++++++++++++ ...-37c9b28c-591f-4308-ae1a-ef32349069e4.json | 61 +++++++++ .../repos_jglick_github-api-test-1.json | 102 --------------- ...s_jglick_github-api-test_check-runs-2.json | 61 --------- ...-e7a9b97e-28ab-4ca2-95c1-b1fc01fc4975.json | 41 ++++++ ...-6d86aab4-68f2-4e10-9e7a-96c591fb3beb.json | 41 ++++++ ...-4bf80b1a-14a2-4466-bfb2-8062c54be1c7.json | 48 +++++++ ...-57003cf3-5da3-415a-b57a-df15cb860c7e.json | 46 +++++++ ...37c9b28c-591f-4308-ae1a-ef32349069e4.json} | 36 +++--- .../repos_jglick_github-api-test-1.json | 44 ------- ...-3c70ad51-1ec8-4f9a-bcb8-7bfb910eddde.json | 37 ++++++ ...-884f6b51-8fe7-4ad0-ad66-153065217ac9.json | 45 +++++++ ...-332ba146-527b-45e5-bf22-a9e3215f2bb3.json | 121 ++++++++++++++++++ ...-e6a1efc0-842a-4acb-bb97-41992174417f.json | 61 +++++++++ ...-0e994765-90de-46eb-897a-27ab3d509c28.json | 61 +++++++++ ...-3c70ad51-1ec8-4f9a-bcb8-7bfb910eddde.json | 41 ++++++ ...-884f6b51-8fe7-4ad0-ad66-153065217ac9.json | 41 ++++++ ...-f8aa5155-92d9-45b2-ab6b-0da7da04aa90.json | 48 +++++++ ...332ba146-527b-45e5-bf22-a9e3215f2bb3.json} | 32 ++--- ...-e6a1efc0-842a-4acb-bb97-41992174417f.json | 53 ++++++++ ...-0e994765-90de-46eb-897a-27ab3d509c28.json | 52 ++++++++ 75 files changed, 3010 insertions(+), 1177 deletions(-) create mode 100644 src/test/java/org/kohsuke/github/AbstractGHAppInstallationTest.java create mode 100644 src/test/resources/ghapi-test-app-3.private-key.pem create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/app-0f55dc07-d441-4193-bec3-85b37825b863.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/app_installations-dde1b767-d20a-4af1-8643-bd7caf43d3b8.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/repos_hub4j-test-org_test-checks-73733d52-fafe-43ee-bc64-59da1776ca71.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/repos_hub4j-test-org_test-checks_check-runs-b1eec35d-bc33-49b6-a44b-4dcf13cc0f1b.json delete mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/repos_jglick_github-api-test-1.json delete mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/repos_jglick_github-api-test_check-runs-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/app-0f55dc07-d441-4193-bec3-85b37825b863.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/app_installations-dde1b767-d20a-4af1-8643-bd7caf43d3b8.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/app_installations_13064215_access_tokens-cf0f4d64-2b1c-48db-9c9f-230250d40539.json rename src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/{repos_jglick_github-api-test-1.json => repos_hub4j-test-org_test-checks-73733d52-fafe-43ee-bc64-59da1776ca71.json} (55%) rename src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/{repos_jglick_github-api-test_check-runs-2.json => repos_hub4j-test-org_test-checks_check-runs-b1eec35d-bc33-49b6-a44b-4dcf13cc0f1b.json} (61%) create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/__files/app-26970c50-1a80-457f-8353-67086d9e73f9.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/__files/app_installations-7f4e32ec-102a-4f04-802f-9b07e8fe11cf.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/__files/repos_hub4j-test-org_test-checks-36f22d0c-fb63-4062-97f1-5bf0f49ba76f.json delete mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/__files/repos_jglick_github-api-test-1.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/app-26970c50-1a80-457f-8353-67086d9e73f9.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/app_installations-7f4e32ec-102a-4f04-802f-9b07e8fe11cf.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/app_installations_13064215_access_tokens-b3e00f78-6280-4c12-b30c-4058f4c7d001.json rename src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/{repos_jglick_github-api-test-1.json => repos_hub4j-test-org_test-checks-36f22d0c-fb63-4062-97f1-5bf0f49ba76f.json} (55%) rename src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/{repos_jglick_github-api-test_check-runs-2.json => repos_hub4j-test-org_test-checks_check-runs-a9b45df4-a52a-4ad4-916e-e199f8b0a56e.json} (61%) create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/app-d5ac21ed-d95f-497e-9391-599401628a54.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/app_installations-279b34ba-b004-436c-a881-18ac3bb9af92.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_hub4j-test-org_test-checks-bc025b21-a941-4be8-b658-6eadfdc333f5.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_hub4j-test-org_test-checks_check-runs-0ee56d4a-d0d3-44e7-831b-84e299eaf47e.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_hub4j-test-org_test-checks_check-runs_1424883599-b00d927c-1c6c-4f49-b568-68327ef7d436.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_hub4j-test-org_test-checks_check-runs_1424883599-f3d54793-977e-48f8-857b-106af311ddea.json delete mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_jglick_github-api-test-1.json delete mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_jglick_github-api-test_check-runs-2.json delete mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_jglick_github-api-test_check-runs_546384622-3.json delete mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_jglick_github-api-test_check-runs_546384622-4.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/app-d5ac21ed-d95f-497e-9391-599401628a54.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/app_installations-279b34ba-b004-436c-a881-18ac3bb9af92.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/app_installations_13064215_access_tokens-29f22c8b-1bfb-45f2-9b5e-bdc1d9cc75b8.json rename src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/{repos_jglick_github-api-test-1.json => repos_hub4j-test-org_test-checks-bc025b21-a941-4be8-b658-6eadfdc333f5.json} (55%) rename src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/{repos_jglick_github-api-test_check-runs-2.json => repos_hub4j-test-org_test-checks_check-runs-0ee56d4a-d0d3-44e7-831b-84e299eaf47e.json} (87%) rename src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/{repos_jglick_github-api-test_check-runs_546384622-4.json => repos_hub4j-test-org_test-checks_check-runs_1424883599-b00d927c-1c6c-4f49-b568-68327ef7d436.json} (57%) rename src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/{repos_jglick_github-api-test_check-runs_546384622-3.json => repos_hub4j-test-org_test-checks_check-runs_1424883599-f3d54793-977e-48f8-857b-106af311ddea.json} (88%) create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/app-823ea390-bde8-482d-a721-16d60f724869.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/app_installations-d364cb68-5447-4396-9201-2653c44aa36c.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/repos_hub4j-test-org_test-checks-2b35bcfa-5524-4f35-985a-5d5bff188b27.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/repos_hub4j-test-org_test-checks_check-runs-a7a4c155-d928-4d41-8c9d-8a6caa5a851b.json delete mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/repos_jglick_github-api-test-1.json delete mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/repos_jglick_github-api-test_check-runs-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/app-823ea390-bde8-482d-a721-16d60f724869.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/app_installations-d364cb68-5447-4396-9201-2653c44aa36c.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/app_installations_13064215_access_tokens-da103579-7c4a-4f9b-bc1b-2946405f411b.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/repos_hub4j-test-org_test-checks-2b35bcfa-5524-4f35-985a-5d5bff188b27.json rename src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/{repos_jglick_github-api-test_check-runs-2.json => repos_hub4j-test-org_test-checks_check-runs-a7a4c155-d928-4d41-8c9d-8a6caa5a851b.json} (51%) create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/app-e7a9b97e-28ab-4ca2-95c1-b1fc01fc4975.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/app_installations-6d86aab4-68f2-4e10-9e7a-96c591fb3beb.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/repos_hub4j-test-org_test-checks-57003cf3-5da3-415a-b57a-df15cb860c7e.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/repos_hub4j-test-org_test-checks_check-runs-37c9b28c-591f-4308-ae1a-ef32349069e4.json delete mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/repos_jglick_github-api-test-1.json delete mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/repos_jglick_github-api-test_check-runs-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/app-e7a9b97e-28ab-4ca2-95c1-b1fc01fc4975.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/app_installations-6d86aab4-68f2-4e10-9e7a-96c591fb3beb.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/app_installations_13064215_access_tokens-4bf80b1a-14a2-4466-bfb2-8062c54be1c7.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/repos_hub4j-test-org_test-checks-57003cf3-5da3-415a-b57a-df15cb860c7e.json rename src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/{repos_jglick_github-api-test_check-runs-2.json => repos_hub4j-test-org_test-checks_check-runs-37c9b28c-591f-4308-ae1a-ef32349069e4.json} (50%) delete mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/repos_jglick_github-api-test-1.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/__files/app-3c70ad51-1ec8-4f9a-bcb8-7bfb910eddde.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/__files/app_installations-884f6b51-8fe7-4ad0-ad66-153065217ac9.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/__files/repos_hub4j-test-org_test-checks-332ba146-527b-45e5-bf22-a9e3215f2bb3.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/__files/repos_hub4j-test-org_test-checks_check-runs-e6a1efc0-842a-4acb-bb97-41992174417f.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/__files/repos_hub4j-test-org_test-checks_check-runs_1424883037-0e994765-90de-46eb-897a-27ab3d509c28.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/app-3c70ad51-1ec8-4f9a-bcb8-7bfb910eddde.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/app_installations-884f6b51-8fe7-4ad0-ad66-153065217ac9.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/app_installations_13064215_access_tokens-f8aa5155-92d9-45b2-ab6b-0da7da04aa90.json rename src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/{createCheckRunNoAnnotations/mappings/repos_jglick_github-api-test-1.json => updateCheckRun/mappings/repos_hub4j-test-org_test-checks-332ba146-527b-45e5-bf22-a9e3215f2bb3.json} (55%) create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/repos_hub4j-test-org_test-checks_check-runs-e6a1efc0-842a-4acb-bb97-41992174417f.json create mode 100644 src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/repos_hub4j-test-org_test-checks_check-runs_1424883037-0e994765-90de-46eb-897a-27ab3d509c28.json diff --git a/src/test/java/org/kohsuke/github/AbstractGHAppInstallationTest.java b/src/test/java/org/kohsuke/github/AbstractGHAppInstallationTest.java new file mode 100644 index 0000000000..b25d13bc55 --- /dev/null +++ b/src/test/java/org/kohsuke/github/AbstractGHAppInstallationTest.java @@ -0,0 +1,77 @@ +package org.kohsuke.github; + +import io.jsonwebtoken.Jwts; +import org.apache.commons.io.IOUtils; + +import java.io.IOException; +import java.security.KeyFactory; +import java.security.PrivateKey; +import java.security.spec.PKCS8EncodedKeySpec; +import java.time.Instant; +import java.time.temporal.ChronoUnit; +import java.util.Base64; +import java.util.Date; + +public class AbstractGHAppInstallationTest extends AbstractGitHubWireMockTest { + + private static String TEST_APP_ID_1 = "82994"; + private static String TEST_APP_ID_2 = "83009"; + private static String TEST_APP_ID_3 = "89368"; + private static String PRIVATE_KEY_FILE_APP_1 = "/ghapi-test-app-1.private-key.pem"; + private static String PRIVATE_KEY_FILE_APP_2 = "/ghapi-test-app-2.private-key.pem"; + private static String PRIVATE_KEY_FILE_APP_3 = "/ghapi-test-app-3.private-key.pem"; + + private String createJwtToken(String keyFileResouceName, String appId) { + try { + String keyPEM = IOUtils.toString(this.getClass().getResource(keyFileResouceName), "US-ASCII") + .replaceAll("(?m)^--.*", "") // remove comments from PEM to allow decoding + .replaceAll("\\s", ""); + + PKCS8EncodedKeySpec keySpecPKCS8 = new PKCS8EncodedKeySpec(Base64.getDecoder().decode(keyPEM)); + PrivateKey privateKey = KeyFactory.getInstance("RSA").generatePrivate(keySpecPKCS8); + + return Jwts.builder() + .setIssuedAt(Date.from(Instant.now())) + .setExpiration(Date.from(Instant.now().plus(5, ChronoUnit.MINUTES))) + .setIssuer(appId) + .signWith(privateKey) + .compact(); + } catch (Exception e) { + throw new RuntimeException("Error creating JWT token.", e); + } + } + + private GHAppInstallation getAppInstallationWithToken(String jwtToken) throws IOException { + GitHub gitHub = getGitHubBuilder().withJwtToken(jwtToken) + .withEndpoint(mockGitHub.apiServer().baseUrl()) + .build(); + + GHAppInstallation appInstallation = gitHub.getApp() + .listInstallations() + .toList() + .stream() + .filter(it -> it.getAccount().login.equals("hub4j-test-org")) + .findFirst() + .get(); + + appInstallation + .setRoot(getGitHubBuilder().withAppInstallationToken(appInstallation.createToken().create().getToken()) + .withEndpoint(mockGitHub.apiServer().baseUrl()) + .build()); + + return appInstallation; + } + + protected GHAppInstallation getAppInstallationWithTokenApp1() throws IOException { + return getAppInstallationWithToken(createJwtToken(PRIVATE_KEY_FILE_APP_1, TEST_APP_ID_1)); + } + + protected GHAppInstallation getAppInstallationWithTokenApp2() throws IOException { + return getAppInstallationWithToken(createJwtToken(PRIVATE_KEY_FILE_APP_2, TEST_APP_ID_2)); + } + + protected GHAppInstallation getAppInstallationWithTokenApp3() throws IOException { + return getAppInstallationWithToken(createJwtToken(PRIVATE_KEY_FILE_APP_3, TEST_APP_ID_3)); + } + +} diff --git a/src/test/java/org/kohsuke/github/GHAppInstallationTest.java b/src/test/java/org/kohsuke/github/GHAppInstallationTest.java index e5711fb24b..b3ff76d8d7 100644 --- a/src/test/java/org/kohsuke/github/GHAppInstallationTest.java +++ b/src/test/java/org/kohsuke/github/GHAppInstallationTest.java @@ -1,72 +1,11 @@ package org.kohsuke.github; -import io.jsonwebtoken.Jwts; -import org.apache.commons.io.IOUtils; import org.junit.Test; import java.io.IOException; -import java.security.KeyFactory; -import java.security.PrivateKey; -import java.security.spec.PKCS8EncodedKeySpec; -import java.time.Instant; -import java.time.temporal.ChronoUnit; -import java.util.*; +import java.util.List; -public class GHAppInstallationTest extends AbstractGitHubWireMockTest { - - private static String TEST_APP_ID_1 = "82994"; - private static String TEST_APP_ID_2 = "83009"; - private static String PRIVATE_KEY_FILE_APP_1 = "/ghapi-test-app-1.private-key.pem"; - private static String PRIVATE_KEY_FILE_APP_2 = "/ghapi-test-app-2.private-key.pem"; - - private String createJwtToken(String keyFileResouceName, String appId) { - try { - String keyPEM = IOUtils.toString(this.getClass().getResource(keyFileResouceName), "US-ASCII") - .replaceAll("(?m)^--.*", "") // remove comments from PEM to allow decoding - .replaceAll("\\s", ""); - - PKCS8EncodedKeySpec keySpecPKCS8 = new PKCS8EncodedKeySpec(Base64.getDecoder().decode(keyPEM)); - PrivateKey privateKey = KeyFactory.getInstance("RSA").generatePrivate(keySpecPKCS8); - - return Jwts.builder() - .setIssuedAt(Date.from(Instant.now())) - .setExpiration(Date.from(Instant.now().plus(5, ChronoUnit.MINUTES))) - .setIssuer(appId) - .signWith(privateKey) - .compact(); - } catch (Exception e) { - throw new RuntimeException("Error creating JWT token.", e); - } - } - - private GHAppInstallation getAppInstallationWithToken(String jwtToken) throws IOException { - GitHub gitHub = getGitHubBuilder().withJwtToken(jwtToken) - .withEndpoint(mockGitHub.apiServer().baseUrl()) - .build(); - - GHAppInstallation appInstallation = gitHub.getApp() - .listInstallations() - .toList() - .stream() - .filter(it -> it.getAccount().login.equals("hub4j-test-org")) - .findFirst() - .get(); - - appInstallation - .setRoot(getGitHubBuilder().withAppInstallationToken(appInstallation.createToken().create().getToken()) - .withEndpoint(mockGitHub.apiServer().baseUrl()) - .build()); - - return appInstallation; - } - - private GHAppInstallation getAppInstallationWithTokenApp1() throws IOException { - return getAppInstallationWithToken(createJwtToken(PRIVATE_KEY_FILE_APP_1, TEST_APP_ID_1)); - } - - private GHAppInstallation getAppInstallationWithTokenApp2() throws IOException { - return getAppInstallationWithToken(createJwtToken(PRIVATE_KEY_FILE_APP_2, TEST_APP_ID_2)); - } +public class GHAppInstallationTest extends AbstractGHAppInstallationTest { @Test public void testListRepositoriesTwoRepos() throws IOException { diff --git a/src/test/java/org/kohsuke/github/GHCheckRunBuilderTest.java b/src/test/java/org/kohsuke/github/GHCheckRunBuilderTest.java index c4ccc1ca37..6cfae77969 100644 --- a/src/test/java/org/kohsuke/github/GHCheckRunBuilderTest.java +++ b/src/test/java/org/kohsuke/github/GHCheckRunBuilderTest.java @@ -26,17 +26,22 @@ import org.junit.Test; +import java.io.IOException; import java.util.Date; import static org.hamcrest.Matchers.containsString; @SuppressWarnings("deprecation") // preview -public class GHCheckRunBuilderTest extends AbstractGitHubWireMockTest { +public class GHCheckRunBuilderTest extends AbstractGHAppInstallationTest { + + protected GitHub getInstallationGithub() throws IOException { + return getAppInstallationWithTokenApp3().getRoot(); + } @Test public void createCheckRun() throws Exception { - GHCheckRun checkRun = gitHub.getRepository("jglick/github-api-test") - .createCheckRun("foo", "4a929d464a2fae7ee899ce603250f7dab304bc4b") + GHCheckRun checkRun = getInstallationGithub().getRepository("hub4j-test-org/test-checks") + .createCheckRun("foo", "89a9ae301e35e667756034fdc933b1fc94f63fc1") .withStatus(GHCheckRun.Status.COMPLETED) .withConclusion(GHCheckRun.Conclusion.SUCCESS) .withDetailsURL("http://nowhere.net/stuff") @@ -55,7 +60,7 @@ public void createCheckRun() throws Exception { .create(); assertEquals("completed", checkRun.getStatus()); assertEquals(1, checkRun.getOutput().getAnnotationsCount()); - assertEquals(546384586, checkRun.getId()); + assertEquals(1424883286, checkRun.getId()); } @Test @@ -65,8 +70,8 @@ public void createCheckRunManyAnnotations() throws Exception { output.add( new GHCheckRunBuilder.Annotation("stuff.txt", 1, GHCheckRun.AnnotationLevel.NOTICE, "hello #" + i)); } - GHCheckRun checkRun = gitHub.getRepository("jglick/github-api-test") - .createCheckRun("big", "4a929d464a2fae7ee899ce603250f7dab304bc4b") + GHCheckRun checkRun = getInstallationGithub().getRepository("hub4j-test-org/test-checks") + .createCheckRun("big", "89a9ae301e35e667756034fdc933b1fc94f63fc1") .withConclusion(GHCheckRun.Conclusion.SUCCESS) .add(output) .create(); @@ -74,37 +79,37 @@ public void createCheckRunManyAnnotations() throws Exception { assertEquals("Big Run", checkRun.getOutput().getTitle()); assertEquals("Lots of stuff here »", checkRun.getOutput().getSummary()); assertEquals(101, checkRun.getOutput().getAnnotationsCount()); - assertEquals(546384622, checkRun.getId()); + assertEquals(1424883599, checkRun.getId()); } @Test public void createCheckRunNoAnnotations() throws Exception { - GHCheckRun checkRun = gitHub.getRepository("jglick/github-api-test") - .createCheckRun("quick", "4a929d464a2fae7ee899ce603250f7dab304bc4b") + GHCheckRun checkRun = getInstallationGithub().getRepository("hub4j-test-org/test-checks") + .createCheckRun("quick", "89a9ae301e35e667756034fdc933b1fc94f63fc1") .withConclusion(GHCheckRun.Conclusion.NEUTRAL) .add(new GHCheckRunBuilder.Output("Quick note", "nothing more to see here")) .create(); assertEquals("completed", checkRun.getStatus()); assertEquals(0, checkRun.getOutput().getAnnotationsCount()); - assertEquals(546384705, checkRun.getId()); + assertEquals(1424883957, checkRun.getId()); } @Test public void createPendingCheckRun() throws Exception { - GHCheckRun checkRun = gitHub.getRepository("jglick/github-api-test") - .createCheckRun("outstanding", "4a929d464a2fae7ee899ce603250f7dab304bc4b") + GHCheckRun checkRun = getInstallationGithub().getRepository("hub4j-test-org/test-checks") + .createCheckRun("outstanding", "89a9ae301e35e667756034fdc933b1fc94f63fc1") .withStatus(GHCheckRun.Status.IN_PROGRESS) .create(); assertEquals("in_progress", checkRun.getStatus()); assertNull(checkRun.getConclusion()); - assertEquals(546469053, checkRun.getId()); + assertEquals(1424883451, checkRun.getId()); } @Test public void createCheckRunErrMissingConclusion() throws Exception { try { - gitHub.getRepository("jglick/github-api-test") - .createCheckRun("outstanding", "4a929d464a2fae7ee899ce603250f7dab304bc4b") + getInstallationGithub().getRepository("hub4j-test-org/test-checks") + .createCheckRun("outstanding", "89a9ae301e35e667756034fdc933b1fc94f63fc1") .withStatus(GHCheckRun.Status.COMPLETED) .create(); fail("should have been rejected"); @@ -116,8 +121,8 @@ public void createCheckRunErrMissingConclusion() throws Exception { @Test public void updateCheckRun() throws Exception { - GHCheckRun checkRun = gitHub.getRepository("jglick/github-api-test") - .createCheckRun("foo", "4a929d464a2fae7ee899ce603250f7dab304bc4b") + GHCheckRun checkRun = getInstallationGithub().getRepository("hub4j-test-org/test-checks") + .createCheckRun("foo", "89a9ae301e35e667756034fdc933b1fc94f63fc1") .withStatus(GHCheckRun.Status.IN_PROGRESS) .withStartedAt(new Date(999_999_000)) .add(new GHCheckRunBuilder.Output("Some Title", "what happened…") diff --git a/src/test/resources/ghapi-test-app-3.private-key.pem b/src/test/resources/ghapi-test-app-3.private-key.pem new file mode 100644 index 0000000000..cb0250232d --- /dev/null +++ b/src/test/resources/ghapi-test-app-3.private-key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC4vG2q4zLRcQGe +5Z4seo8LY2hROKkdy4LmA96TeCxwDd/bnFIIQGmWMZHVZkyruuLLArTt50/mJ4yC +ggedRiw8CmH8s6iQmZQyRu+6gKVqm5KozQ2omniGAJU6KqZTbUUpvytpmmcWcoLU +eMoLCJTScRK2rofbiSCFy1WwlyVe1b+nBNf2b9VG9bE461K47kgk1cI1/TqZ3QeI +jc/0jV+w7qdTdCqD5A2FyFZa5mU6jj83bVyC0O0AlZlEnwHN58vvN3j7uljF6Mh0 +sx+0xtRjmTncl7puUhpQBJrH/pIfjuY5MAefMaOAhXMZM3lZyh75URlO3vh1KKwQ +EJcdCi+FAgMBAAECggEARDIDBf+DJf/iikbXgjHoFlsnCjyxaXdUJhctliDZvq/Q +gKCPQ86La892t2FhUk/WIv0nz18BhsP4wcDAkNVzxOJMU936jw6yv3CiVKXi6pzt +ofS4YxJLBaS3cdaGuetvib6xhvVhss6o70h7xWDwl1L4homdS3SuldV/F4ZkXEJI +v5uyh0TFy44dSS01muJQfZHXGF7Pvqx18CY8p/NSOKTYJRghSI3GiLOD7S12GHi1 +dBVp3D9roXCFUG0zijIIntcWnQGoCr71GwQHlwg0hPz3v/lOQZBB814+j5tUKw78 +zrXAAIb9yQbsNkmY5rVm69kg+ixG0uq9JVqJmkBvrQKBgQDrmJGuQrfuzE5PoYJC +SYNOzjjTgTc3mCW6mqBTmngOUV/DEX5aLVzMxaHCIuslNjB1Ila6Hg4Am2SFFiUj +OSVZPBe/A+EGU6itxwCzTj7M4jQtVfWRsq8IjaLm0A222RhDp9D/Zc5/T6563obW +n4GT/HOM95CvoYvjdcULPOqWVwKBgQDIvDylKw3dRQm3q2IX34JjFMrJM+wzDXAv +lIsURQFI/jezos95CGS0ArgG0gNn0117ul++N1Tt44YFDOqbG9kzS9ccYukRIe+v +knVkogtXPwLoWR8amOyK2SP7P2DSkrZsE3HRRWhzNARs8RTfa5stp9eKKyrYyXAF +28RC7agngwKBgQDEKCWzd615T/Yr6wdvdZG0fZNm1oFI8o8HTVMMCOLI2QvoeJpB +Lt/DRxGleDlcpD+4ZzzafceezcLl5EhLiXsFTzleOzaSc/lPpw94Oz+iivxyes2Z +37JIZtUpZDTm9t5zBjjHTNafvZJCjyCpdekHc/wpdL6s3M6CNj43WyLexQKBgCDL +eBD39rzmsY67RjxmPLQZSoQSoo04rdJoL0yxdWNKfSkw+Tpp36H1K8GZgArvYj97 +lHbMLWjsGhIrKQ0MQLD7u/ocQr2U0MbbY6h8POQVHFF/dfBveX25ugIrOZNNetYv +WxH4h/cCUZLG1EUoHGMaH8GoCcj/J/kdDXRtxWInAoGAQbJ/6Ry5+cLGYgt6e/7Z +33wvwVjRmeZxAiE+msdKqXljGmxHKvat3l4eURh1CSqJ5tw0+J/LzXF2WrK8ncQj +d3S4tPQW7yMBxXhJuFNczowmB8QiXFQCAdFe9sMRYyRe7EHJSNYEFjPuPDEVIfwO +nqEDUjQ6neGvMei09uX1eVk= +-----END PRIVATE KEY----- diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/app-0f55dc07-d441-4193-bec3-85b37825b863.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/app-0f55dc07-d441-4193-bec3-85b37825b863.json new file mode 100644 index 0000000000..afcf6c442e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/app-0f55dc07-d441-4193-bec3-85b37825b863.json @@ -0,0 +1,37 @@ +{ + "id": 89368, + "slug": "ghapi-test-app-3", + "node_id": "MDM6QXBwODkzNjg=", + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "name": "GHApi Test app 3", + "description": "Test app for checks api testing", + "external_url": "http://localhost", + "html_url": "https://github.com/apps/ghapi-test-app-3", + "created_at": "2020-11-19T14:30:34Z", + "updated_at": "2020-11-19T14:30:34Z", + "permissions": { + "checks": "write", + "metadata": "read" + }, + "events": [], + "installations_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/app_installations-dde1b767-d20a-4af1-8643-bd7caf43d3b8.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/app_installations-dde1b767-d20a-4af1-8643-bd7caf43d3b8.json new file mode 100644 index 0000000000..f5d238e69a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/app_installations-dde1b767-d20a-4af1-8643-bd7caf43d3b8.json @@ -0,0 +1,45 @@ +[ + { + "id": 13064215, + "account": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "repository_selection": "selected", + "access_tokens_url": "https://api.github.com/app/installations/13064215/access_tokens", + "repositories_url": "https://api.github.com/installation/repositories", + "html_url": "https://github.com/organizations/hub4j-test-org/settings/installations/13064215", + "app_id": 89368, + "app_slug": "ghapi-test-app-3", + "target_id": 7544739, + "target_type": "Organization", + "permissions": { + "checks": "write", + "metadata": "read" + }, + "events": [], + "created_at": "2020-11-19T14:33:27.000Z", + "updated_at": "2020-11-19T14:33:27.000Z", + "single_file_name": null, + "has_multiple_single_files": false, + "single_file_paths": [], + "suspended_by": null, + "suspended_at": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/repos_hub4j-test-org_test-checks-73733d52-fafe-43ee-bc64-59da1776ca71.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/repos_hub4j-test-org_test-checks-73733d52-fafe-43ee-bc64-59da1776ca71.json new file mode 100644 index 0000000000..9180f8d63e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/repos_hub4j-test-org_test-checks-73733d52-fafe-43ee-bc64-59da1776ca71.json @@ -0,0 +1,121 @@ +{ + "id": 314259932, + "node_id": "MDEwOlJlcG9zaXRvcnkzMTQyNTk5MzI=", + "name": "test-checks", + "full_name": "hub4j-test-org/test-checks", + "private": true, + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/test-checks", + "description": "Repo for testing the checks API", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/test-checks", + "forks_url": "https://api.github.com/repos/hub4j-test-org/test-checks/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/test-checks/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/test-checks/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/test-checks/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/test-checks/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/test-checks/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/test-checks/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/test-checks/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/test-checks/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/test-checks/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/test-checks/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/test-checks/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/test-checks/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/test-checks/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/test-checks/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/test-checks/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/test-checks/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/test-checks/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/test-checks/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/test-checks/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/test-checks/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/test-checks/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/test-checks/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/test-checks/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/test-checks/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/test-checks/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/test-checks/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/test-checks/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/test-checks/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/test-checks/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-checks/deployments", + "created_at": "2020-11-19T13:41:45Z", + "updated_at": "2020-11-19T13:41:50Z", + "pushed_at": "2020-11-19T13:41:47Z", + "git_url": "git://github.com/hub4j-test-org/test-checks.git", + "ssh_url": "git@github.com:hub4j-test-org/test-checks.git", + "clone_url": "https://github.com/hub4j-test-org/test-checks.git", + "svn_url": "https://github.com/hub4j-test-org/test-checks", + "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": "main", + "permissions": { + "admin": false, + "push": false, + "pull": false + }, + "organization": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 0, + "subscribers_count": 8 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/repos_hub4j-test-org_test-checks_check-runs-b1eec35d-bc33-49b6-a44b-4dcf13cc0f1b.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/repos_hub4j-test-org_test-checks_check-runs-b1eec35d-bc33-49b6-a44b-4dcf13cc0f1b.json new file mode 100644 index 0000000000..6f887ae34c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/repos_hub4j-test-org_test-checks_check-runs-b1eec35d-bc33-49b6-a44b-4dcf13cc0f1b.json @@ -0,0 +1,61 @@ +{ + "id": 1424883286, + "node_id": "MDg6Q2hlY2tSdW4xNDI0ODgzMjg2", + "head_sha": "89a9ae301e35e667756034fdc933b1fc94f63fc1", + "external_id": "whatever", + "url": "https://api.github.com/repos/hub4j-test-org/test-checks/check-runs/1424883286", + "html_url": "https://github.com/hub4j-test-org/test-checks/runs/1424883286", + "details_url": "http://nowhere.net/stuff", + "status": "completed", + "conclusion": "success", + "started_at": "1970-01-12T13:46:39Z", + "completed_at": "1970-01-12T13:46:39Z", + "output": { + "title": "Some Title", + "summary": "what happened…", + "text": null, + "annotations_count": 1, + "annotations_url": "https://api.github.com/repos/hub4j-test-org/test-checks/check-runs/1424883286/annotations" + }, + "name": "foo", + "check_suite": { + "id": 1529145983 + }, + "app": { + "id": 89368, + "slug": "ghapi-test-app-3", + "node_id": "MDM6QXBwODkzNjg=", + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "name": "GHApi Test app 3", + "description": "Test app for checks api testing", + "external_url": "http://localhost", + "html_url": "https://github.com/apps/ghapi-test-app-3", + "created_at": "2020-11-19T14:30:34Z", + "updated_at": "2020-11-19T14:30:34Z", + "permissions": { + "checks": "write", + "metadata": "read" + }, + "events": [] + }, + "pull_requests": [] +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/repos_jglick_github-api-test-1.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/repos_jglick_github-api-test-1.json deleted file mode 100644 index 79eebcc369..0000000000 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/repos_jglick_github-api-test-1.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "id": 95711947, - "node_id": "MDEwOlJlcG9zaXRvcnk5NTcxMTk0Nw==", - "name": "github-api-test", - "full_name": "jglick/github-api-test", - "private": false, - "owner": { - "login": "jglick", - "id": 154109, - "node_id": "MDQ6VXNlcjE1NDEwOQ==", - "avatar_url": "https://avatars1.githubusercontent.com/u/154109?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/jglick", - "html_url": "https://github.com/jglick", - "followers_url": "https://api.github.com/users/jglick/followers", - "following_url": "https://api.github.com/users/jglick/following{/other_user}", - "gists_url": "https://api.github.com/users/jglick/gists{/gist_id}", - "starred_url": "https://api.github.com/users/jglick/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/jglick/subscriptions", - "organizations_url": "https://api.github.com/users/jglick/orgs", - "repos_url": "https://api.github.com/users/jglick/repos", - "events_url": "https://api.github.com/users/jglick/events{/privacy}", - "received_events_url": "https://api.github.com/users/jglick/received_events", - "type": "User", - "site_admin": false - }, - "html_url": "https://github.com/jglick/github-api-test", - "description": "A test repository for testingthe github-api project", - "fork": false, - "url": "https://api.github.com/repos/jglick/github-api-test", - "forks_url": "https://api.github.com/repos/jglick/github-api-test/forks", - "keys_url": "https://api.github.com/repos/jglick/github-api-test/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/jglick/github-api-test/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/jglick/github-api-test/teams", - "hooks_url": "https://api.github.com/repos/jglick/github-api-test/hooks", - "issue_events_url": "https://api.github.com/repos/jglick/github-api-test/issues/events{/number}", - "events_url": "https://api.github.com/repos/jglick/github-api-test/events", - "assignees_url": "https://api.github.com/repos/jglick/github-api-test/assignees{/user}", - "branches_url": "https://api.github.com/repos/jglick/github-api-test/branches{/branch}", - "tags_url": "https://api.github.com/repos/jglick/github-api-test/tags", - "blobs_url": "https://api.github.com/repos/jglick/github-api-test/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/jglick/github-api-test/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/jglick/github-api-test/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/jglick/github-api-test/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/jglick/github-api-test/statuses/{sha}", - "languages_url": "https://api.github.com/repos/jglick/github-api-test/languages", - "stargazers_url": "https://api.github.com/repos/jglick/github-api-test/stargazers", - "contributors_url": "https://api.github.com/repos/jglick/github-api-test/contributors", - "subscribers_url": "https://api.github.com/repos/jglick/github-api-test/subscribers", - "subscription_url": "https://api.github.com/repos/jglick/github-api-test/subscription", - "commits_url": "https://api.github.com/repos/jglick/github-api-test/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/jglick/github-api-test/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/jglick/github-api-test/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/jglick/github-api-test/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/jglick/github-api-test/contents/{+path}", - "compare_url": "https://api.github.com/repos/jglick/github-api-test/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/jglick/github-api-test/merges", - "archive_url": "https://api.github.com/repos/jglick/github-api-test/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/jglick/github-api-test/downloads", - "issues_url": "https://api.github.com/repos/jglick/github-api-test/issues{/number}", - "pulls_url": "https://api.github.com/repos/jglick/github-api-test/pulls{/number}", - "milestones_url": "https://api.github.com/repos/jglick/github-api-test/milestones{/number}", - "notifications_url": "https://api.github.com/repos/jglick/github-api-test/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/jglick/github-api-test/labels{/name}", - "releases_url": "https://api.github.com/repos/jglick/github-api-test/releases{/id}", - "deployments_url": "https://api.github.com/repos/jglick/github-api-test/deployments", - "created_at": "2017-06-28T21:10:35Z", - "updated_at": "2020-03-25T22:26:13Z", - "pushed_at": "2020-03-25T22:26:10Z", - "git_url": "git://github.com/jglick/github-api-test.git", - "ssh_url": "git@github.com:jglick/github-api-test.git", - "clone_url": "https://github.com/jglick/github-api-test.git", - "svn_url": "https://github.com/jglick/github-api-test", - "homepage": "http://github-api.kohsuke.org/", - "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": false, - "push": false, - "pull": false - }, - "temp_clone_token": "", - "network_count": 0, - "subscribers_count": 0 -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/repos_jglick_github-api-test_check-runs-2.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/repos_jglick_github-api-test_check-runs-2.json deleted file mode 100644 index 9b1bec7806..0000000000 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/__files/repos_jglick_github-api-test_check-runs-2.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "id": 546384586, - "node_id": "MDg6Q2hlY2tSdW41NDYzODQ1ODY=", - "head_sha": "4a929d464a2fae7ee899ce603250f7dab304bc4b", - "external_id": "whatever", - "url": "https://api.github.com/repos/jglick/github-api-test/check-runs/546384586", - "html_url": "https://github.com/jglick/github-api-test/runs/546384586", - "details_url": "http://nowhere.net/stuff", - "status": "completed", - "conclusion": "success", - "started_at": "1970-01-12T13:46:39Z", - "completed_at": "1970-01-12T13:46:39Z", - "output": { - "title": "Some Title", - "summary": "what happened…", - "text": null, - "annotations_count": 1, - "annotations_url": "https://api.github.com/repos/jglick/github-api-test/check-runs/546384586/annotations" - }, - "name": "foo", - "check_suite": { - "id": 547824747 - }, - "app": { - "id": 58691, - "slug": "jglick-app-test", - "node_id": "MDM6QXBwNTg2OTE=", - "owner": { - "login": "jglick", - "id": 154109, - "node_id": "MDQ6VXNlcjE1NDEwOQ==", - "avatar_url": "https://avatars1.githubusercontent.com/u/154109?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/jglick", - "html_url": "https://github.com/jglick", - "followers_url": "https://api.github.com/users/jglick/followers", - "following_url": "https://api.github.com/users/jglick/following{/other_user}", - "gists_url": "https://api.github.com/users/jglick/gists{/gist_id}", - "starred_url": "https://api.github.com/users/jglick/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/jglick/subscriptions", - "organizations_url": "https://api.github.com/users/jglick/orgs", - "repos_url": "https://api.github.com/users/jglick/repos", - "events_url": "https://api.github.com/users/jglick/events{/privacy}", - "received_events_url": "https://api.github.com/users/jglick/received_events", - "type": "User", - "site_admin": false - }, - "name": "jglick-app-test", - "description": "", - "external_url": "http://nowhere.net/", - "html_url": "https://github.com/apps/jglick-app-test", - "created_at": "2020-03-25T22:13:14Z", - "updated_at": "2020-03-25T22:13:14Z", - "permissions": { - "checks": "write", - "metadata": "read" - }, - "events": [] - }, - "pull_requests": [] -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/app-0f55dc07-d441-4193-bec3-85b37825b863.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/app-0f55dc07-d441-4193-bec3-85b37825b863.json new file mode 100644 index 0000000000..eb2998fcee --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/app-0f55dc07-d441-4193-bec3-85b37825b863.json @@ -0,0 +1,41 @@ +{ + "id": "0f55dc07-d441-4193-bec3-85b37825b863", + "name": "app", + "request": { + "url": "/app", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "app-0f55dc07-d441-4193-bec3-85b37825b863.json", + "headers": { + "Date": "Thu, 19 Nov 2020 15:00:16 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"174e4dd83df85fc873704d9b9e66883391e4ed80f0c537880e3f48f790fb4e47\"", + "X-GitHub-Media-Type": "github.v3; param=machine-man-preview; format=json", + "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": "FF99:D6FC:1918F5:1E0C64:5FB68880" + } + }, + "uuid": "0f55dc07-d441-4193-bec3-85b37825b863", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/app_installations-dde1b767-d20a-4af1-8643-bd7caf43d3b8.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/app_installations-dde1b767-d20a-4af1-8643-bd7caf43d3b8.json new file mode 100644 index 0000000000..08636f7011 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/app_installations-dde1b767-d20a-4af1-8643-bd7caf43d3b8.json @@ -0,0 +1,41 @@ +{ + "id": "dde1b767-d20a-4af1-8643-bd7caf43d3b8", + "name": "app_installations", + "request": { + "url": "/app/installations", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "app_installations-dde1b767-d20a-4af1-8643-bd7caf43d3b8.json", + "headers": { + "Date": "Thu, 19 Nov 2020 15:00:17 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"e9ffa0e78284d854058825e6267f828446fcd9f96430ce74e40eac816f7e6b19\"", + "X-GitHub-Media-Type": "github.v3; param=machine-man-preview; format=json", + "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": "FF99:D6FC:1918FD:1E0C6D:5FB68880" + } + }, + "uuid": "dde1b767-d20a-4af1-8643-bd7caf43d3b8", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/app_installations_13064215_access_tokens-cf0f4d64-2b1c-48db-9c9f-230250d40539.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/app_installations_13064215_access_tokens-cf0f4d64-2b1c-48db-9c9f-230250d40539.json new file mode 100644 index 0000000000..ee90709891 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/app_installations_13064215_access_tokens-cf0f4d64-2b1c-48db-9c9f-230250d40539.json @@ -0,0 +1,48 @@ +{ + "id": "cf0f4d64-2b1c-48db-9c9f-230250d40539", + "name": "app_installations_13064215_access_tokens", + "request": { + "url": "/app/installations/13064215/access_tokens", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "body": "{\"token\":\"v1.a10ee387298335c61d2f50272c859ffba4a59e75\",\"expires_at\":\"2020-11-19T16:00:17Z\",\"permissions\":{\"checks\":\"write\",\"metadata\":\"read\"},\"repository_selection\":\"selected\"}", + "headers": { + "Date": "Thu, 19 Nov 2020 15:00:17 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "\"604249bc3d97f7d7205febe1bc72dd33f51b44b0275e9f027bc5e48bce6b9f00\"", + "X-GitHub-Media-Type": "github.v3; param=machine-man-preview; format=json", + "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": "FF99:D6FC:191902:1E0C73:5FB68881" + } + }, + "uuid": "cf0f4d64-2b1c-48db-9c9f-230250d40539", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/repos_jglick_github-api-test-1.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/repos_hub4j-test-org_test-checks-73733d52-fafe-43ee-bc64-59da1776ca71.json similarity index 55% rename from src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/repos_jglick_github-api-test-1.json rename to src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/repos_hub4j-test-org_test-checks-73733d52-fafe-43ee-bc64-59da1776ca71.json index 7b8968f764..0f7a158fa9 100644 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/repos_jglick_github-api-test-1.json +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/repos_hub4j-test-org_test-checks-73733d52-fafe-43ee-bc64-59da1776ca71.json @@ -1,8 +1,8 @@ { - "id": "0c39468e-dcdc-4f12-bd52-2cf474eb0761", - "name": "repos_jglick_github-api-test", + "id": "73733d52-fafe-43ee-bc64-59da1776ca71", + "name": "repos_hub4j-test-org_test-checks", "request": { - "url": "/repos/jglick/github-api-test", + "url": "/repos/hub4j-test-org/test-checks", "method": "GET", "headers": { "Accept": { @@ -12,33 +12,35 @@ }, "response": { "status": 200, - "bodyFileName": "repos_jglick_github-api-test-1.json", + "bodyFileName": "repos_hub4j-test-org_test-checks-73733d52-fafe-43ee-bc64-59da1776ca71.json", "headers": { - "Server": "GitHub.com", - "Date": "Mon, 30 Mar 2020 18:23:29 GMT", + "Date": "Thu, 19 Nov 2020 15:00:17 GMT", "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", "Status": "200 OK", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4999", - "X-RateLimit-Reset": "1585596209", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding, Accept, X-Requested-With" + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" ], - "ETag": "W/\"c31ebce1d9b6ef50784ae33967251c4f\"", - "Last-Modified": "Wed, 25 Mar 2020 22:26:13 GMT", + "ETag": "W/\"b4c9573786355c0c81642ca05fb55c09bdeeebf7503b0ce193fa1c2d22469e8f\"", + "Last-Modified": "Thu, 19 Nov 2020 13:41:50 GMT", "X-GitHub-Media-Type": "unknown, github.v3", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4843", + "X-RateLimit-Reset": "1605800044", + "X-RateLimit-Used": "157", "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": "8558:2D60:F5B004:2327138:5E823921" + "X-GitHub-Request-Id": "FF99:D6FC:191908:1E0C78:5FB68881" } }, - "uuid": "0c39468e-dcdc-4f12-bd52-2cf474eb0761", + "uuid": "73733d52-fafe-43ee-bc64-59da1776ca71", "persistent": true, - "insertionIndex": 1 + "insertionIndex": 4 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/repos_jglick_github-api-test_check-runs-2.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/repos_hub4j-test-org_test-checks_check-runs-b1eec35d-bc33-49b6-a44b-4dcf13cc0f1b.json similarity index 61% rename from src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/repos_jglick_github-api-test_check-runs-2.json rename to src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/repos_hub4j-test-org_test-checks_check-runs-b1eec35d-bc33-49b6-a44b-4dcf13cc0f1b.json index 4e70ef6131..13b782a612 100644 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/repos_jglick_github-api-test_check-runs-2.json +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRun/mappings/repos_hub4j-test-org_test-checks_check-runs-b1eec35d-bc33-49b6-a44b-4dcf13cc0f1b.json @@ -1,8 +1,8 @@ { - "id": "3833d102-56d4-455f-9739-94238ae75575", - "name": "repos_jglick_github-api-test_check-runs", + "id": "b1eec35d-bc33-49b6-a44b-4dcf13cc0f1b", + "name": "repos_hub4j-test-org_test-checks_check-runs", "request": { - "url": "/repos/jglick/github-api-test/check-runs", + "url": "/repos/hub4j-test-org/test-checks/check-runs", "method": "POST", "headers": { "Accept": { @@ -11,41 +11,43 @@ }, "bodyPatterns": [ { - "equalToJson": "{\"conclusion\":\"success\",\"output\":{\"title\":\"Some Title\",\"summary\":\"what happened…\",\"annotations\":[{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello to you too\",\"title\":\"Look here\"}],\"images\":[{\"alt\":\"Unikitty\",\"image_url\":\"https://i.pinimg.com/474x/9e/65/c0/9e65c0972294f1e10f648c9780a79fab.jpg\",\"caption\":\"Princess Unikitty\"}]},\"completed_at\":\"1970-01-12T13:46:39Z\",\"name\":\"foo\",\"started_at\":\"1970-01-12T13:46:39Z\",\"external_id\":\"whatever\",\"details_url\":\"http://nowhere.net/stuff\",\"actions\":[{\"label\":\"Help\",\"description\":\"what I need help with\",\"identifier\":\"doit\"}],\"head_sha\":\"4a929d464a2fae7ee899ce603250f7dab304bc4b\",\"status\":\"completed\"}", + "equalToJson": "{\"conclusion\":\"success\",\"output\":{\"title\":\"Some Title\",\"summary\":\"what happened…\",\"annotations\":[{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello to you too\",\"title\":\"Look here\"}],\"images\":[{\"alt\":\"Unikitty\",\"image_url\":\"https://i.pinimg.com/474x/9e/65/c0/9e65c0972294f1e10f648c9780a79fab.jpg\",\"caption\":\"Princess Unikitty\"}]},\"completed_at\":\"1970-01-12T13:46:39Z\",\"name\":\"foo\",\"started_at\":\"1970-01-12T13:46:39Z\",\"external_id\":\"whatever\",\"details_url\":\"http://nowhere.net/stuff\",\"actions\":[{\"label\":\"Help\",\"description\":\"what I need help with\",\"identifier\":\"doit\"}],\"head_sha\":\"89a9ae301e35e667756034fdc933b1fc94f63fc1\",\"status\":\"completed\"}", "ignoreArrayOrder": true, - "ignoreExtraElements": true + "ignoreExtraElements": false } ] }, "response": { "status": 201, - "bodyFileName": "repos_jglick_github-api-test_check-runs-2.json", + "bodyFileName": "repos_hub4j-test-org_test-checks_check-runs-b1eec35d-bc33-49b6-a44b-4dcf13cc0f1b.json", "headers": { - "Server": "GitHub.com", - "Date": "Mon, 30 Mar 2020 18:23:30 GMT", + "Date": "Thu, 19 Nov 2020 15:00:18 GMT", "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", "Status": "201 Created", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4998", - "X-RateLimit-Reset": "1585596209", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding, Accept, X-Requested-With" + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" ], - "ETag": "\"9b01fc978a7d5144b29fd153f0ed07e4\"", - "Location": "https://api.github.com/repos/jglick/github-api-test/check-runs/546384586", - "X-GitHub-Media-Type": "github.antiope-preview; format=json", + "ETag": "\"881eff325ad3c93b47e4bc404290c9c24492d9d4ce976bd5c2c09530821a9a76\"", + "Location": "https://api.github.com/repos/hub4j-test-org/test-checks/check-runs/1424883286", + "X-GitHub-Media-Type": "github.v3; param=antiope-preview; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4842", + "X-RateLimit-Reset": "1605800044", + "X-RateLimit-Used": "158", "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": "8558:2D60:F5B01C:2327144:5E823921" + "X-GitHub-Request-Id": "FF99:D6FC:191914:1E0C87:5FB68881" } }, - "uuid": "3833d102-56d4-455f-9739-94238ae75575", + "uuid": "b1eec35d-bc33-49b6-a44b-4dcf13cc0f1b", "persistent": true, - "insertionIndex": 2 + "insertionIndex": 5 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/__files/app-26970c50-1a80-457f-8353-67086d9e73f9.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/__files/app-26970c50-1a80-457f-8353-67086d9e73f9.json new file mode 100644 index 0000000000..afcf6c442e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/__files/app-26970c50-1a80-457f-8353-67086d9e73f9.json @@ -0,0 +1,37 @@ +{ + "id": 89368, + "slug": "ghapi-test-app-3", + "node_id": "MDM6QXBwODkzNjg=", + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "name": "GHApi Test app 3", + "description": "Test app for checks api testing", + "external_url": "http://localhost", + "html_url": "https://github.com/apps/ghapi-test-app-3", + "created_at": "2020-11-19T14:30:34Z", + "updated_at": "2020-11-19T14:30:34Z", + "permissions": { + "checks": "write", + "metadata": "read" + }, + "events": [], + "installations_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/__files/app_installations-7f4e32ec-102a-4f04-802f-9b07e8fe11cf.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/__files/app_installations-7f4e32ec-102a-4f04-802f-9b07e8fe11cf.json new file mode 100644 index 0000000000..f5d238e69a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/__files/app_installations-7f4e32ec-102a-4f04-802f-9b07e8fe11cf.json @@ -0,0 +1,45 @@ +[ + { + "id": 13064215, + "account": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "repository_selection": "selected", + "access_tokens_url": "https://api.github.com/app/installations/13064215/access_tokens", + "repositories_url": "https://api.github.com/installation/repositories", + "html_url": "https://github.com/organizations/hub4j-test-org/settings/installations/13064215", + "app_id": 89368, + "app_slug": "ghapi-test-app-3", + "target_id": 7544739, + "target_type": "Organization", + "permissions": { + "checks": "write", + "metadata": "read" + }, + "events": [], + "created_at": "2020-11-19T14:33:27.000Z", + "updated_at": "2020-11-19T14:33:27.000Z", + "single_file_name": null, + "has_multiple_single_files": false, + "single_file_paths": [], + "suspended_by": null, + "suspended_at": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/__files/repos_hub4j-test-org_test-checks-36f22d0c-fb63-4062-97f1-5bf0f49ba76f.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/__files/repos_hub4j-test-org_test-checks-36f22d0c-fb63-4062-97f1-5bf0f49ba76f.json new file mode 100644 index 0000000000..9180f8d63e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/__files/repos_hub4j-test-org_test-checks-36f22d0c-fb63-4062-97f1-5bf0f49ba76f.json @@ -0,0 +1,121 @@ +{ + "id": 314259932, + "node_id": "MDEwOlJlcG9zaXRvcnkzMTQyNTk5MzI=", + "name": "test-checks", + "full_name": "hub4j-test-org/test-checks", + "private": true, + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/test-checks", + "description": "Repo for testing the checks API", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/test-checks", + "forks_url": "https://api.github.com/repos/hub4j-test-org/test-checks/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/test-checks/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/test-checks/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/test-checks/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/test-checks/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/test-checks/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/test-checks/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/test-checks/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/test-checks/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/test-checks/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/test-checks/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/test-checks/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/test-checks/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/test-checks/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/test-checks/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/test-checks/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/test-checks/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/test-checks/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/test-checks/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/test-checks/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/test-checks/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/test-checks/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/test-checks/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/test-checks/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/test-checks/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/test-checks/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/test-checks/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/test-checks/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/test-checks/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/test-checks/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-checks/deployments", + "created_at": "2020-11-19T13:41:45Z", + "updated_at": "2020-11-19T13:41:50Z", + "pushed_at": "2020-11-19T13:41:47Z", + "git_url": "git://github.com/hub4j-test-org/test-checks.git", + "ssh_url": "git@github.com:hub4j-test-org/test-checks.git", + "clone_url": "https://github.com/hub4j-test-org/test-checks.git", + "svn_url": "https://github.com/hub4j-test-org/test-checks", + "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": "main", + "permissions": { + "admin": false, + "push": false, + "pull": false + }, + "organization": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 0, + "subscribers_count": 8 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/__files/repos_jglick_github-api-test-1.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/__files/repos_jglick_github-api-test-1.json deleted file mode 100644 index 79eebcc369..0000000000 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/__files/repos_jglick_github-api-test-1.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "id": 95711947, - "node_id": "MDEwOlJlcG9zaXRvcnk5NTcxMTk0Nw==", - "name": "github-api-test", - "full_name": "jglick/github-api-test", - "private": false, - "owner": { - "login": "jglick", - "id": 154109, - "node_id": "MDQ6VXNlcjE1NDEwOQ==", - "avatar_url": "https://avatars1.githubusercontent.com/u/154109?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/jglick", - "html_url": "https://github.com/jglick", - "followers_url": "https://api.github.com/users/jglick/followers", - "following_url": "https://api.github.com/users/jglick/following{/other_user}", - "gists_url": "https://api.github.com/users/jglick/gists{/gist_id}", - "starred_url": "https://api.github.com/users/jglick/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/jglick/subscriptions", - "organizations_url": "https://api.github.com/users/jglick/orgs", - "repos_url": "https://api.github.com/users/jglick/repos", - "events_url": "https://api.github.com/users/jglick/events{/privacy}", - "received_events_url": "https://api.github.com/users/jglick/received_events", - "type": "User", - "site_admin": false - }, - "html_url": "https://github.com/jglick/github-api-test", - "description": "A test repository for testingthe github-api project", - "fork": false, - "url": "https://api.github.com/repos/jglick/github-api-test", - "forks_url": "https://api.github.com/repos/jglick/github-api-test/forks", - "keys_url": "https://api.github.com/repos/jglick/github-api-test/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/jglick/github-api-test/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/jglick/github-api-test/teams", - "hooks_url": "https://api.github.com/repos/jglick/github-api-test/hooks", - "issue_events_url": "https://api.github.com/repos/jglick/github-api-test/issues/events{/number}", - "events_url": "https://api.github.com/repos/jglick/github-api-test/events", - "assignees_url": "https://api.github.com/repos/jglick/github-api-test/assignees{/user}", - "branches_url": "https://api.github.com/repos/jglick/github-api-test/branches{/branch}", - "tags_url": "https://api.github.com/repos/jglick/github-api-test/tags", - "blobs_url": "https://api.github.com/repos/jglick/github-api-test/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/jglick/github-api-test/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/jglick/github-api-test/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/jglick/github-api-test/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/jglick/github-api-test/statuses/{sha}", - "languages_url": "https://api.github.com/repos/jglick/github-api-test/languages", - "stargazers_url": "https://api.github.com/repos/jglick/github-api-test/stargazers", - "contributors_url": "https://api.github.com/repos/jglick/github-api-test/contributors", - "subscribers_url": "https://api.github.com/repos/jglick/github-api-test/subscribers", - "subscription_url": "https://api.github.com/repos/jglick/github-api-test/subscription", - "commits_url": "https://api.github.com/repos/jglick/github-api-test/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/jglick/github-api-test/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/jglick/github-api-test/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/jglick/github-api-test/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/jglick/github-api-test/contents/{+path}", - "compare_url": "https://api.github.com/repos/jglick/github-api-test/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/jglick/github-api-test/merges", - "archive_url": "https://api.github.com/repos/jglick/github-api-test/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/jglick/github-api-test/downloads", - "issues_url": "https://api.github.com/repos/jglick/github-api-test/issues{/number}", - "pulls_url": "https://api.github.com/repos/jglick/github-api-test/pulls{/number}", - "milestones_url": "https://api.github.com/repos/jglick/github-api-test/milestones{/number}", - "notifications_url": "https://api.github.com/repos/jglick/github-api-test/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/jglick/github-api-test/labels{/name}", - "releases_url": "https://api.github.com/repos/jglick/github-api-test/releases{/id}", - "deployments_url": "https://api.github.com/repos/jglick/github-api-test/deployments", - "created_at": "2017-06-28T21:10:35Z", - "updated_at": "2020-03-25T22:26:13Z", - "pushed_at": "2020-03-25T22:26:10Z", - "git_url": "git://github.com/jglick/github-api-test.git", - "ssh_url": "git@github.com:jglick/github-api-test.git", - "clone_url": "https://github.com/jglick/github-api-test.git", - "svn_url": "https://github.com/jglick/github-api-test", - "homepage": "http://github-api.kohsuke.org/", - "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": false, - "push": false, - "pull": false - }, - "temp_clone_token": "", - "network_count": 0, - "subscribers_count": 0 -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/app-26970c50-1a80-457f-8353-67086d9e73f9.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/app-26970c50-1a80-457f-8353-67086d9e73f9.json new file mode 100644 index 0000000000..e4b195c83d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/app-26970c50-1a80-457f-8353-67086d9e73f9.json @@ -0,0 +1,41 @@ +{ + "id": "26970c50-1a80-457f-8353-67086d9e73f9", + "name": "app", + "request": { + "url": "/app", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "app-26970c50-1a80-457f-8353-67086d9e73f9.json", + "headers": { + "Date": "Thu, 19 Nov 2020 15:00:24 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"174e4dd83df85fc873704d9b9e66883391e4ed80f0c537880e3f48f790fb4e47\"", + "X-GitHub-Media-Type": "github.v3; param=machine-man-preview; format=json", + "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": "FFDE:DF5C:3DF60:4CFD1:5FB68888" + } + }, + "uuid": "26970c50-1a80-457f-8353-67086d9e73f9", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/app_installations-7f4e32ec-102a-4f04-802f-9b07e8fe11cf.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/app_installations-7f4e32ec-102a-4f04-802f-9b07e8fe11cf.json new file mode 100644 index 0000000000..5a27809a57 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/app_installations-7f4e32ec-102a-4f04-802f-9b07e8fe11cf.json @@ -0,0 +1,41 @@ +{ + "id": "7f4e32ec-102a-4f04-802f-9b07e8fe11cf", + "name": "app_installations", + "request": { + "url": "/app/installations", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "app_installations-7f4e32ec-102a-4f04-802f-9b07e8fe11cf.json", + "headers": { + "Date": "Thu, 19 Nov 2020 15:00:24 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"e9ffa0e78284d854058825e6267f828446fcd9f96430ce74e40eac816f7e6b19\"", + "X-GitHub-Media-Type": "github.v3; param=machine-man-preview; format=json", + "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": "FFDE:DF5C:3DF62:4CFD3:5FB68888" + } + }, + "uuid": "7f4e32ec-102a-4f04-802f-9b07e8fe11cf", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/app_installations_13064215_access_tokens-b3e00f78-6280-4c12-b30c-4058f4c7d001.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/app_installations_13064215_access_tokens-b3e00f78-6280-4c12-b30c-4058f4c7d001.json new file mode 100644 index 0000000000..80cbcd68b5 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/app_installations_13064215_access_tokens-b3e00f78-6280-4c12-b30c-4058f4c7d001.json @@ -0,0 +1,48 @@ +{ + "id": "b3e00f78-6280-4c12-b30c-4058f4c7d001", + "name": "app_installations_13064215_access_tokens", + "request": { + "url": "/app/installations/13064215/access_tokens", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "body": "{\"token\":\"v1.b21b25f4c856f3f05a887f2831e06303f10f910b\",\"expires_at\":\"2020-11-19T16:00:24Z\",\"permissions\":{\"checks\":\"write\",\"metadata\":\"read\"},\"repository_selection\":\"selected\"}", + "headers": { + "Date": "Thu, 19 Nov 2020 15:00:25 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "\"80bdd776da69c099807d7fb43e2903929a1b28d760fa24d17e59bf5c14c44621\"", + "X-GitHub-Media-Type": "github.v3; param=machine-man-preview; format=json", + "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": "FFDE:DF5C:3DF64:4CFD6:5FB68888" + } + }, + "uuid": "b3e00f78-6280-4c12-b30c-4058f4c7d001", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/repos_jglick_github-api-test-1.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/repos_hub4j-test-org_test-checks-36f22d0c-fb63-4062-97f1-5bf0f49ba76f.json similarity index 55% rename from src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/repos_jglick_github-api-test-1.json rename to src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/repos_hub4j-test-org_test-checks-36f22d0c-fb63-4062-97f1-5bf0f49ba76f.json index 549763b0f7..d439ad8936 100644 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/repos_jglick_github-api-test-1.json +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/repos_hub4j-test-org_test-checks-36f22d0c-fb63-4062-97f1-5bf0f49ba76f.json @@ -1,8 +1,8 @@ { - "id": "e95bdd52-5649-401e-a978-4ca6b8adf191", - "name": "repos_jglick_github-api-test", + "id": "36f22d0c-fb63-4062-97f1-5bf0f49ba76f", + "name": "repos_hub4j-test-org_test-checks", "request": { - "url": "/repos/jglick/github-api-test", + "url": "/repos/hub4j-test-org/test-checks", "method": "GET", "headers": { "Accept": { @@ -12,33 +12,35 @@ }, "response": { "status": 200, - "bodyFileName": "repos_jglick_github-api-test-1.json", + "bodyFileName": "repos_hub4j-test-org_test-checks-36f22d0c-fb63-4062-97f1-5bf0f49ba76f.json", "headers": { - "Server": "GitHub.com", - "Date": "Mon, 30 Mar 2020 19:00:33 GMT", + "Date": "Thu, 19 Nov 2020 15:00:25 GMT", "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", "Status": "200 OK", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4989", - "X-RateLimit-Reset": "1585596209", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding, Accept, X-Requested-With" + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" ], - "ETag": "W/\"c31ebce1d9b6ef50784ae33967251c4f\"", - "Last-Modified": "Wed, 25 Mar 2020 22:26:13 GMT", + "ETag": "W/\"c1942092155c69fbb485fc745e107a2e5dd213d1a6283436465b335901a7de99\"", + "Last-Modified": "Thu, 19 Nov 2020 13:41:50 GMT", "X-GitHub-Media-Type": "unknown, github.v3", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4833", + "X-RateLimit-Reset": "1605800044", + "X-RateLimit-Used": "167", "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": "BE04:665C:6EB6E0:11A912E:5E8241D1" + "X-GitHub-Request-Id": "FFDE:DF5C:3DF67:4CFD8:5FB68889" } }, - "uuid": "e95bdd52-5649-401e-a978-4ca6b8adf191", + "uuid": "36f22d0c-fb63-4062-97f1-5bf0f49ba76f", "persistent": true, - "insertionIndex": 1 + "insertionIndex": 4 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/repos_jglick_github-api-test_check-runs-2.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/repos_hub4j-test-org_test-checks_check-runs-a9b45df4-a52a-4ad4-916e-e199f8b0a56e.json similarity index 61% rename from src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/repos_jglick_github-api-test_check-runs-2.json rename to src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/repos_hub4j-test-org_test-checks_check-runs-a9b45df4-a52a-4ad4-916e-e199f8b0a56e.json index d390a69def..c33a5c7d90 100644 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/repos_jglick_github-api-test_check-runs-2.json +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunErrMissingConclusion/mappings/repos_hub4j-test-org_test-checks_check-runs-a9b45df4-a52a-4ad4-916e-e199f8b0a56e.json @@ -1,8 +1,8 @@ { - "id": "28f2e856-c999-4429-a7b7-e67d8ec0ea96", - "name": "repos_jglick_github-api-test_check-runs", + "id": "a9b45df4-a52a-4ad4-916e-e199f8b0a56e", + "name": "repos_hub4j-test-org_test-checks_check-runs", "request": { - "url": "/repos/jglick/github-api-test/check-runs", + "url": "/repos/hub4j-test-org/test-checks/check-runs", "method": "POST", "headers": { "Accept": { @@ -11,24 +11,25 @@ }, "bodyPatterns": [ { - "equalToJson": "{\"name\":\"outstanding\",\"head_sha\":\"4a929d464a2fae7ee899ce603250f7dab304bc4b\",\"status\":\"completed\"}", + "equalToJson": "{\"name\":\"outstanding\",\"head_sha\":\"89a9ae301e35e667756034fdc933b1fc94f63fc1\",\"status\":\"completed\"}", "ignoreArrayOrder": true, - "ignoreExtraElements": true + "ignoreExtraElements": false } ] }, "response": { "status": 422, - "body": "{\"message\":\"Invalid request.\\n\\nNo subschema in \\\"anyOf\\\" matched.\\n\\\"conclusion\\\" wasn't supplied.\\ncompleted is not a member of [\\\"queued\\\", \\\"in_progress\\\"].\",\"documentation_url\":\"https://developer.github.com/v3/checks/runs/#create-a-check-run\"}", + "body": "{\"message\":\"Invalid request.\\n\\nNo subschema in \\\"anyOf\\\" matched.\\n\\\"conclusion\\\" wasn't supplied.\\ncompleted is not a member of [\\\"queued\\\", \\\"in_progress\\\"].\",\"documentation_url\":\"https://docs.github.com/rest/reference/checks#create-a-check-run\"}", "headers": { - "Server": "GitHub.com", - "Date": "Mon, 30 Mar 2020 19:00:33 GMT", + "Date": "Thu, 19 Nov 2020 15:00:25 GMT", "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", "Status": "422 Unprocessable Entity", + "X-GitHub-Media-Type": "github.v3; param=antiope-preview; format=json", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4988", - "X-RateLimit-Reset": "1585596209", - "X-GitHub-Media-Type": "github.antiope-preview; format=json", + "X-RateLimit-Remaining": "4832", + "X-RateLimit-Reset": "1605800044", + "X-RateLimit-Used": "168", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", "X-Frame-Options": "deny", "X-Content-Type-Options": "nosniff", @@ -36,10 +37,10 @@ "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", "Vary": "Accept-Encoding, Accept, X-Requested-With", - "X-GitHub-Request-Id": "BE04:665C:6EB6F3:11A9144:5E8241D1" + "X-GitHub-Request-Id": "FFDE:DF5C:3DF6B:4CFDC:5FB68889" } }, - "uuid": "28f2e856-c999-4429-a7b7-e67d8ec0ea96", + "uuid": "a9b45df4-a52a-4ad4-916e-e199f8b0a56e", "persistent": true, - "insertionIndex": 2 + "insertionIndex": 5 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/app-d5ac21ed-d95f-497e-9391-599401628a54.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/app-d5ac21ed-d95f-497e-9391-599401628a54.json new file mode 100644 index 0000000000..afcf6c442e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/app-d5ac21ed-d95f-497e-9391-599401628a54.json @@ -0,0 +1,37 @@ +{ + "id": 89368, + "slug": "ghapi-test-app-3", + "node_id": "MDM6QXBwODkzNjg=", + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "name": "GHApi Test app 3", + "description": "Test app for checks api testing", + "external_url": "http://localhost", + "html_url": "https://github.com/apps/ghapi-test-app-3", + "created_at": "2020-11-19T14:30:34Z", + "updated_at": "2020-11-19T14:30:34Z", + "permissions": { + "checks": "write", + "metadata": "read" + }, + "events": [], + "installations_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/app_installations-279b34ba-b004-436c-a881-18ac3bb9af92.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/app_installations-279b34ba-b004-436c-a881-18ac3bb9af92.json new file mode 100644 index 0000000000..f5d238e69a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/app_installations-279b34ba-b004-436c-a881-18ac3bb9af92.json @@ -0,0 +1,45 @@ +[ + { + "id": 13064215, + "account": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "repository_selection": "selected", + "access_tokens_url": "https://api.github.com/app/installations/13064215/access_tokens", + "repositories_url": "https://api.github.com/installation/repositories", + "html_url": "https://github.com/organizations/hub4j-test-org/settings/installations/13064215", + "app_id": 89368, + "app_slug": "ghapi-test-app-3", + "target_id": 7544739, + "target_type": "Organization", + "permissions": { + "checks": "write", + "metadata": "read" + }, + "events": [], + "created_at": "2020-11-19T14:33:27.000Z", + "updated_at": "2020-11-19T14:33:27.000Z", + "single_file_name": null, + "has_multiple_single_files": false, + "single_file_paths": [], + "suspended_by": null, + "suspended_at": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_hub4j-test-org_test-checks-bc025b21-a941-4be8-b658-6eadfdc333f5.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_hub4j-test-org_test-checks-bc025b21-a941-4be8-b658-6eadfdc333f5.json new file mode 100644 index 0000000000..9180f8d63e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_hub4j-test-org_test-checks-bc025b21-a941-4be8-b658-6eadfdc333f5.json @@ -0,0 +1,121 @@ +{ + "id": 314259932, + "node_id": "MDEwOlJlcG9zaXRvcnkzMTQyNTk5MzI=", + "name": "test-checks", + "full_name": "hub4j-test-org/test-checks", + "private": true, + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/test-checks", + "description": "Repo for testing the checks API", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/test-checks", + "forks_url": "https://api.github.com/repos/hub4j-test-org/test-checks/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/test-checks/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/test-checks/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/test-checks/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/test-checks/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/test-checks/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/test-checks/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/test-checks/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/test-checks/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/test-checks/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/test-checks/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/test-checks/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/test-checks/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/test-checks/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/test-checks/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/test-checks/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/test-checks/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/test-checks/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/test-checks/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/test-checks/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/test-checks/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/test-checks/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/test-checks/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/test-checks/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/test-checks/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/test-checks/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/test-checks/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/test-checks/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/test-checks/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/test-checks/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-checks/deployments", + "created_at": "2020-11-19T13:41:45Z", + "updated_at": "2020-11-19T13:41:50Z", + "pushed_at": "2020-11-19T13:41:47Z", + "git_url": "git://github.com/hub4j-test-org/test-checks.git", + "ssh_url": "git@github.com:hub4j-test-org/test-checks.git", + "clone_url": "https://github.com/hub4j-test-org/test-checks.git", + "svn_url": "https://github.com/hub4j-test-org/test-checks", + "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": "main", + "permissions": { + "admin": false, + "push": false, + "pull": false + }, + "organization": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 0, + "subscribers_count": 8 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_hub4j-test-org_test-checks_check-runs-0ee56d4a-d0d3-44e7-831b-84e299eaf47e.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_hub4j-test-org_test-checks_check-runs-0ee56d4a-d0d3-44e7-831b-84e299eaf47e.json new file mode 100644 index 0000000000..fc787ac242 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_hub4j-test-org_test-checks_check-runs-0ee56d4a-d0d3-44e7-831b-84e299eaf47e.json @@ -0,0 +1,61 @@ +{ + "id": 1424883599, + "node_id": "MDg6Q2hlY2tSdW4xNDI0ODgzNTk5", + "head_sha": "89a9ae301e35e667756034fdc933b1fc94f63fc1", + "external_id": "", + "url": "https://api.github.com/repos/hub4j-test-org/test-checks/check-runs/1424883599", + "html_url": "https://github.com/hub4j-test-org/test-checks/runs/1424883599", + "details_url": "http://localhost", + "status": "completed", + "conclusion": "success", + "started_at": "2020-11-19T15:00:21Z", + "completed_at": "2020-11-19T15:00:21Z", + "output": { + "title": "Big Run", + "summary": "Lots of stuff here »", + "text": null, + "annotations_count": 50, + "annotations_url": "https://api.github.com/repos/hub4j-test-org/test-checks/check-runs/1424883599/annotations" + }, + "name": "big", + "check_suite": { + "id": 1529145983 + }, + "app": { + "id": 89368, + "slug": "ghapi-test-app-3", + "node_id": "MDM6QXBwODkzNjg=", + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "name": "GHApi Test app 3", + "description": "Test app for checks api testing", + "external_url": "http://localhost", + "html_url": "https://github.com/apps/ghapi-test-app-3", + "created_at": "2020-11-19T14:30:34Z", + "updated_at": "2020-11-19T14:30:34Z", + "permissions": { + "checks": "write", + "metadata": "read" + }, + "events": [] + }, + "pull_requests": [] +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_hub4j-test-org_test-checks_check-runs_1424883599-b00d927c-1c6c-4f49-b568-68327ef7d436.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_hub4j-test-org_test-checks_check-runs_1424883599-b00d927c-1c6c-4f49-b568-68327ef7d436.json new file mode 100644 index 0000000000..002ca78b8c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_hub4j-test-org_test-checks_check-runs_1424883599-b00d927c-1c6c-4f49-b568-68327ef7d436.json @@ -0,0 +1,61 @@ +{ + "id": 1424883599, + "node_id": "MDg6Q2hlY2tSdW4xNDI0ODgzNTk5", + "head_sha": "89a9ae301e35e667756034fdc933b1fc94f63fc1", + "external_id": "", + "url": "https://api.github.com/repos/hub4j-test-org/test-checks/check-runs/1424883599", + "html_url": "https://github.com/hub4j-test-org/test-checks/runs/1424883599", + "details_url": "http://localhost", + "status": "completed", + "conclusion": "success", + "started_at": "2020-11-19T15:00:21Z", + "completed_at": "2020-11-19T15:00:21Z", + "output": { + "title": "Big Run", + "summary": "Lots of stuff here »", + "text": null, + "annotations_count": 101, + "annotations_url": "https://api.github.com/repos/hub4j-test-org/test-checks/check-runs/1424883599/annotations" + }, + "name": "big", + "check_suite": { + "id": 1529145983 + }, + "app": { + "id": 89368, + "slug": "ghapi-test-app-3", + "node_id": "MDM6QXBwODkzNjg=", + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "name": "GHApi Test app 3", + "description": "Test app for checks api testing", + "external_url": "http://localhost", + "html_url": "https://github.com/apps/ghapi-test-app-3", + "created_at": "2020-11-19T14:30:34Z", + "updated_at": "2020-11-19T14:30:34Z", + "permissions": { + "checks": "write", + "metadata": "read" + }, + "events": [] + }, + "pull_requests": [] +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_hub4j-test-org_test-checks_check-runs_1424883599-f3d54793-977e-48f8-857b-106af311ddea.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_hub4j-test-org_test-checks_check-runs_1424883599-f3d54793-977e-48f8-857b-106af311ddea.json new file mode 100644 index 0000000000..83d571bc29 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_hub4j-test-org_test-checks_check-runs_1424883599-f3d54793-977e-48f8-857b-106af311ddea.json @@ -0,0 +1,61 @@ +{ + "id": 1424883599, + "node_id": "MDg6Q2hlY2tSdW4xNDI0ODgzNTk5", + "head_sha": "89a9ae301e35e667756034fdc933b1fc94f63fc1", + "external_id": "", + "url": "https://api.github.com/repos/hub4j-test-org/test-checks/check-runs/1424883599", + "html_url": "https://github.com/hub4j-test-org/test-checks/runs/1424883599", + "details_url": "http://localhost", + "status": "completed", + "conclusion": "success", + "started_at": "2020-11-19T15:00:21Z", + "completed_at": "2020-11-19T15:00:21Z", + "output": { + "title": "Big Run", + "summary": "Lots of stuff here »", + "text": null, + "annotations_count": 100, + "annotations_url": "https://api.github.com/repos/hub4j-test-org/test-checks/check-runs/1424883599/annotations" + }, + "name": "big", + "check_suite": { + "id": 1529145983 + }, + "app": { + "id": 89368, + "slug": "ghapi-test-app-3", + "node_id": "MDM6QXBwODkzNjg=", + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "name": "GHApi Test app 3", + "description": "Test app for checks api testing", + "external_url": "http://localhost", + "html_url": "https://github.com/apps/ghapi-test-app-3", + "created_at": "2020-11-19T14:30:34Z", + "updated_at": "2020-11-19T14:30:34Z", + "permissions": { + "checks": "write", + "metadata": "read" + }, + "events": [] + }, + "pull_requests": [] +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_jglick_github-api-test-1.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_jglick_github-api-test-1.json deleted file mode 100644 index 79eebcc369..0000000000 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_jglick_github-api-test-1.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "id": 95711947, - "node_id": "MDEwOlJlcG9zaXRvcnk5NTcxMTk0Nw==", - "name": "github-api-test", - "full_name": "jglick/github-api-test", - "private": false, - "owner": { - "login": "jglick", - "id": 154109, - "node_id": "MDQ6VXNlcjE1NDEwOQ==", - "avatar_url": "https://avatars1.githubusercontent.com/u/154109?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/jglick", - "html_url": "https://github.com/jglick", - "followers_url": "https://api.github.com/users/jglick/followers", - "following_url": "https://api.github.com/users/jglick/following{/other_user}", - "gists_url": "https://api.github.com/users/jglick/gists{/gist_id}", - "starred_url": "https://api.github.com/users/jglick/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/jglick/subscriptions", - "organizations_url": "https://api.github.com/users/jglick/orgs", - "repos_url": "https://api.github.com/users/jglick/repos", - "events_url": "https://api.github.com/users/jglick/events{/privacy}", - "received_events_url": "https://api.github.com/users/jglick/received_events", - "type": "User", - "site_admin": false - }, - "html_url": "https://github.com/jglick/github-api-test", - "description": "A test repository for testingthe github-api project", - "fork": false, - "url": "https://api.github.com/repos/jglick/github-api-test", - "forks_url": "https://api.github.com/repos/jglick/github-api-test/forks", - "keys_url": "https://api.github.com/repos/jglick/github-api-test/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/jglick/github-api-test/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/jglick/github-api-test/teams", - "hooks_url": "https://api.github.com/repos/jglick/github-api-test/hooks", - "issue_events_url": "https://api.github.com/repos/jglick/github-api-test/issues/events{/number}", - "events_url": "https://api.github.com/repos/jglick/github-api-test/events", - "assignees_url": "https://api.github.com/repos/jglick/github-api-test/assignees{/user}", - "branches_url": "https://api.github.com/repos/jglick/github-api-test/branches{/branch}", - "tags_url": "https://api.github.com/repos/jglick/github-api-test/tags", - "blobs_url": "https://api.github.com/repos/jglick/github-api-test/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/jglick/github-api-test/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/jglick/github-api-test/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/jglick/github-api-test/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/jglick/github-api-test/statuses/{sha}", - "languages_url": "https://api.github.com/repos/jglick/github-api-test/languages", - "stargazers_url": "https://api.github.com/repos/jglick/github-api-test/stargazers", - "contributors_url": "https://api.github.com/repos/jglick/github-api-test/contributors", - "subscribers_url": "https://api.github.com/repos/jglick/github-api-test/subscribers", - "subscription_url": "https://api.github.com/repos/jglick/github-api-test/subscription", - "commits_url": "https://api.github.com/repos/jglick/github-api-test/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/jglick/github-api-test/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/jglick/github-api-test/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/jglick/github-api-test/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/jglick/github-api-test/contents/{+path}", - "compare_url": "https://api.github.com/repos/jglick/github-api-test/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/jglick/github-api-test/merges", - "archive_url": "https://api.github.com/repos/jglick/github-api-test/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/jglick/github-api-test/downloads", - "issues_url": "https://api.github.com/repos/jglick/github-api-test/issues{/number}", - "pulls_url": "https://api.github.com/repos/jglick/github-api-test/pulls{/number}", - "milestones_url": "https://api.github.com/repos/jglick/github-api-test/milestones{/number}", - "notifications_url": "https://api.github.com/repos/jglick/github-api-test/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/jglick/github-api-test/labels{/name}", - "releases_url": "https://api.github.com/repos/jglick/github-api-test/releases{/id}", - "deployments_url": "https://api.github.com/repos/jglick/github-api-test/deployments", - "created_at": "2017-06-28T21:10:35Z", - "updated_at": "2020-03-25T22:26:13Z", - "pushed_at": "2020-03-25T22:26:10Z", - "git_url": "git://github.com/jglick/github-api-test.git", - "ssh_url": "git@github.com:jglick/github-api-test.git", - "clone_url": "https://github.com/jglick/github-api-test.git", - "svn_url": "https://github.com/jglick/github-api-test", - "homepage": "http://github-api.kohsuke.org/", - "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": false, - "push": false, - "pull": false - }, - "temp_clone_token": "", - "network_count": 0, - "subscribers_count": 0 -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_jglick_github-api-test_check-runs-2.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_jglick_github-api-test_check-runs-2.json deleted file mode 100644 index 301d7def5d..0000000000 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_jglick_github-api-test_check-runs-2.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "id": 546384622, - "node_id": "MDg6Q2hlY2tSdW41NDYzODQ2MjI=", - "head_sha": "4a929d464a2fae7ee899ce603250f7dab304bc4b", - "external_id": "", - "url": "https://api.github.com/repos/jglick/github-api-test/check-runs/546384622", - "html_url": "https://github.com/jglick/github-api-test/runs/546384622", - "details_url": "http://nowhere.net/", - "status": "completed", - "conclusion": "success", - "started_at": "2020-03-30T18:23:31Z", - "completed_at": "2020-03-30T18:23:31Z", - "output": { - "title": "Big Run", - "summary": "Lots of stuff here »", - "text": null, - "annotations_count": 50, - "annotations_url": "https://api.github.com/repos/jglick/github-api-test/check-runs/546384622/annotations" - }, - "name": "big", - "check_suite": { - "id": 547824747 - }, - "app": { - "id": 58691, - "slug": "jglick-app-test", - "node_id": "MDM6QXBwNTg2OTE=", - "owner": { - "login": "jglick", - "id": 154109, - "node_id": "MDQ6VXNlcjE1NDEwOQ==", - "avatar_url": "https://avatars1.githubusercontent.com/u/154109?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/jglick", - "html_url": "https://github.com/jglick", - "followers_url": "https://api.github.com/users/jglick/followers", - "following_url": "https://api.github.com/users/jglick/following{/other_user}", - "gists_url": "https://api.github.com/users/jglick/gists{/gist_id}", - "starred_url": "https://api.github.com/users/jglick/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/jglick/subscriptions", - "organizations_url": "https://api.github.com/users/jglick/orgs", - "repos_url": "https://api.github.com/users/jglick/repos", - "events_url": "https://api.github.com/users/jglick/events{/privacy}", - "received_events_url": "https://api.github.com/users/jglick/received_events", - "type": "User", - "site_admin": false - }, - "name": "jglick-app-test", - "description": "", - "external_url": "http://nowhere.net/", - "html_url": "https://github.com/apps/jglick-app-test", - "created_at": "2020-03-25T22:13:14Z", - "updated_at": "2020-03-25T22:13:14Z", - "permissions": { - "checks": "write", - "metadata": "read" - }, - "events": [] - }, - "pull_requests": [] -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_jglick_github-api-test_check-runs_546384622-3.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_jglick_github-api-test_check-runs_546384622-3.json deleted file mode 100644 index 16abb0feef..0000000000 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_jglick_github-api-test_check-runs_546384622-3.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "id": 546384622, - "node_id": "MDg6Q2hlY2tSdW41NDYzODQ2MjI=", - "head_sha": "4a929d464a2fae7ee899ce603250f7dab304bc4b", - "external_id": "", - "url": "https://api.github.com/repos/jglick/github-api-test/check-runs/546384622", - "html_url": "https://github.com/jglick/github-api-test/runs/546384622", - "details_url": "http://nowhere.net/", - "status": "completed", - "conclusion": "success", - "started_at": "2020-03-30T18:23:31Z", - "completed_at": "2020-03-30T18:23:31Z", - "output": { - "title": "Big Run", - "summary": "Lots of stuff here »", - "text": null, - "annotations_count": 100, - "annotations_url": "https://api.github.com/repos/jglick/github-api-test/check-runs/546384622/annotations" - }, - "name": "big", - "check_suite": { - "id": 547824747 - }, - "app": { - "id": 58691, - "slug": "jglick-app-test", - "node_id": "MDM6QXBwNTg2OTE=", - "owner": { - "login": "jglick", - "id": 154109, - "node_id": "MDQ6VXNlcjE1NDEwOQ==", - "avatar_url": "https://avatars1.githubusercontent.com/u/154109?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/jglick", - "html_url": "https://github.com/jglick", - "followers_url": "https://api.github.com/users/jglick/followers", - "following_url": "https://api.github.com/users/jglick/following{/other_user}", - "gists_url": "https://api.github.com/users/jglick/gists{/gist_id}", - "starred_url": "https://api.github.com/users/jglick/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/jglick/subscriptions", - "organizations_url": "https://api.github.com/users/jglick/orgs", - "repos_url": "https://api.github.com/users/jglick/repos", - "events_url": "https://api.github.com/users/jglick/events{/privacy}", - "received_events_url": "https://api.github.com/users/jglick/received_events", - "type": "User", - "site_admin": false - }, - "name": "jglick-app-test", - "description": "", - "external_url": "http://nowhere.net/", - "html_url": "https://github.com/apps/jglick-app-test", - "created_at": "2020-03-25T22:13:14Z", - "updated_at": "2020-03-25T22:13:14Z", - "permissions": { - "checks": "write", - "metadata": "read" - }, - "events": [] - }, - "pull_requests": [] -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_jglick_github-api-test_check-runs_546384622-4.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_jglick_github-api-test_check-runs_546384622-4.json deleted file mode 100644 index f1ef833277..0000000000 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/__files/repos_jglick_github-api-test_check-runs_546384622-4.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "id": 546384622, - "node_id": "MDg6Q2hlY2tSdW41NDYzODQ2MjI=", - "head_sha": "4a929d464a2fae7ee899ce603250f7dab304bc4b", - "external_id": "", - "url": "https://api.github.com/repos/jglick/github-api-test/check-runs/546384622", - "html_url": "https://github.com/jglick/github-api-test/runs/546384622", - "details_url": "http://nowhere.net/", - "status": "completed", - "conclusion": "success", - "started_at": "2020-03-30T18:23:31Z", - "completed_at": "2020-03-30T18:23:31Z", - "output": { - "title": "Big Run", - "summary": "Lots of stuff here »", - "text": null, - "annotations_count": 101, - "annotations_url": "https://api.github.com/repos/jglick/github-api-test/check-runs/546384622/annotations" - }, - "name": "big", - "check_suite": { - "id": 547824747 - }, - "app": { - "id": 58691, - "slug": "jglick-app-test", - "node_id": "MDM6QXBwNTg2OTE=", - "owner": { - "login": "jglick", - "id": 154109, - "node_id": "MDQ6VXNlcjE1NDEwOQ==", - "avatar_url": "https://avatars1.githubusercontent.com/u/154109?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/jglick", - "html_url": "https://github.com/jglick", - "followers_url": "https://api.github.com/users/jglick/followers", - "following_url": "https://api.github.com/users/jglick/following{/other_user}", - "gists_url": "https://api.github.com/users/jglick/gists{/gist_id}", - "starred_url": "https://api.github.com/users/jglick/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/jglick/subscriptions", - "organizations_url": "https://api.github.com/users/jglick/orgs", - "repos_url": "https://api.github.com/users/jglick/repos", - "events_url": "https://api.github.com/users/jglick/events{/privacy}", - "received_events_url": "https://api.github.com/users/jglick/received_events", - "type": "User", - "site_admin": false - }, - "name": "jglick-app-test", - "description": "", - "external_url": "http://nowhere.net/", - "html_url": "https://github.com/apps/jglick-app-test", - "created_at": "2020-03-25T22:13:14Z", - "updated_at": "2020-03-25T22:13:14Z", - "permissions": { - "checks": "write", - "metadata": "read" - }, - "events": [] - }, - "pull_requests": [] -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/app-d5ac21ed-d95f-497e-9391-599401628a54.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/app-d5ac21ed-d95f-497e-9391-599401628a54.json new file mode 100644 index 0000000000..e7c2f1d199 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/app-d5ac21ed-d95f-497e-9391-599401628a54.json @@ -0,0 +1,41 @@ +{ + "id": "d5ac21ed-d95f-497e-9391-599401628a54", + "name": "app", + "request": { + "url": "/app", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "app-d5ac21ed-d95f-497e-9391-599401628a54.json", + "headers": { + "Date": "Thu, 19 Nov 2020 15:00:20 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"174e4dd83df85fc873704d9b9e66883391e4ed80f0c537880e3f48f790fb4e47\"", + "X-GitHub-Media-Type": "github.v3; param=machine-man-preview; format=json", + "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": "FFBC:5CCF:2A6DD2:3330A0:5FB68883" + } + }, + "uuid": "d5ac21ed-d95f-497e-9391-599401628a54", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/app_installations-279b34ba-b004-436c-a881-18ac3bb9af92.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/app_installations-279b34ba-b004-436c-a881-18ac3bb9af92.json new file mode 100644 index 0000000000..a72f94aeee --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/app_installations-279b34ba-b004-436c-a881-18ac3bb9af92.json @@ -0,0 +1,41 @@ +{ + "id": "279b34ba-b004-436c-a881-18ac3bb9af92", + "name": "app_installations", + "request": { + "url": "/app/installations", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "app_installations-279b34ba-b004-436c-a881-18ac3bb9af92.json", + "headers": { + "Date": "Thu, 19 Nov 2020 15:00:20 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"e9ffa0e78284d854058825e6267f828446fcd9f96430ce74e40eac816f7e6b19\"", + "X-GitHub-Media-Type": "github.v3; param=machine-man-preview; format=json", + "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": "FFBC:5CCF:2A6DDE:3330AD:5FB68884" + } + }, + "uuid": "279b34ba-b004-436c-a881-18ac3bb9af92", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/app_installations_13064215_access_tokens-29f22c8b-1bfb-45f2-9b5e-bdc1d9cc75b8.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/app_installations_13064215_access_tokens-29f22c8b-1bfb-45f2-9b5e-bdc1d9cc75b8.json new file mode 100644 index 0000000000..6caadabfc5 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/app_installations_13064215_access_tokens-29f22c8b-1bfb-45f2-9b5e-bdc1d9cc75b8.json @@ -0,0 +1,48 @@ +{ + "id": "29f22c8b-1bfb-45f2-9b5e-bdc1d9cc75b8", + "name": "app_installations_13064215_access_tokens", + "request": { + "url": "/app/installations/13064215/access_tokens", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "body": "{\"token\":\"v1.669ed882820034b43d34f6c441be0bc8d8f738ab\",\"expires_at\":\"2020-11-19T16:00:20Z\",\"permissions\":{\"checks\":\"write\",\"metadata\":\"read\"},\"repository_selection\":\"selected\"}", + "headers": { + "Date": "Thu, 19 Nov 2020 15:00:20 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "\"788356d0bc43aa78bcd458e797d96335de56cb4d4f8de481db095c8065cf6b83\"", + "X-GitHub-Media-Type": "github.v3; param=machine-man-preview; format=json", + "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": "FFBC:5CCF:2A6DE7:3330BC:5FB68884" + } + }, + "uuid": "29f22c8b-1bfb-45f2-9b5e-bdc1d9cc75b8", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_jglick_github-api-test-1.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_hub4j-test-org_test-checks-bc025b21-a941-4be8-b658-6eadfdc333f5.json similarity index 55% rename from src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_jglick_github-api-test-1.json rename to src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_hub4j-test-org_test-checks-bc025b21-a941-4be8-b658-6eadfdc333f5.json index d704fe1b99..401b808652 100644 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_jglick_github-api-test-1.json +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_hub4j-test-org_test-checks-bc025b21-a941-4be8-b658-6eadfdc333f5.json @@ -1,8 +1,8 @@ { - "id": "0587e4c1-5f7f-4f23-95d7-a9c92945bd77", - "name": "repos_jglick_github-api-test", + "id": "bc025b21-a941-4be8-b658-6eadfdc333f5", + "name": "repos_hub4j-test-org_test-checks", "request": { - "url": "/repos/jglick/github-api-test", + "url": "/repos/hub4j-test-org/test-checks", "method": "GET", "headers": { "Accept": { @@ -12,33 +12,35 @@ }, "response": { "status": 200, - "bodyFileName": "repos_jglick_github-api-test-1.json", + "bodyFileName": "repos_hub4j-test-org_test-checks-bc025b21-a941-4be8-b658-6eadfdc333f5.json", "headers": { - "Server": "GitHub.com", - "Date": "Mon, 30 Mar 2020 18:23:30 GMT", + "Date": "Thu, 19 Nov 2020 15:00:20 GMT", "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", "Status": "200 OK", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4997", - "X-RateLimit-Reset": "1585596209", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding, Accept, X-Requested-With" + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" ], - "ETag": "W/\"c31ebce1d9b6ef50784ae33967251c4f\"", - "Last-Modified": "Wed, 25 Mar 2020 22:26:13 GMT", + "ETag": "W/\"6d2d1d8e90e7f2aa6662cd2f8342cbd19eb1b5f4ac510acd7808dbc5746de149\"", + "Last-Modified": "Thu, 19 Nov 2020 13:41:50 GMT", "X-GitHub-Media-Type": "unknown, github.v3", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4839", + "X-RateLimit-Reset": "1605800044", + "X-RateLimit-Used": "161", "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": "855C:28C5:5D190:14A900:5E823922" + "X-GitHub-Request-Id": "FFBC:5CCF:2A6DED:3330C3:5FB68884" } }, - "uuid": "0587e4c1-5f7f-4f23-95d7-a9c92945bd77", + "uuid": "bc025b21-a941-4be8-b658-6eadfdc333f5", "persistent": true, - "insertionIndex": 1 + "insertionIndex": 4 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_jglick_github-api-test_check-runs-2.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_hub4j-test-org_test-checks_check-runs-0ee56d4a-d0d3-44e7-831b-84e299eaf47e.json similarity index 87% rename from src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_jglick_github-api-test_check-runs-2.json rename to src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_hub4j-test-org_test-checks_check-runs-0ee56d4a-d0d3-44e7-831b-84e299eaf47e.json index 154241099c..4b8a9bb71a 100644 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_jglick_github-api-test_check-runs-2.json +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_hub4j-test-org_test-checks_check-runs-0ee56d4a-d0d3-44e7-831b-84e299eaf47e.json @@ -1,8 +1,8 @@ { - "id": "3ec06672-3a0b-4989-a005-ebbb01b26953", - "name": "repos_jglick_github-api-test_check-runs", + "id": "0ee56d4a-d0d3-44e7-831b-84e299eaf47e", + "name": "repos_hub4j-test-org_test-checks_check-runs", "request": { - "url": "/repos/jglick/github-api-test/check-runs", + "url": "/repos/hub4j-test-org/test-checks/check-runs", "method": "POST", "headers": { "Accept": { @@ -11,41 +11,43 @@ }, "bodyPatterns": [ { - "equalToJson": "{\"conclusion\":\"success\",\"output\":{\"title\":\"Big Run\",\"summary\":\"Lots of stuff here »\",\"annotations\":[{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #0\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #1\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #2\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #3\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #4\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #5\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #6\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #7\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #8\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #9\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #10\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #11\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #12\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #13\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #14\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #15\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #16\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #17\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #18\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #19\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #20\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #21\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #22\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #23\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #24\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #25\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #26\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #27\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #28\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #29\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #30\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #31\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #32\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #33\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #34\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #35\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #36\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #37\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #38\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #39\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #40\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #41\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #42\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #43\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #44\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #45\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #46\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #47\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #48\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #49\"}]},\"name\":\"big\",\"head_sha\":\"4a929d464a2fae7ee899ce603250f7dab304bc4b\"}", + "equalToJson": "{\"conclusion\":\"success\",\"output\":{\"title\":\"Big Run\",\"summary\":\"Lots of stuff here »\",\"annotations\":[{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #0\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #1\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #2\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #3\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #4\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #5\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #6\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #7\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #8\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #9\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #10\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #11\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #12\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #13\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #14\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #15\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #16\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #17\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #18\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #19\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #20\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #21\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #22\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #23\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #24\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #25\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #26\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #27\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #28\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #29\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #30\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #31\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #32\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #33\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #34\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #35\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #36\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #37\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #38\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #39\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #40\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #41\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #42\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #43\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #44\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #45\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #46\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #47\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #48\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #49\"}]},\"name\":\"big\",\"head_sha\":\"89a9ae301e35e667756034fdc933b1fc94f63fc1\"}", "ignoreArrayOrder": true, - "ignoreExtraElements": true + "ignoreExtraElements": false } ] }, "response": { "status": 201, - "bodyFileName": "repos_jglick_github-api-test_check-runs-2.json", + "bodyFileName": "repos_hub4j-test-org_test-checks_check-runs-0ee56d4a-d0d3-44e7-831b-84e299eaf47e.json", "headers": { - "Server": "GitHub.com", - "Date": "Mon, 30 Mar 2020 18:23:31 GMT", + "Date": "Thu, 19 Nov 2020 15:00:21 GMT", "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", "Status": "201 Created", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4996", - "X-RateLimit-Reset": "1585596209", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding, Accept, X-Requested-With" + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" ], - "ETag": "\"2614d382873a09c5179f5dba4ec6e429\"", - "Location": "https://api.github.com/repos/jglick/github-api-test/check-runs/546384622", - "X-GitHub-Media-Type": "github.antiope-preview; format=json", + "ETag": "\"ea2b5dd88722b2c8d4a99483fcb8f2adcf39438cebcba828f9ef03c36cfd27cd\"", + "Location": "https://api.github.com/repos/hub4j-test-org/test-checks/check-runs/1424883599", + "X-GitHub-Media-Type": "github.v3; param=antiope-preview; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4838", + "X-RateLimit-Reset": "1605800044", + "X-RateLimit-Used": "162", "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": "855C:28C5:5D192:14A905:5E823922" + "X-GitHub-Request-Id": "FFBC:5CCF:2A6DF2:3330CD:5FB68884" } }, - "uuid": "3ec06672-3a0b-4989-a005-ebbb01b26953", + "uuid": "0ee56d4a-d0d3-44e7-831b-84e299eaf47e", "persistent": true, - "insertionIndex": 2 + "insertionIndex": 5 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_jglick_github-api-test_check-runs_546384622-4.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_hub4j-test-org_test-checks_check-runs_1424883599-b00d927c-1c6c-4f49-b568-68327ef7d436.json similarity index 57% rename from src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_jglick_github-api-test_check-runs_546384622-4.json rename to src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_hub4j-test-org_test-checks_check-runs_1424883599-b00d927c-1c6c-4f49-b568-68327ef7d436.json index 897777b721..aa443321cb 100644 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_jglick_github-api-test_check-runs_546384622-4.json +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_hub4j-test-org_test-checks_check-runs_1424883599-b00d927c-1c6c-4f49-b568-68327ef7d436.json @@ -1,8 +1,8 @@ { - "id": "64466539-6442-4de8-b824-fba68b6dfb48", - "name": "repos_jglick_github-api-test_check-runs_546384622", + "id": "b00d927c-1c6c-4f49-b568-68327ef7d436", + "name": "repos_hub4j-test-org_test-checks_check-runs_1424883599", "request": { - "url": "/repos/jglick/github-api-test/check-runs/546384622", + "url": "/repos/hub4j-test-org/test-checks/check-runs/1424883599", "method": "PATCH", "headers": { "Accept": { @@ -13,38 +13,40 @@ { "equalToJson": "{\"output\":{\"title\":\"Big Run\",\"summary\":\"Lots of stuff here »\",\"annotations\":[{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #100\"}]}}", "ignoreArrayOrder": true, - "ignoreExtraElements": true + "ignoreExtraElements": false } ] }, "response": { "status": 200, - "bodyFileName": "repos_jglick_github-api-test_check-runs_546384622-4.json", + "bodyFileName": "repos_hub4j-test-org_test-checks_check-runs_1424883599-b00d927c-1c6c-4f49-b568-68327ef7d436.json", "headers": { - "Server": "GitHub.com", - "Date": "Mon, 30 Mar 2020 18:23:32 GMT", + "Date": "Thu, 19 Nov 2020 15:00:22 GMT", "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", "Status": "200 OK", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4994", - "X-RateLimit-Reset": "1585596209", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding, Accept, X-Requested-With" + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" ], - "ETag": "W/\"7691a39148d96449f684f28b159f6dee\"", - "X-GitHub-Media-Type": "github.antiope-preview; format=json", + "ETag": "W/\"e697fb7ea77cde58a255fc51b8c8a0737d177f684dd4f408dc11c0d3c90390be\"", + "X-GitHub-Media-Type": "github.v3; param=antiope-preview; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4836", + "X-RateLimit-Reset": "1605800044", + "X-RateLimit-Used": "164", "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": "855C:28C5:5D196:14A90B:5E823924" + "X-GitHub-Request-Id": "FFBC:5CCF:2A6E1C:333103:5FB68886" } }, - "uuid": "64466539-6442-4de8-b824-fba68b6dfb48", + "uuid": "b00d927c-1c6c-4f49-b568-68327ef7d436", "persistent": true, - "insertionIndex": 4 + "insertionIndex": 7 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_jglick_github-api-test_check-runs_546384622-3.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_hub4j-test-org_test-checks_check-runs_1424883599-f3d54793-977e-48f8-857b-106af311ddea.json similarity index 88% rename from src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_jglick_github-api-test_check-runs_546384622-3.json rename to src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_hub4j-test-org_test-checks_check-runs_1424883599-f3d54793-977e-48f8-857b-106af311ddea.json index d19c8e71c1..eb418924fc 100644 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_jglick_github-api-test_check-runs_546384622-3.json +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunManyAnnotations/mappings/repos_hub4j-test-org_test-checks_check-runs_1424883599-f3d54793-977e-48f8-857b-106af311ddea.json @@ -1,8 +1,8 @@ { - "id": "e471f014-e5f7-44b4-bbf1-60f54c7f169e", - "name": "repos_jglick_github-api-test_check-runs_546384622", + "id": "f3d54793-977e-48f8-857b-106af311ddea", + "name": "repos_hub4j-test-org_test-checks_check-runs_1424883599", "request": { - "url": "/repos/jglick/github-api-test/check-runs/546384622", + "url": "/repos/hub4j-test-org/test-checks/check-runs/1424883599", "method": "PATCH", "headers": { "Accept": { @@ -13,38 +13,40 @@ { "equalToJson": "{\"output\":{\"title\":\"Big Run\",\"summary\":\"Lots of stuff here »\",\"annotations\":[{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #50\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #51\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #52\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #53\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #54\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #55\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #56\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #57\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #58\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #59\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #60\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #61\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #62\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #63\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #64\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #65\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #66\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #67\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #68\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #69\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #70\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #71\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #72\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #73\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #74\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #75\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #76\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #77\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #78\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #79\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #80\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #81\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #82\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #83\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #84\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #85\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #86\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #87\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #88\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #89\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #90\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #91\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #92\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #93\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #94\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #95\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #96\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #97\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #98\"},{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello #99\"}]}}", "ignoreArrayOrder": true, - "ignoreExtraElements": true + "ignoreExtraElements": false } ] }, "response": { "status": 200, - "bodyFileName": "repos_jglick_github-api-test_check-runs_546384622-3.json", + "bodyFileName": "repos_hub4j-test-org_test-checks_check-runs_1424883599-f3d54793-977e-48f8-857b-106af311ddea.json", "headers": { - "Server": "GitHub.com", - "Date": "Mon, 30 Mar 2020 18:23:32 GMT", + "Date": "Thu, 19 Nov 2020 15:00:22 GMT", "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", "Status": "200 OK", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4995", - "X-RateLimit-Reset": "1585596209", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding, Accept, X-Requested-With" + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" ], - "ETag": "W/\"4ce23800e47917dad6db9d84f93d5159\"", - "X-GitHub-Media-Type": "github.antiope-preview; format=json", + "ETag": "W/\"58d805db6db8005ced8e26a662a36dbec53b073cd4bd681775559f91d043eb0e\"", + "X-GitHub-Media-Type": "github.v3; param=antiope-preview; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4837", + "X-RateLimit-Reset": "1605800044", + "X-RateLimit-Used": "163", "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": "855C:28C5:5D195:14A909:5E823923" + "X-GitHub-Request-Id": "FFBC:5CCF:2A6E0B:3330E8:5FB68885" } }, - "uuid": "e471f014-e5f7-44b4-bbf1-60f54c7f169e", + "uuid": "f3d54793-977e-48f8-857b-106af311ddea", "persistent": true, - "insertionIndex": 3 + "insertionIndex": 6 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/app-823ea390-bde8-482d-a721-16d60f724869.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/app-823ea390-bde8-482d-a721-16d60f724869.json new file mode 100644 index 0000000000..afcf6c442e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/app-823ea390-bde8-482d-a721-16d60f724869.json @@ -0,0 +1,37 @@ +{ + "id": 89368, + "slug": "ghapi-test-app-3", + "node_id": "MDM6QXBwODkzNjg=", + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "name": "GHApi Test app 3", + "description": "Test app for checks api testing", + "external_url": "http://localhost", + "html_url": "https://github.com/apps/ghapi-test-app-3", + "created_at": "2020-11-19T14:30:34Z", + "updated_at": "2020-11-19T14:30:34Z", + "permissions": { + "checks": "write", + "metadata": "read" + }, + "events": [], + "installations_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/app_installations-d364cb68-5447-4396-9201-2653c44aa36c.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/app_installations-d364cb68-5447-4396-9201-2653c44aa36c.json new file mode 100644 index 0000000000..f5d238e69a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/app_installations-d364cb68-5447-4396-9201-2653c44aa36c.json @@ -0,0 +1,45 @@ +[ + { + "id": 13064215, + "account": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "repository_selection": "selected", + "access_tokens_url": "https://api.github.com/app/installations/13064215/access_tokens", + "repositories_url": "https://api.github.com/installation/repositories", + "html_url": "https://github.com/organizations/hub4j-test-org/settings/installations/13064215", + "app_id": 89368, + "app_slug": "ghapi-test-app-3", + "target_id": 7544739, + "target_type": "Organization", + "permissions": { + "checks": "write", + "metadata": "read" + }, + "events": [], + "created_at": "2020-11-19T14:33:27.000Z", + "updated_at": "2020-11-19T14:33:27.000Z", + "single_file_name": null, + "has_multiple_single_files": false, + "single_file_paths": [], + "suspended_by": null, + "suspended_at": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/repos_hub4j-test-org_test-checks-2b35bcfa-5524-4f35-985a-5d5bff188b27.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/repos_hub4j-test-org_test-checks-2b35bcfa-5524-4f35-985a-5d5bff188b27.json new file mode 100644 index 0000000000..9180f8d63e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/repos_hub4j-test-org_test-checks-2b35bcfa-5524-4f35-985a-5d5bff188b27.json @@ -0,0 +1,121 @@ +{ + "id": 314259932, + "node_id": "MDEwOlJlcG9zaXRvcnkzMTQyNTk5MzI=", + "name": "test-checks", + "full_name": "hub4j-test-org/test-checks", + "private": true, + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/test-checks", + "description": "Repo for testing the checks API", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/test-checks", + "forks_url": "https://api.github.com/repos/hub4j-test-org/test-checks/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/test-checks/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/test-checks/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/test-checks/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/test-checks/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/test-checks/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/test-checks/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/test-checks/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/test-checks/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/test-checks/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/test-checks/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/test-checks/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/test-checks/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/test-checks/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/test-checks/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/test-checks/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/test-checks/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/test-checks/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/test-checks/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/test-checks/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/test-checks/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/test-checks/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/test-checks/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/test-checks/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/test-checks/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/test-checks/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/test-checks/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/test-checks/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/test-checks/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/test-checks/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-checks/deployments", + "created_at": "2020-11-19T13:41:45Z", + "updated_at": "2020-11-19T13:41:50Z", + "pushed_at": "2020-11-19T13:41:47Z", + "git_url": "git://github.com/hub4j-test-org/test-checks.git", + "ssh_url": "git@github.com:hub4j-test-org/test-checks.git", + "clone_url": "https://github.com/hub4j-test-org/test-checks.git", + "svn_url": "https://github.com/hub4j-test-org/test-checks", + "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": "main", + "permissions": { + "admin": false, + "push": false, + "pull": false + }, + "organization": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 0, + "subscribers_count": 8 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/repos_hub4j-test-org_test-checks_check-runs-a7a4c155-d928-4d41-8c9d-8a6caa5a851b.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/repos_hub4j-test-org_test-checks_check-runs-a7a4c155-d928-4d41-8c9d-8a6caa5a851b.json new file mode 100644 index 0000000000..d35f66ddb3 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/repos_hub4j-test-org_test-checks_check-runs-a7a4c155-d928-4d41-8c9d-8a6caa5a851b.json @@ -0,0 +1,61 @@ +{ + "id": 1424883957, + "node_id": "MDg6Q2hlY2tSdW4xNDI0ODgzOTU3", + "head_sha": "89a9ae301e35e667756034fdc933b1fc94f63fc1", + "external_id": "", + "url": "https://api.github.com/repos/hub4j-test-org/test-checks/check-runs/1424883957", + "html_url": "https://github.com/hub4j-test-org/test-checks/runs/1424883957", + "details_url": "http://localhost", + "status": "completed", + "conclusion": "neutral", + "started_at": "2020-11-19T15:00:23Z", + "completed_at": "2020-11-19T15:00:23Z", + "output": { + "title": "Quick note", + "summary": "nothing more to see here", + "text": null, + "annotations_count": 0, + "annotations_url": "https://api.github.com/repos/hub4j-test-org/test-checks/check-runs/1424883957/annotations" + }, + "name": "quick", + "check_suite": { + "id": 1529145983 + }, + "app": { + "id": 89368, + "slug": "ghapi-test-app-3", + "node_id": "MDM6QXBwODkzNjg=", + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "name": "GHApi Test app 3", + "description": "Test app for checks api testing", + "external_url": "http://localhost", + "html_url": "https://github.com/apps/ghapi-test-app-3", + "created_at": "2020-11-19T14:30:34Z", + "updated_at": "2020-11-19T14:30:34Z", + "permissions": { + "checks": "write", + "metadata": "read" + }, + "events": [] + }, + "pull_requests": [] +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/repos_jglick_github-api-test-1.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/repos_jglick_github-api-test-1.json deleted file mode 100644 index 79eebcc369..0000000000 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/repos_jglick_github-api-test-1.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "id": 95711947, - "node_id": "MDEwOlJlcG9zaXRvcnk5NTcxMTk0Nw==", - "name": "github-api-test", - "full_name": "jglick/github-api-test", - "private": false, - "owner": { - "login": "jglick", - "id": 154109, - "node_id": "MDQ6VXNlcjE1NDEwOQ==", - "avatar_url": "https://avatars1.githubusercontent.com/u/154109?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/jglick", - "html_url": "https://github.com/jglick", - "followers_url": "https://api.github.com/users/jglick/followers", - "following_url": "https://api.github.com/users/jglick/following{/other_user}", - "gists_url": "https://api.github.com/users/jglick/gists{/gist_id}", - "starred_url": "https://api.github.com/users/jglick/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/jglick/subscriptions", - "organizations_url": "https://api.github.com/users/jglick/orgs", - "repos_url": "https://api.github.com/users/jglick/repos", - "events_url": "https://api.github.com/users/jglick/events{/privacy}", - "received_events_url": "https://api.github.com/users/jglick/received_events", - "type": "User", - "site_admin": false - }, - "html_url": "https://github.com/jglick/github-api-test", - "description": "A test repository for testingthe github-api project", - "fork": false, - "url": "https://api.github.com/repos/jglick/github-api-test", - "forks_url": "https://api.github.com/repos/jglick/github-api-test/forks", - "keys_url": "https://api.github.com/repos/jglick/github-api-test/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/jglick/github-api-test/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/jglick/github-api-test/teams", - "hooks_url": "https://api.github.com/repos/jglick/github-api-test/hooks", - "issue_events_url": "https://api.github.com/repos/jglick/github-api-test/issues/events{/number}", - "events_url": "https://api.github.com/repos/jglick/github-api-test/events", - "assignees_url": "https://api.github.com/repos/jglick/github-api-test/assignees{/user}", - "branches_url": "https://api.github.com/repos/jglick/github-api-test/branches{/branch}", - "tags_url": "https://api.github.com/repos/jglick/github-api-test/tags", - "blobs_url": "https://api.github.com/repos/jglick/github-api-test/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/jglick/github-api-test/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/jglick/github-api-test/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/jglick/github-api-test/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/jglick/github-api-test/statuses/{sha}", - "languages_url": "https://api.github.com/repos/jglick/github-api-test/languages", - "stargazers_url": "https://api.github.com/repos/jglick/github-api-test/stargazers", - "contributors_url": "https://api.github.com/repos/jglick/github-api-test/contributors", - "subscribers_url": "https://api.github.com/repos/jglick/github-api-test/subscribers", - "subscription_url": "https://api.github.com/repos/jglick/github-api-test/subscription", - "commits_url": "https://api.github.com/repos/jglick/github-api-test/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/jglick/github-api-test/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/jglick/github-api-test/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/jglick/github-api-test/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/jglick/github-api-test/contents/{+path}", - "compare_url": "https://api.github.com/repos/jglick/github-api-test/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/jglick/github-api-test/merges", - "archive_url": "https://api.github.com/repos/jglick/github-api-test/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/jglick/github-api-test/downloads", - "issues_url": "https://api.github.com/repos/jglick/github-api-test/issues{/number}", - "pulls_url": "https://api.github.com/repos/jglick/github-api-test/pulls{/number}", - "milestones_url": "https://api.github.com/repos/jglick/github-api-test/milestones{/number}", - "notifications_url": "https://api.github.com/repos/jglick/github-api-test/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/jglick/github-api-test/labels{/name}", - "releases_url": "https://api.github.com/repos/jglick/github-api-test/releases{/id}", - "deployments_url": "https://api.github.com/repos/jglick/github-api-test/deployments", - "created_at": "2017-06-28T21:10:35Z", - "updated_at": "2020-03-25T22:26:13Z", - "pushed_at": "2020-03-25T22:26:10Z", - "git_url": "git://github.com/jglick/github-api-test.git", - "ssh_url": "git@github.com:jglick/github-api-test.git", - "clone_url": "https://github.com/jglick/github-api-test.git", - "svn_url": "https://github.com/jglick/github-api-test", - "homepage": "http://github-api.kohsuke.org/", - "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": false, - "push": false, - "pull": false - }, - "temp_clone_token": "", - "network_count": 0, - "subscribers_count": 0 -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/repos_jglick_github-api-test_check-runs-2.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/repos_jglick_github-api-test_check-runs-2.json deleted file mode 100644 index cfc72da75b..0000000000 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/__files/repos_jglick_github-api-test_check-runs-2.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "id": 546384705, - "node_id": "MDg6Q2hlY2tSdW41NDYzODQ3MDU=", - "head_sha": "4a929d464a2fae7ee899ce603250f7dab304bc4b", - "external_id": "", - "url": "https://api.github.com/repos/jglick/github-api-test/check-runs/546384705", - "html_url": "https://github.com/jglick/github-api-test/runs/546384705", - "details_url": "http://nowhere.net/", - "status": "completed", - "conclusion": "neutral", - "started_at": "2020-03-30T18:23:33Z", - "completed_at": "2020-03-30T18:23:33Z", - "output": { - "title": "Quick note", - "summary": "nothing more to see here", - "text": null, - "annotations_count": 0, - "annotations_url": "https://api.github.com/repos/jglick/github-api-test/check-runs/546384705/annotations" - }, - "name": "quick", - "check_suite": { - "id": 547824747 - }, - "app": { - "id": 58691, - "slug": "jglick-app-test", - "node_id": "MDM6QXBwNTg2OTE=", - "owner": { - "login": "jglick", - "id": 154109, - "node_id": "MDQ6VXNlcjE1NDEwOQ==", - "avatar_url": "https://avatars1.githubusercontent.com/u/154109?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/jglick", - "html_url": "https://github.com/jglick", - "followers_url": "https://api.github.com/users/jglick/followers", - "following_url": "https://api.github.com/users/jglick/following{/other_user}", - "gists_url": "https://api.github.com/users/jglick/gists{/gist_id}", - "starred_url": "https://api.github.com/users/jglick/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/jglick/subscriptions", - "organizations_url": "https://api.github.com/users/jglick/orgs", - "repos_url": "https://api.github.com/users/jglick/repos", - "events_url": "https://api.github.com/users/jglick/events{/privacy}", - "received_events_url": "https://api.github.com/users/jglick/received_events", - "type": "User", - "site_admin": false - }, - "name": "jglick-app-test", - "description": "", - "external_url": "http://nowhere.net/", - "html_url": "https://github.com/apps/jglick-app-test", - "created_at": "2020-03-25T22:13:14Z", - "updated_at": "2020-03-25T22:13:14Z", - "permissions": { - "checks": "write", - "metadata": "read" - }, - "events": [] - }, - "pull_requests": [] -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/app-823ea390-bde8-482d-a721-16d60f724869.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/app-823ea390-bde8-482d-a721-16d60f724869.json new file mode 100644 index 0000000000..2499a8533b --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/app-823ea390-bde8-482d-a721-16d60f724869.json @@ -0,0 +1,41 @@ +{ + "id": "823ea390-bde8-482d-a721-16d60f724869", + "name": "app", + "request": { + "url": "/app", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "app-823ea390-bde8-482d-a721-16d60f724869.json", + "headers": { + "Date": "Thu, 19 Nov 2020 15:00:23 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"174e4dd83df85fc873704d9b9e66883391e4ed80f0c537880e3f48f790fb4e47\"", + "X-GitHub-Media-Type": "github.v3; param=machine-man-preview; format=json", + "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": "FFCD:DF62:2B5527:33F457:5FB68886" + } + }, + "uuid": "823ea390-bde8-482d-a721-16d60f724869", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/app_installations-d364cb68-5447-4396-9201-2653c44aa36c.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/app_installations-d364cb68-5447-4396-9201-2653c44aa36c.json new file mode 100644 index 0000000000..9dc7fafc72 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/app_installations-d364cb68-5447-4396-9201-2653c44aa36c.json @@ -0,0 +1,41 @@ +{ + "id": "d364cb68-5447-4396-9201-2653c44aa36c", + "name": "app_installations", + "request": { + "url": "/app/installations", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "app_installations-d364cb68-5447-4396-9201-2653c44aa36c.json", + "headers": { + "Date": "Thu, 19 Nov 2020 15:00:23 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"e9ffa0e78284d854058825e6267f828446fcd9f96430ce74e40eac816f7e6b19\"", + "X-GitHub-Media-Type": "github.v3; param=machine-man-preview; format=json", + "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": "FFCD:DF62:2B552D:33F45F:5FB68887" + } + }, + "uuid": "d364cb68-5447-4396-9201-2653c44aa36c", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/app_installations_13064215_access_tokens-da103579-7c4a-4f9b-bc1b-2946405f411b.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/app_installations_13064215_access_tokens-da103579-7c4a-4f9b-bc1b-2946405f411b.json new file mode 100644 index 0000000000..24751763c7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/app_installations_13064215_access_tokens-da103579-7c4a-4f9b-bc1b-2946405f411b.json @@ -0,0 +1,48 @@ +{ + "id": "da103579-7c4a-4f9b-bc1b-2946405f411b", + "name": "app_installations_13064215_access_tokens", + "request": { + "url": "/app/installations/13064215/access_tokens", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "body": "{\"token\":\"v1.055f5f571e5f934d5e1aafc1c8c522875d7b54e2\",\"expires_at\":\"2020-11-19T16:00:23Z\",\"permissions\":{\"checks\":\"write\",\"metadata\":\"read\"},\"repository_selection\":\"selected\"}", + "headers": { + "Date": "Thu, 19 Nov 2020 15:00:23 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "\"ac6d8b0ea06dfea0cee371ff49eddbe696748007b56397ab351ea864c6f7db8c\"", + "X-GitHub-Media-Type": "github.v3; param=machine-man-preview; format=json", + "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": "FFCD:DF62:2B5537:33F468:5FB68887" + } + }, + "uuid": "da103579-7c4a-4f9b-bc1b-2946405f411b", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/repos_hub4j-test-org_test-checks-2b35bcfa-5524-4f35-985a-5d5bff188b27.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/repos_hub4j-test-org_test-checks-2b35bcfa-5524-4f35-985a-5d5bff188b27.json new file mode 100644 index 0000000000..058f3ca90d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/repos_hub4j-test-org_test-checks-2b35bcfa-5524-4f35-985a-5d5bff188b27.json @@ -0,0 +1,46 @@ +{ + "id": "2b35bcfa-5524-4f35-985a-5d5bff188b27", + "name": "repos_hub4j-test-org_test-checks", + "request": { + "url": "/repos/hub4j-test-org/test-checks", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_test-checks-2b35bcfa-5524-4f35-985a-5d5bff188b27.json", + "headers": { + "Date": "Thu, 19 Nov 2020 15:00:23 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"8da9ac0b00c41dd60e55e9482cae8b26e3b07f6c70902f835614d30e752d5a61\"", + "Last-Modified": "Thu, 19 Nov 2020 13:41:50 GMT", + "X-GitHub-Media-Type": "unknown, github.v3", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4835", + "X-RateLimit-Reset": "1605800044", + "X-RateLimit-Used": "165", + "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": "FFCD:DF62:2B553D:33F46E:5FB68887" + } + }, + "uuid": "2b35bcfa-5524-4f35-985a-5d5bff188b27", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/repos_jglick_github-api-test_check-runs-2.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/repos_hub4j-test-org_test-checks_check-runs-a7a4c155-d928-4d41-8c9d-8a6caa5a851b.json similarity index 51% rename from src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/repos_jglick_github-api-test_check-runs-2.json rename to src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/repos_hub4j-test-org_test-checks_check-runs-a7a4c155-d928-4d41-8c9d-8a6caa5a851b.json index 0ad6b732f2..4120dd4130 100644 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/repos_jglick_github-api-test_check-runs-2.json +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/repos_hub4j-test-org_test-checks_check-runs-a7a4c155-d928-4d41-8c9d-8a6caa5a851b.json @@ -1,8 +1,8 @@ { - "id": "ff9758ac-2cb8-4b47-b26e-9a4b10b43ac0", - "name": "repos_jglick_github-api-test_check-runs", + "id": "a7a4c155-d928-4d41-8c9d-8a6caa5a851b", + "name": "repos_hub4j-test-org_test-checks_check-runs", "request": { - "url": "/repos/jglick/github-api-test/check-runs", + "url": "/repos/hub4j-test-org/test-checks/check-runs", "method": "POST", "headers": { "Accept": { @@ -11,41 +11,43 @@ }, "bodyPatterns": [ { - "equalToJson": "{\"conclusion\":\"neutral\",\"output\":{\"title\":\"Quick note\",\"summary\":\"nothing more to see here\"},\"name\":\"quick\",\"head_sha\":\"4a929d464a2fae7ee899ce603250f7dab304bc4b\"}", + "equalToJson": "{\"conclusion\":\"neutral\",\"output\":{\"title\":\"Quick note\",\"summary\":\"nothing more to see here\"},\"name\":\"quick\",\"head_sha\":\"89a9ae301e35e667756034fdc933b1fc94f63fc1\"}", "ignoreArrayOrder": true, - "ignoreExtraElements": true + "ignoreExtraElements": false } ] }, "response": { "status": 201, - "bodyFileName": "repos_jglick_github-api-test_check-runs-2.json", + "bodyFileName": "repos_hub4j-test-org_test-checks_check-runs-a7a4c155-d928-4d41-8c9d-8a6caa5a851b.json", "headers": { - "Server": "GitHub.com", - "Date": "Mon, 30 Mar 2020 18:23:33 GMT", + "Date": "Thu, 19 Nov 2020 15:00:24 GMT", "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", "Status": "201 Created", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4992", - "X-RateLimit-Reset": "1585596209", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding, Accept, X-Requested-With" + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" ], - "ETag": "\"e58101b25797856c6f7949ffde281a2c\"", - "Location": "https://api.github.com/repos/jglick/github-api-test/check-runs/546384705", - "X-GitHub-Media-Type": "github.antiope-preview; format=json", + "ETag": "\"a9d44c7591d9e31d508a469bd491be4d59b88a35e16b5cc4f48dcd6974938ebd\"", + "Location": "https://api.github.com/repos/hub4j-test-org/test-checks/check-runs/1424883957", + "X-GitHub-Media-Type": "github.v3; param=antiope-preview; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4834", + "X-RateLimit-Reset": "1605800044", + "X-RateLimit-Used": "166", "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": "8560:6DDE:1F4FD5:627154:5E823925" + "X-GitHub-Request-Id": "FFCD:DF62:2B5546:33F47A:5FB68887" } }, - "uuid": "ff9758ac-2cb8-4b47-b26e-9a4b10b43ac0", + "uuid": "a7a4c155-d928-4d41-8c9d-8a6caa5a851b", "persistent": true, - "insertionIndex": 2 + "insertionIndex": 5 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/app-e7a9b97e-28ab-4ca2-95c1-b1fc01fc4975.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/app-e7a9b97e-28ab-4ca2-95c1-b1fc01fc4975.json new file mode 100644 index 0000000000..afcf6c442e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/app-e7a9b97e-28ab-4ca2-95c1-b1fc01fc4975.json @@ -0,0 +1,37 @@ +{ + "id": 89368, + "slug": "ghapi-test-app-3", + "node_id": "MDM6QXBwODkzNjg=", + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "name": "GHApi Test app 3", + "description": "Test app for checks api testing", + "external_url": "http://localhost", + "html_url": "https://github.com/apps/ghapi-test-app-3", + "created_at": "2020-11-19T14:30:34Z", + "updated_at": "2020-11-19T14:30:34Z", + "permissions": { + "checks": "write", + "metadata": "read" + }, + "events": [], + "installations_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/app_installations-6d86aab4-68f2-4e10-9e7a-96c591fb3beb.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/app_installations-6d86aab4-68f2-4e10-9e7a-96c591fb3beb.json new file mode 100644 index 0000000000..f5d238e69a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/app_installations-6d86aab4-68f2-4e10-9e7a-96c591fb3beb.json @@ -0,0 +1,45 @@ +[ + { + "id": 13064215, + "account": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "repository_selection": "selected", + "access_tokens_url": "https://api.github.com/app/installations/13064215/access_tokens", + "repositories_url": "https://api.github.com/installation/repositories", + "html_url": "https://github.com/organizations/hub4j-test-org/settings/installations/13064215", + "app_id": 89368, + "app_slug": "ghapi-test-app-3", + "target_id": 7544739, + "target_type": "Organization", + "permissions": { + "checks": "write", + "metadata": "read" + }, + "events": [], + "created_at": "2020-11-19T14:33:27.000Z", + "updated_at": "2020-11-19T14:33:27.000Z", + "single_file_name": null, + "has_multiple_single_files": false, + "single_file_paths": [], + "suspended_by": null, + "suspended_at": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/repos_hub4j-test-org_test-checks-57003cf3-5da3-415a-b57a-df15cb860c7e.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/repos_hub4j-test-org_test-checks-57003cf3-5da3-415a-b57a-df15cb860c7e.json new file mode 100644 index 0000000000..9180f8d63e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/repos_hub4j-test-org_test-checks-57003cf3-5da3-415a-b57a-df15cb860c7e.json @@ -0,0 +1,121 @@ +{ + "id": 314259932, + "node_id": "MDEwOlJlcG9zaXRvcnkzMTQyNTk5MzI=", + "name": "test-checks", + "full_name": "hub4j-test-org/test-checks", + "private": true, + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/test-checks", + "description": "Repo for testing the checks API", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/test-checks", + "forks_url": "https://api.github.com/repos/hub4j-test-org/test-checks/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/test-checks/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/test-checks/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/test-checks/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/test-checks/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/test-checks/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/test-checks/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/test-checks/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/test-checks/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/test-checks/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/test-checks/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/test-checks/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/test-checks/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/test-checks/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/test-checks/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/test-checks/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/test-checks/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/test-checks/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/test-checks/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/test-checks/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/test-checks/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/test-checks/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/test-checks/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/test-checks/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/test-checks/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/test-checks/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/test-checks/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/test-checks/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/test-checks/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/test-checks/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-checks/deployments", + "created_at": "2020-11-19T13:41:45Z", + "updated_at": "2020-11-19T13:41:50Z", + "pushed_at": "2020-11-19T13:41:47Z", + "git_url": "git://github.com/hub4j-test-org/test-checks.git", + "ssh_url": "git@github.com:hub4j-test-org/test-checks.git", + "clone_url": "https://github.com/hub4j-test-org/test-checks.git", + "svn_url": "https://github.com/hub4j-test-org/test-checks", + "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": "main", + "permissions": { + "admin": false, + "push": false, + "pull": false + }, + "organization": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 0, + "subscribers_count": 8 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/repos_hub4j-test-org_test-checks_check-runs-37c9b28c-591f-4308-ae1a-ef32349069e4.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/repos_hub4j-test-org_test-checks_check-runs-37c9b28c-591f-4308-ae1a-ef32349069e4.json new file mode 100644 index 0000000000..e1b680c40d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/repos_hub4j-test-org_test-checks_check-runs-37c9b28c-591f-4308-ae1a-ef32349069e4.json @@ -0,0 +1,61 @@ +{ + "id": 1424883451, + "node_id": "MDg6Q2hlY2tSdW4xNDI0ODgzNDUx", + "head_sha": "89a9ae301e35e667756034fdc933b1fc94f63fc1", + "external_id": "", + "url": "https://api.github.com/repos/hub4j-test-org/test-checks/check-runs/1424883451", + "html_url": "https://github.com/hub4j-test-org/test-checks/runs/1424883451", + "details_url": "http://localhost", + "status": "in_progress", + "conclusion": null, + "started_at": "2020-11-19T15:00:19Z", + "completed_at": null, + "output": { + "title": null, + "summary": null, + "text": null, + "annotations_count": 0, + "annotations_url": "https://api.github.com/repos/hub4j-test-org/test-checks/check-runs/1424883451/annotations" + }, + "name": "outstanding", + "check_suite": { + "id": 1529145983 + }, + "app": { + "id": 89368, + "slug": "ghapi-test-app-3", + "node_id": "MDM6QXBwODkzNjg=", + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "name": "GHApi Test app 3", + "description": "Test app for checks api testing", + "external_url": "http://localhost", + "html_url": "https://github.com/apps/ghapi-test-app-3", + "created_at": "2020-11-19T14:30:34Z", + "updated_at": "2020-11-19T14:30:34Z", + "permissions": { + "checks": "write", + "metadata": "read" + }, + "events": [] + }, + "pull_requests": [] +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/repos_jglick_github-api-test-1.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/repos_jglick_github-api-test-1.json deleted file mode 100644 index 79eebcc369..0000000000 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/repos_jglick_github-api-test-1.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "id": 95711947, - "node_id": "MDEwOlJlcG9zaXRvcnk5NTcxMTk0Nw==", - "name": "github-api-test", - "full_name": "jglick/github-api-test", - "private": false, - "owner": { - "login": "jglick", - "id": 154109, - "node_id": "MDQ6VXNlcjE1NDEwOQ==", - "avatar_url": "https://avatars1.githubusercontent.com/u/154109?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/jglick", - "html_url": "https://github.com/jglick", - "followers_url": "https://api.github.com/users/jglick/followers", - "following_url": "https://api.github.com/users/jglick/following{/other_user}", - "gists_url": "https://api.github.com/users/jglick/gists{/gist_id}", - "starred_url": "https://api.github.com/users/jglick/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/jglick/subscriptions", - "organizations_url": "https://api.github.com/users/jglick/orgs", - "repos_url": "https://api.github.com/users/jglick/repos", - "events_url": "https://api.github.com/users/jglick/events{/privacy}", - "received_events_url": "https://api.github.com/users/jglick/received_events", - "type": "User", - "site_admin": false - }, - "html_url": "https://github.com/jglick/github-api-test", - "description": "A test repository for testingthe github-api project", - "fork": false, - "url": "https://api.github.com/repos/jglick/github-api-test", - "forks_url": "https://api.github.com/repos/jglick/github-api-test/forks", - "keys_url": "https://api.github.com/repos/jglick/github-api-test/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/jglick/github-api-test/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/jglick/github-api-test/teams", - "hooks_url": "https://api.github.com/repos/jglick/github-api-test/hooks", - "issue_events_url": "https://api.github.com/repos/jglick/github-api-test/issues/events{/number}", - "events_url": "https://api.github.com/repos/jglick/github-api-test/events", - "assignees_url": "https://api.github.com/repos/jglick/github-api-test/assignees{/user}", - "branches_url": "https://api.github.com/repos/jglick/github-api-test/branches{/branch}", - "tags_url": "https://api.github.com/repos/jglick/github-api-test/tags", - "blobs_url": "https://api.github.com/repos/jglick/github-api-test/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/jglick/github-api-test/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/jglick/github-api-test/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/jglick/github-api-test/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/jglick/github-api-test/statuses/{sha}", - "languages_url": "https://api.github.com/repos/jglick/github-api-test/languages", - "stargazers_url": "https://api.github.com/repos/jglick/github-api-test/stargazers", - "contributors_url": "https://api.github.com/repos/jglick/github-api-test/contributors", - "subscribers_url": "https://api.github.com/repos/jglick/github-api-test/subscribers", - "subscription_url": "https://api.github.com/repos/jglick/github-api-test/subscription", - "commits_url": "https://api.github.com/repos/jglick/github-api-test/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/jglick/github-api-test/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/jglick/github-api-test/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/jglick/github-api-test/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/jglick/github-api-test/contents/{+path}", - "compare_url": "https://api.github.com/repos/jglick/github-api-test/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/jglick/github-api-test/merges", - "archive_url": "https://api.github.com/repos/jglick/github-api-test/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/jglick/github-api-test/downloads", - "issues_url": "https://api.github.com/repos/jglick/github-api-test/issues{/number}", - "pulls_url": "https://api.github.com/repos/jglick/github-api-test/pulls{/number}", - "milestones_url": "https://api.github.com/repos/jglick/github-api-test/milestones{/number}", - "notifications_url": "https://api.github.com/repos/jglick/github-api-test/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/jglick/github-api-test/labels{/name}", - "releases_url": "https://api.github.com/repos/jglick/github-api-test/releases{/id}", - "deployments_url": "https://api.github.com/repos/jglick/github-api-test/deployments", - "created_at": "2017-06-28T21:10:35Z", - "updated_at": "2020-03-25T22:26:13Z", - "pushed_at": "2020-03-25T22:26:10Z", - "git_url": "git://github.com/jglick/github-api-test.git", - "ssh_url": "git@github.com:jglick/github-api-test.git", - "clone_url": "https://github.com/jglick/github-api-test.git", - "svn_url": "https://github.com/jglick/github-api-test", - "homepage": "http://github-api.kohsuke.org/", - "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": false, - "push": false, - "pull": false - }, - "temp_clone_token": "", - "network_count": 0, - "subscribers_count": 0 -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/repos_jglick_github-api-test_check-runs-2.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/repos_jglick_github-api-test_check-runs-2.json deleted file mode 100644 index e6eddb59fd..0000000000 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/__files/repos_jglick_github-api-test_check-runs-2.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "id": 546469053, - "node_id": "MDg6Q2hlY2tSdW41NDY0NjkwNTM=", - "head_sha": "4a929d464a2fae7ee899ce603250f7dab304bc4b", - "external_id": "", - "url": "https://api.github.com/repos/jglick/github-api-test/check-runs/546469053", - "html_url": "https://github.com/jglick/github-api-test/runs/546469053", - "details_url": "http://nowhere.net/", - "status": "in_progress", - "conclusion": null, - "started_at": "2020-03-30T18:57:52Z", - "completed_at": null, - "output": { - "title": null, - "summary": null, - "text": null, - "annotations_count": 0, - "annotations_url": "https://api.github.com/repos/jglick/github-api-test/check-runs/546469053/annotations" - }, - "name": "outstanding", - "check_suite": { - "id": 547824747 - }, - "app": { - "id": 58691, - "slug": "jglick-app-test", - "node_id": "MDM6QXBwNTg2OTE=", - "owner": { - "login": "jglick", - "id": 154109, - "node_id": "MDQ6VXNlcjE1NDEwOQ==", - "avatar_url": "https://avatars1.githubusercontent.com/u/154109?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/jglick", - "html_url": "https://github.com/jglick", - "followers_url": "https://api.github.com/users/jglick/followers", - "following_url": "https://api.github.com/users/jglick/following{/other_user}", - "gists_url": "https://api.github.com/users/jglick/gists{/gist_id}", - "starred_url": "https://api.github.com/users/jglick/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/jglick/subscriptions", - "organizations_url": "https://api.github.com/users/jglick/orgs", - "repos_url": "https://api.github.com/users/jglick/repos", - "events_url": "https://api.github.com/users/jglick/events{/privacy}", - "received_events_url": "https://api.github.com/users/jglick/received_events", - "type": "User", - "site_admin": false - }, - "name": "jglick-app-test", - "description": "", - "external_url": "http://nowhere.net/", - "html_url": "https://github.com/apps/jglick-app-test", - "created_at": "2020-03-25T22:13:14Z", - "updated_at": "2020-03-25T22:13:14Z", - "permissions": { - "checks": "write", - "metadata": "read" - }, - "events": [] - }, - "pull_requests": [] -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/app-e7a9b97e-28ab-4ca2-95c1-b1fc01fc4975.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/app-e7a9b97e-28ab-4ca2-95c1-b1fc01fc4975.json new file mode 100644 index 0000000000..860f9ab925 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/app-e7a9b97e-28ab-4ca2-95c1-b1fc01fc4975.json @@ -0,0 +1,41 @@ +{ + "id": "e7a9b97e-28ab-4ca2-95c1-b1fc01fc4975", + "name": "app", + "request": { + "url": "/app", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "app-e7a9b97e-28ab-4ca2-95c1-b1fc01fc4975.json", + "headers": { + "Date": "Thu, 19 Nov 2020 15:00:18 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"174e4dd83df85fc873704d9b9e66883391e4ed80f0c537880e3f48f790fb4e47\"", + "X-GitHub-Media-Type": "github.v3; param=machine-man-preview; format=json", + "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": "FFAB:DF61:1BB748:20ED19:5FB68882" + } + }, + "uuid": "e7a9b97e-28ab-4ca2-95c1-b1fc01fc4975", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/app_installations-6d86aab4-68f2-4e10-9e7a-96c591fb3beb.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/app_installations-6d86aab4-68f2-4e10-9e7a-96c591fb3beb.json new file mode 100644 index 0000000000..881ed38b01 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/app_installations-6d86aab4-68f2-4e10-9e7a-96c591fb3beb.json @@ -0,0 +1,41 @@ +{ + "id": "6d86aab4-68f2-4e10-9e7a-96c591fb3beb", + "name": "app_installations", + "request": { + "url": "/app/installations", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "app_installations-6d86aab4-68f2-4e10-9e7a-96c591fb3beb.json", + "headers": { + "Date": "Thu, 19 Nov 2020 15:00:18 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"e9ffa0e78284d854058825e6267f828446fcd9f96430ce74e40eac816f7e6b19\"", + "X-GitHub-Media-Type": "github.v3; param=machine-man-preview; format=json", + "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": "FFAB:DF61:1BB759:20ED2B:5FB68882" + } + }, + "uuid": "6d86aab4-68f2-4e10-9e7a-96c591fb3beb", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/app_installations_13064215_access_tokens-4bf80b1a-14a2-4466-bfb2-8062c54be1c7.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/app_installations_13064215_access_tokens-4bf80b1a-14a2-4466-bfb2-8062c54be1c7.json new file mode 100644 index 0000000000..f472891e97 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/app_installations_13064215_access_tokens-4bf80b1a-14a2-4466-bfb2-8062c54be1c7.json @@ -0,0 +1,48 @@ +{ + "id": "4bf80b1a-14a2-4466-bfb2-8062c54be1c7", + "name": "app_installations_13064215_access_tokens", + "request": { + "url": "/app/installations/13064215/access_tokens", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "body": "{\"token\":\"v1.dfa6af66e020723e7e935d7e6ed7dac78e453dca\",\"expires_at\":\"2020-11-19T16:00:18Z\",\"permissions\":{\"checks\":\"write\",\"metadata\":\"read\"},\"repository_selection\":\"selected\"}", + "headers": { + "Date": "Thu, 19 Nov 2020 15:00:19 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "\"143eb376b0e8e5d3bcee31d1e16d978ed5752aab433a4e262815cce762e16e0f\"", + "X-GitHub-Media-Type": "github.v3; param=machine-man-preview; format=json", + "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": "FFAB:DF61:1BB763:20ED3A:5FB68882" + } + }, + "uuid": "4bf80b1a-14a2-4466-bfb2-8062c54be1c7", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/repos_hub4j-test-org_test-checks-57003cf3-5da3-415a-b57a-df15cb860c7e.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/repos_hub4j-test-org_test-checks-57003cf3-5da3-415a-b57a-df15cb860c7e.json new file mode 100644 index 0000000000..5014f99e2f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/repos_hub4j-test-org_test-checks-57003cf3-5da3-415a-b57a-df15cb860c7e.json @@ -0,0 +1,46 @@ +{ + "id": "57003cf3-5da3-415a-b57a-df15cb860c7e", + "name": "repos_hub4j-test-org_test-checks", + "request": { + "url": "/repos/hub4j-test-org/test-checks", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_test-checks-57003cf3-5da3-415a-b57a-df15cb860c7e.json", + "headers": { + "Date": "Thu, 19 Nov 2020 15:00:19 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"00996a61cae6679f43d14a34c69380239bc87046b8672321cd20539ffa267a51\"", + "Last-Modified": "Thu, 19 Nov 2020 13:41:50 GMT", + "X-GitHub-Media-Type": "unknown, github.v3", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4841", + "X-RateLimit-Reset": "1605800044", + "X-RateLimit-Used": "159", + "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": "FFAB:DF61:1BB76C:20ED45:5FB68883" + } + }, + "uuid": "57003cf3-5da3-415a-b57a-df15cb860c7e", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/repos_jglick_github-api-test_check-runs-2.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/repos_hub4j-test-org_test-checks_check-runs-37c9b28c-591f-4308-ae1a-ef32349069e4.json similarity index 50% rename from src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/repos_jglick_github-api-test_check-runs-2.json rename to src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/repos_hub4j-test-org_test-checks_check-runs-37c9b28c-591f-4308-ae1a-ef32349069e4.json index 3e1900ca0e..4421f3c82b 100644 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/repos_jglick_github-api-test_check-runs-2.json +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/repos_hub4j-test-org_test-checks_check-runs-37c9b28c-591f-4308-ae1a-ef32349069e4.json @@ -1,8 +1,8 @@ { - "id": "58201935-1587-4494-94ba-7273c91590eb", - "name": "repos_jglick_github-api-test_check-runs", + "id": "37c9b28c-591f-4308-ae1a-ef32349069e4", + "name": "repos_hub4j-test-org_test-checks_check-runs", "request": { - "url": "/repos/jglick/github-api-test/check-runs", + "url": "/repos/hub4j-test-org/test-checks/check-runs", "method": "POST", "headers": { "Accept": { @@ -11,41 +11,43 @@ }, "bodyPatterns": [ { - "equalToJson": "{\"name\":\"outstanding\",\"head_sha\":\"4a929d464a2fae7ee899ce603250f7dab304bc4b\",\"status\":\"in_progress\"}", + "equalToJson": "{\"name\":\"outstanding\",\"head_sha\":\"89a9ae301e35e667756034fdc933b1fc94f63fc1\",\"status\":\"in_progress\"}", "ignoreArrayOrder": true, - "ignoreExtraElements": true + "ignoreExtraElements": false } ] }, "response": { "status": 201, - "bodyFileName": "repos_jglick_github-api-test_check-runs-2.json", + "bodyFileName": "repos_hub4j-test-org_test-checks_check-runs-37c9b28c-591f-4308-ae1a-ef32349069e4.json", "headers": { - "Date": "Mon, 30 Mar 2020 18:57:52 GMT", + "Date": "Thu, 19 Nov 2020 15:00:19 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "201 Created", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4990", - "X-RateLimit-Reset": "1585596209", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding, Accept, X-Requested-With" + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" ], - "ETag": "\"894104cfc37d9a9efa97ca3ae6ab07f8\"", - "Location": "https://api.github.com/repos/jglick/github-api-test/check-runs/546469053", - "X-GitHub-Media-Type": "github.antiope-preview; format=json", + "ETag": "\"0d7a321ba0e3f24dfb0db974ad6bbd7b93ef9166359564c59a6e7459d497b5a6\"", + "Location": "https://api.github.com/repos/hub4j-test-org/test-checks/check-runs/1424883451", + "X-GitHub-Media-Type": "github.v3; param=antiope-preview; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4840", + "X-RateLimit-Reset": "1605800044", + "X-RateLimit-Used": "160", "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": "864E:3230:CC4EF8:1125AA3:5E82412F" + "X-GitHub-Request-Id": "FFAB:DF61:1BB77B:20ED55:5FB68883" } }, - "uuid": "58201935-1587-4494-94ba-7273c91590eb", + "uuid": "37c9b28c-591f-4308-ae1a-ef32349069e4", "persistent": true, - "insertionIndex": 2 + "insertionIndex": 5 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/repos_jglick_github-api-test-1.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/repos_jglick_github-api-test-1.json deleted file mode 100644 index e776146ba9..0000000000 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createPendingCheckRun/mappings/repos_jglick_github-api-test-1.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "id": "c68b6110-412c-483e-84ae-5fbd9a942b3e", - "name": "repos_jglick_github-api-test", - "request": { - "url": "/repos/jglick/github-api-test", - "method": "GET", - "headers": { - "Accept": { - "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" - } - } - }, - "response": { - "status": 200, - "bodyFileName": "repos_jglick_github-api-test-1.json", - "headers": { - "Date": "Mon, 30 Mar 2020 18:57:51 GMT", - "Content-Type": "application/json; charset=utf-8", - "Server": "GitHub.com", - "Status": "200 OK", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4991", - "X-RateLimit-Reset": "1585596209", - "Cache-Control": "private, max-age=60, s-maxage=60", - "Vary": [ - "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding, Accept, X-Requested-With" - ], - "ETag": "W/\"c31ebce1d9b6ef50784ae33967251c4f\"", - "Last-Modified": "Wed, 25 Mar 2020 22:26:13 GMT", - "X-GitHub-Media-Type": "unknown, github.v3", - "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": "864E:3230:CC4EEF:1125A9E:5E82412F" - } - }, - "uuid": "c68b6110-412c-483e-84ae-5fbd9a942b3e", - "persistent": true, - "insertionIndex": 1 -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/__files/app-3c70ad51-1ec8-4f9a-bcb8-7bfb910eddde.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/__files/app-3c70ad51-1ec8-4f9a-bcb8-7bfb910eddde.json new file mode 100644 index 0000000000..afcf6c442e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/__files/app-3c70ad51-1ec8-4f9a-bcb8-7bfb910eddde.json @@ -0,0 +1,37 @@ +{ + "id": 89368, + "slug": "ghapi-test-app-3", + "node_id": "MDM6QXBwODkzNjg=", + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "name": "GHApi Test app 3", + "description": "Test app for checks api testing", + "external_url": "http://localhost", + "html_url": "https://github.com/apps/ghapi-test-app-3", + "created_at": "2020-11-19T14:30:34Z", + "updated_at": "2020-11-19T14:30:34Z", + "permissions": { + "checks": "write", + "metadata": "read" + }, + "events": [], + "installations_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/__files/app_installations-884f6b51-8fe7-4ad0-ad66-153065217ac9.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/__files/app_installations-884f6b51-8fe7-4ad0-ad66-153065217ac9.json new file mode 100644 index 0000000000..f5d238e69a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/__files/app_installations-884f6b51-8fe7-4ad0-ad66-153065217ac9.json @@ -0,0 +1,45 @@ +[ + { + "id": 13064215, + "account": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "repository_selection": "selected", + "access_tokens_url": "https://api.github.com/app/installations/13064215/access_tokens", + "repositories_url": "https://api.github.com/installation/repositories", + "html_url": "https://github.com/organizations/hub4j-test-org/settings/installations/13064215", + "app_id": 89368, + "app_slug": "ghapi-test-app-3", + "target_id": 7544739, + "target_type": "Organization", + "permissions": { + "checks": "write", + "metadata": "read" + }, + "events": [], + "created_at": "2020-11-19T14:33:27.000Z", + "updated_at": "2020-11-19T14:33:27.000Z", + "single_file_name": null, + "has_multiple_single_files": false, + "single_file_paths": [], + "suspended_by": null, + "suspended_at": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/__files/repos_hub4j-test-org_test-checks-332ba146-527b-45e5-bf22-a9e3215f2bb3.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/__files/repos_hub4j-test-org_test-checks-332ba146-527b-45e5-bf22-a9e3215f2bb3.json new file mode 100644 index 0000000000..9180f8d63e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/__files/repos_hub4j-test-org_test-checks-332ba146-527b-45e5-bf22-a9e3215f2bb3.json @@ -0,0 +1,121 @@ +{ + "id": 314259932, + "node_id": "MDEwOlJlcG9zaXRvcnkzMTQyNTk5MzI=", + "name": "test-checks", + "full_name": "hub4j-test-org/test-checks", + "private": true, + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/test-checks", + "description": "Repo for testing the checks API", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/test-checks", + "forks_url": "https://api.github.com/repos/hub4j-test-org/test-checks/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/test-checks/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/test-checks/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/test-checks/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/test-checks/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/test-checks/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/test-checks/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/test-checks/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/test-checks/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/test-checks/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/test-checks/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/test-checks/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/test-checks/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/test-checks/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/test-checks/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/test-checks/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/test-checks/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/test-checks/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/test-checks/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/test-checks/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/test-checks/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/test-checks/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/test-checks/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/test-checks/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/test-checks/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/test-checks/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/test-checks/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/test-checks/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/test-checks/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/test-checks/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/test-checks/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-checks/deployments", + "created_at": "2020-11-19T13:41:45Z", + "updated_at": "2020-11-19T13:41:50Z", + "pushed_at": "2020-11-19T13:41:47Z", + "git_url": "git://github.com/hub4j-test-org/test-checks.git", + "ssh_url": "git@github.com:hub4j-test-org/test-checks.git", + "clone_url": "https://github.com/hub4j-test-org/test-checks.git", + "svn_url": "https://github.com/hub4j-test-org/test-checks", + "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": "main", + "permissions": { + "admin": false, + "push": false, + "pull": false + }, + "organization": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 0, + "subscribers_count": 8 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/__files/repos_hub4j-test-org_test-checks_check-runs-e6a1efc0-842a-4acb-bb97-41992174417f.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/__files/repos_hub4j-test-org_test-checks_check-runs-e6a1efc0-842a-4acb-bb97-41992174417f.json new file mode 100644 index 0000000000..7850419983 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/__files/repos_hub4j-test-org_test-checks_check-runs-e6a1efc0-842a-4acb-bb97-41992174417f.json @@ -0,0 +1,61 @@ +{ + "id": 1424883037, + "node_id": "MDg6Q2hlY2tSdW4xNDI0ODgzMDM3", + "head_sha": "89a9ae301e35e667756034fdc933b1fc94f63fc1", + "external_id": "", + "url": "https://api.github.com/repos/hub4j-test-org/test-checks/check-runs/1424883037", + "html_url": "https://github.com/hub4j-test-org/test-checks/runs/1424883037", + "details_url": "http://localhost", + "status": "in_progress", + "conclusion": null, + "started_at": "1970-01-12T13:46:39Z", + "completed_at": null, + "output": { + "title": "Some Title", + "summary": "what happened…", + "text": null, + "annotations_count": 1, + "annotations_url": "https://api.github.com/repos/hub4j-test-org/test-checks/check-runs/1424883037/annotations" + }, + "name": "foo", + "check_suite": { + "id": 1529145983 + }, + "app": { + "id": 89368, + "slug": "ghapi-test-app-3", + "node_id": "MDM6QXBwODkzNjg=", + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "name": "GHApi Test app 3", + "description": "Test app for checks api testing", + "external_url": "http://localhost", + "html_url": "https://github.com/apps/ghapi-test-app-3", + "created_at": "2020-11-19T14:30:34Z", + "updated_at": "2020-11-19T14:30:34Z", + "permissions": { + "checks": "write", + "metadata": "read" + }, + "events": [] + }, + "pull_requests": [] +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/__files/repos_hub4j-test-org_test-checks_check-runs_1424883037-0e994765-90de-46eb-897a-27ab3d509c28.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/__files/repos_hub4j-test-org_test-checks_check-runs_1424883037-0e994765-90de-46eb-897a-27ab3d509c28.json new file mode 100644 index 0000000000..5c936de7af --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/__files/repos_hub4j-test-org_test-checks_check-runs_1424883037-0e994765-90de-46eb-897a-27ab3d509c28.json @@ -0,0 +1,61 @@ +{ + "id": 1424883037, + "node_id": "MDg6Q2hlY2tSdW4xNDI0ODgzMDM3", + "head_sha": "89a9ae301e35e667756034fdc933b1fc94f63fc1", + "external_id": "", + "url": "https://api.github.com/repos/hub4j-test-org/test-checks/check-runs/1424883037", + "html_url": "https://github.com/hub4j-test-org/test-checks/runs/1424883037", + "details_url": "http://localhost", + "status": "completed", + "conclusion": "success", + "started_at": "1970-01-12T13:46:39Z", + "completed_at": "1970-01-12T13:46:39Z", + "output": { + "title": "Some Title", + "summary": "what happened…", + "text": null, + "annotations_count": 1, + "annotations_url": "https://api.github.com/repos/hub4j-test-org/test-checks/check-runs/1424883037/annotations" + }, + "name": "foo", + "check_suite": { + "id": 1529145983 + }, + "app": { + "id": 89368, + "slug": "ghapi-test-app-3", + "node_id": "MDM6QXBwODkzNjg=", + "owner": { + "login": "hub4j-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/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "name": "GHApi Test app 3", + "description": "Test app for checks api testing", + "external_url": "http://localhost", + "html_url": "https://github.com/apps/ghapi-test-app-3", + "created_at": "2020-11-19T14:30:34Z", + "updated_at": "2020-11-19T14:30:34Z", + "permissions": { + "checks": "write", + "metadata": "read" + }, + "events": [] + }, + "pull_requests": [] +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/app-3c70ad51-1ec8-4f9a-bcb8-7bfb910eddde.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/app-3c70ad51-1ec8-4f9a-bcb8-7bfb910eddde.json new file mode 100644 index 0000000000..bee307293a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/app-3c70ad51-1ec8-4f9a-bcb8-7bfb910eddde.json @@ -0,0 +1,41 @@ +{ + "id": "3c70ad51-1ec8-4f9a-bcb8-7bfb910eddde", + "name": "app", + "request": { + "url": "/app", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "app-3c70ad51-1ec8-4f9a-bcb8-7bfb910eddde.json", + "headers": { + "Date": "Thu, 19 Nov 2020 15:00:14 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"174e4dd83df85fc873704d9b9e66883391e4ed80f0c537880e3f48f790fb4e47\"", + "X-GitHub-Media-Type": "github.v3; param=machine-man-preview; format=json", + "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": "FF88:5CCD:F9FCF:12C703:5FB6887D" + } + }, + "uuid": "3c70ad51-1ec8-4f9a-bcb8-7bfb910eddde", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/app_installations-884f6b51-8fe7-4ad0-ad66-153065217ac9.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/app_installations-884f6b51-8fe7-4ad0-ad66-153065217ac9.json new file mode 100644 index 0000000000..5e97fdf135 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/app_installations-884f6b51-8fe7-4ad0-ad66-153065217ac9.json @@ -0,0 +1,41 @@ +{ + "id": "884f6b51-8fe7-4ad0-ad66-153065217ac9", + "name": "app_installations", + "request": { + "url": "/app/installations", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "app_installations-884f6b51-8fe7-4ad0-ad66-153065217ac9.json", + "headers": { + "Date": "Thu, 19 Nov 2020 15:00:14 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"e9ffa0e78284d854058825e6267f828446fcd9f96430ce74e40eac816f7e6b19\"", + "X-GitHub-Media-Type": "github.v3; param=machine-man-preview; format=json", + "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": "FF88:5CCD:F9FF2:12C712:5FB6887E" + } + }, + "uuid": "884f6b51-8fe7-4ad0-ad66-153065217ac9", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/app_installations_13064215_access_tokens-f8aa5155-92d9-45b2-ab6b-0da7da04aa90.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/app_installations_13064215_access_tokens-f8aa5155-92d9-45b2-ab6b-0da7da04aa90.json new file mode 100644 index 0000000000..07c8671896 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/app_installations_13064215_access_tokens-f8aa5155-92d9-45b2-ab6b-0da7da04aa90.json @@ -0,0 +1,48 @@ +{ + "id": "f8aa5155-92d9-45b2-ab6b-0da7da04aa90", + "name": "app_installations_13064215_access_tokens", + "request": { + "url": "/app/installations/13064215/access_tokens", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "body": "{\"token\":\"v1.863b98cefabd9051b3ed689c292b2b3dfcc2ebda\",\"expires_at\":\"2020-11-19T16:00:14Z\",\"permissions\":{\"checks\":\"write\",\"metadata\":\"read\"},\"repository_selection\":\"selected\"}", + "headers": { + "Date": "Thu, 19 Nov 2020 15:00:14 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "\"8aefacfda57dae4b6767ded5e7a75efe48de7d90e408faf799a553f49e5526b2\"", + "X-GitHub-Media-Type": "github.v3; param=machine-man-preview; format=json", + "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": "FF88:5CCD:F9FFB:12C72E:5FB6887E" + } + }, + "uuid": "f8aa5155-92d9-45b2-ab6b-0da7da04aa90", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/repos_jglick_github-api-test-1.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/repos_hub4j-test-org_test-checks-332ba146-527b-45e5-bf22-a9e3215f2bb3.json similarity index 55% rename from src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/repos_jglick_github-api-test-1.json rename to src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/repos_hub4j-test-org_test-checks-332ba146-527b-45e5-bf22-a9e3215f2bb3.json index e38e05dcbe..9e4476cefe 100644 --- a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/createCheckRunNoAnnotations/mappings/repos_jglick_github-api-test-1.json +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/repos_hub4j-test-org_test-checks-332ba146-527b-45e5-bf22-a9e3215f2bb3.json @@ -1,8 +1,8 @@ { - "id": "4f3b8406-df35-48d3-b1aa-e07863c9f6d5", - "name": "repos_jglick_github-api-test", + "id": "332ba146-527b-45e5-bf22-a9e3215f2bb3", + "name": "repos_hub4j-test-org_test-checks", "request": { - "url": "/repos/jglick/github-api-test", + "url": "/repos/hub4j-test-org/test-checks", "method": "GET", "headers": { "Accept": { @@ -12,33 +12,35 @@ }, "response": { "status": 200, - "bodyFileName": "repos_jglick_github-api-test-1.json", + "bodyFileName": "repos_hub4j-test-org_test-checks-332ba146-527b-45e5-bf22-a9e3215f2bb3.json", "headers": { - "Server": "GitHub.com", - "Date": "Mon, 30 Mar 2020 18:23:33 GMT", + "Date": "Thu, 19 Nov 2020 15:00:15 GMT", "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", "Status": "200 OK", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4993", - "X-RateLimit-Reset": "1585596210", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding, Accept, X-Requested-With" + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" ], - "ETag": "W/\"c31ebce1d9b6ef50784ae33967251c4f\"", - "Last-Modified": "Wed, 25 Mar 2020 22:26:13 GMT", + "ETag": "W/\"d86b3f134228e83d20eeae57dd9fbe037bf3fb0ada3c66f3fd3f2cc459e644ef\"", + "Last-Modified": "Thu, 19 Nov 2020 13:41:50 GMT", "X-GitHub-Media-Type": "unknown, github.v3", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4846", + "X-RateLimit-Reset": "1605800044", + "X-RateLimit-Used": "154", "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": "8560:6DDE:1F4FD3:627151:5E823924" + "X-GitHub-Request-Id": "FF88:5CCD:FA008:12C73D:5FB6887E" } }, - "uuid": "4f3b8406-df35-48d3-b1aa-e07863c9f6d5", + "uuid": "332ba146-527b-45e5-bf22-a9e3215f2bb3", "persistent": true, - "insertionIndex": 1 + "insertionIndex": 4 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/repos_hub4j-test-org_test-checks_check-runs-e6a1efc0-842a-4acb-bb97-41992174417f.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/repos_hub4j-test-org_test-checks_check-runs-e6a1efc0-842a-4acb-bb97-41992174417f.json new file mode 100644 index 0000000000..20d70f9834 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/repos_hub4j-test-org_test-checks_check-runs-e6a1efc0-842a-4acb-bb97-41992174417f.json @@ -0,0 +1,53 @@ +{ + "id": "e6a1efc0-842a-4acb-bb97-41992174417f", + "name": "repos_hub4j-test-org_test-checks_check-runs", + "request": { + "url": "/repos/hub4j-test-org/test-checks/check-runs", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.antiope-preview+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"output\":{\"title\":\"Some Title\",\"summary\":\"what happened…\",\"annotations\":[{\"path\":\"stuff.txt\",\"start_line\":1,\"end_line\":1,\"annotation_level\":\"notice\",\"message\":\"hello to you too\",\"title\":\"Look here\"}]},\"name\":\"foo\",\"started_at\":\"1970-01-12T13:46:39Z\",\"head_sha\":\"89a9ae301e35e667756034fdc933b1fc94f63fc1\",\"status\":\"in_progress\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_hub4j-test-org_test-checks_check-runs-e6a1efc0-842a-4acb-bb97-41992174417f.json", + "headers": { + "Date": "Thu, 19 Nov 2020 15:00:15 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "201 Created", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "\"e515857f9f590a0d2a3f5873ed6ba191f8058e09f22b3f90c7326aa9bf5da940\"", + "Location": "https://api.github.com/repos/hub4j-test-org/test-checks/check-runs/1424883037", + "X-GitHub-Media-Type": "github.v3; param=antiope-preview; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4845", + "X-RateLimit-Reset": "1605800044", + "X-RateLimit-Used": "155", + "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": "FF88:5CCD:FA010:12C749:5FB6887F" + } + }, + "uuid": "e6a1efc0-842a-4acb-bb97-41992174417f", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/repos_hub4j-test-org_test-checks_check-runs_1424883037-0e994765-90de-46eb-897a-27ab3d509c28.json b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/repos_hub4j-test-org_test-checks_check-runs_1424883037-0e994765-90de-46eb-897a-27ab3d509c28.json new file mode 100644 index 0000000000..2a5858ad97 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCheckRunBuilderTest/wiremock/updateCheckRun/mappings/repos_hub4j-test-org_test-checks_check-runs_1424883037-0e994765-90de-46eb-897a-27ab3d509c28.json @@ -0,0 +1,52 @@ +{ + "id": "0e994765-90de-46eb-897a-27ab3d509c28", + "name": "repos_hub4j-test-org_test-checks_check-runs_1424883037", + "request": { + "url": "/repos/hub4j-test-org/test-checks/check-runs/1424883037", + "method": "PATCH", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.antiope-preview+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"conclusion\":\"success\",\"completed_at\":\"1970-01-12T13:46:39Z\",\"status\":\"completed\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_test-checks_check-runs_1424883037-0e994765-90de-46eb-897a-27ab3d509c28.json", + "headers": { + "Date": "Thu, 19 Nov 2020 15:00:16 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With", + "Accept-Encoding" + ], + "ETag": "W/\"cc3761505c9689d9473d068a806ab77bd725a5a92ec88e74a826f56f38d129d8\"", + "X-GitHub-Media-Type": "github.v3; param=antiope-preview; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4844", + "X-RateLimit-Reset": "1605800044", + "X-RateLimit-Used": "156", + "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": "FF88:5CCD:FA018:12C753:5FB6887F" + } + }, + "uuid": "0e994765-90de-46eb-897a-27ab3d509c28", + "persistent": true, + "insertionIndex": 6 +} \ No newline at end of file From 77baafa6435c0af2b89bdf404035f405e6ba2e77 Mon Sep 17 00:00:00 2001 From: Bill Collins Date: Fri, 20 Nov 2020 09:16:34 +0000 Subject: [PATCH 4/4] Add method for updating check run by ID --- src/main/java/org/kohsuke/github/GHRepository.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index 8fd467e7e2..7273dde484 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -1958,6 +1958,19 @@ public GHCommitStatus createCommitStatus(String sha1, GHCommitState state, Strin return new GHCheckRunBuilder(this, name, headSHA); } + /** + * Updates an existing check run. + * + * @param checkId + * the existing checkId + * @return a builder which you should customize, then call {@link GHCheckRunBuilder#create} + */ + @Preview + @Deprecated + public @NonNull GHCheckRunBuilder updateCheckRun(long checkId) { + return new GHCheckRunBuilder(this, checkId); + } + /** * Lists repository events. *