diff --git a/src/main/java/org/kohsuke/github/AbstractBuilder.java b/src/main/java/org/kohsuke/github/AbstractBuilder.java new file mode 100644 index 0000000000..f78e72633b --- /dev/null +++ b/src/main/java/org/kohsuke/github/AbstractBuilder.java @@ -0,0 +1,165 @@ +package org.kohsuke.github; + +import java.io.IOException; + +import javax.annotation.CheckForNull; +import javax.annotation.Nonnull; + +/** + * An abstract data object builder/updater. + * + * This class can be use to make a Builder that supports both batch and single property changes. + *

+ * Batching looks like this: + * + *

+ * update().someName(value).otherName(value).done()
+ * 
+ *

+ *

+ * Single changes look like this: + * + *

+ * set().someName(value);
+ * set().otherName(value);
+ * 
+ *

+ *

+ * If {@link S} is the same as {@link R}, {@link #with(String, Object)} will commit changes after the first value change + * and return a {@link R} from {@link #done()}. + *

+ *

+ * If {@link S} is not the same as {@link R}, {@link #with(String, Object)} will batch together multiple changes and let + * the user call {@link #done()} when they are ready. + * + * @param + * Final return type built by this builder returned when {@link #done()}} is called. + * @param + * Intermediate return type for this builder returned by calls to {@link #with(String, Object)}. If {@link S} + * the same as {@link R}, this builder will commit changes after each call to {@link #with(String, Object)}. + */ +abstract class AbstractBuilder { + + @Nonnull + private final Class returnType; + + private final boolean commitChangesImmediately; + + @CheckForNull + private final R baseInstance; + + @Nonnull + protected final Requester requester; + + // TODO: Not sure how update-in-place behavior should be controlled + // However, it certainly can be controlled dynamically down to the instance level or inherited for all children of + // some + // connection. + protected boolean updateInPlace; + + /** + * Creates a builder. + * + * @param root + * the GitHub instance to connect to. + * @param intermediateReturnType + * the intermediate return type of type {@link S} returned by calls to {@link #with(String, Object)}. + * Must either be equal to {@code builtReturnType} or this instance must be castable to this class. If + * not, the constructor will throw {@link IllegalArgumentException}. + * @param finalReturnType + * the final return type for built by this builder returned when {@link #done()}} is called. + * @param baseInstance + * optional instance on which to base this builder. + */ + protected AbstractBuilder(@Nonnull Class finalReturnType, + @Nonnull Class intermediateReturnType, + @Nonnull GitHub root, + @CheckForNull R baseInstance) { + this.requester = root.createRequest(); + this.returnType = finalReturnType; + this.commitChangesImmediately = returnType.equals(intermediateReturnType); + if (!commitChangesImmediately && !intermediateReturnType.isInstance(this)) { + throw new IllegalArgumentException( + "Argument \"intermediateReturnType\": This instance must be castable to intermediateReturnType or finalReturnType must be equal to intermediateReturnType."); + } + + this.baseInstance = baseInstance; + this.updateInPlace = false; + } + + /** + * Finishes an update, committing changes. + * + * This method may update-in-place or not. Either way it returns the resulting instance. + * + * @return an instance with updated current data + * @throws IOException + * if there is an I/O Exception + */ + @Nonnull + @Preview + @Deprecated + public R done() throws IOException { + R result; + if (updateInPlace && baseInstance != null) { + result = requester.fetchInto(baseInstance); + } else { + result = requester.fetch(returnType); + } + return result; + } + + /** + * Applies a value to a name for this builder. + * + * If {@link S} is the same as {@link R}, this method will commit changes after the first value change and return a + * {@link R} from {@link #done()}. + * + * If {@link S} is not the same as {@link R}, this method will return an {@link S} and letting the caller batch + * together multiple changes and call {@link #done()} when they are ready. + * + * @param name + * the name of the field + * @param value + * the value of the field + * @return either a continuing builder or an updated data record + * @throws IOException + * if an I/O error occurs + */ + @Nonnull + @Preview + @Deprecated + protected S with(@Nonnull String name, Object value) throws IOException { + requester.with(name, value); + return continueOrDone(); + } + + /** + * Chooses whether to return a continuing builder or an updated data record + * + * If {@link S} is the same as {@link R}, this method will commit changes after the first value change and return a + * {@link R} from {@link #done()}. + * + * If {@link S} is not the same as {@link R}, this method will return an {@link S} and letting the caller batch + * together multiple changes and call {@link #done()} when they are ready. + * + * @return either a continuing builder or an updated data record + * @throws IOException + * if an I/O error occurs + */ + @Nonnull + @Preview + @Deprecated + protected S continueOrDone() throws IOException { + // This little bit of roughness in this base class means all inheriting builders get to create Updater and + // Setter classes from almost identical code. Creator can often be implemented with significant code reuse as + // well. + if (commitChangesImmediately) { + // These casts look strange and risky, but they they're actually guaranteed safe due to the return path + // being based on the previous comparison of class instances passed to the constructor. + return (S) done(); + } else { + return (S) this; + } + } +} diff --git a/src/main/java/org/kohsuke/github/GHLabel.java b/src/main/java/org/kohsuke/github/GHLabel.java index 8fdd0d7d6f..4bf573498f 100644 --- a/src/main/java/org/kohsuke/github/GHLabel.java +++ b/src/main/java/org/kohsuke/github/GHLabel.java @@ -1,27 +1,56 @@ package org.kohsuke.github; +import com.fasterxml.jackson.annotation.JacksonInject; +import com.fasterxml.jackson.annotation.JsonCreator; + import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Objects; +import javax.annotation.CheckForNull; +import javax.annotation.Nonnull; + /** * The type GHLabel. * * @author Kohsuke Kawaguchi + * @see Labels * @see GHIssue#getLabels() GHIssue#getLabels() * @see GHRepository#listLabels() GHRepository#listLabels() */ public class GHLabel { - private String url, name, color, description; - private GHRepository repo; + + @Nonnull + private String url, name, color; + + @CheckForNull + private String description; + + @Nonnull + private final GitHub root; + + @JsonCreator + private GHLabel(@JacksonInject @Nonnull GitHub root) { + this.root = root; + url = ""; + name = ""; + color = ""; + description = null; + } + + @Nonnull + GitHub getApiRoot() { + return Objects.requireNonNull(root); + } /** * Gets url. * * @return the url */ + @Nonnull public String getUrl() { return url; } @@ -31,6 +60,7 @@ public String getUrl() { * * @return the name */ + @Nonnull public String getName() { return name; } @@ -40,6 +70,7 @@ public String getName() { * * @return the color */ + @Nonnull public String getColor() { return color; } @@ -49,25 +80,11 @@ public String getColor() { * * @return the description */ + @CheckForNull public String getDescription() { return description; } - GHLabel wrapUp(GHRepository repo) { - this.repo = repo; - return this; - } - - /** - * Delete. - * - * @throws IOException - * the io exception - */ - public void delete() throws IOException { - repo.root.createRequest().method("DELETE").setRawUrlPath(url).send(); - } - /** * Sets color. * @@ -75,15 +92,11 @@ public void delete() throws IOException { * 6-letter hex color code, like "f29513" * @throws IOException * the io exception + * @deprecated use {@link #set()} or {@link #update()} instead */ + @Deprecated public void setColor(String newColor) throws IOException { - repo.root.createRequest() - .method("PATCH") - .with("name", name) - .with("color", newColor) - .with("description", description) - .setRawUrlPath(url) - .send(); + set().color(newColor); } /** @@ -93,25 +106,106 @@ public void setColor(String newColor) throws IOException { * Description of label * @throws IOException * the io exception + * @deprecated use {@link #set()} or {@link #update()} instead */ + @Deprecated public void setDescription(String newDescription) throws IOException { - repo.root.createRequest() - .method("PATCH") - .with("name", name) - .with("color", color) - .with("description", newDescription) - .setRawUrlPath(url) - .send(); + set().description(newDescription); } static Collection toNames(Collection labels) { - List r = new ArrayList(); + List r = new ArrayList<>(); for (GHLabel l : labels) { r.add(l.getName()); } return r; } + /** + * Begins the creation of a new instance. + * + * Consumer must call {@link Creator#done()} to commit changes. + * + * @param repository + * the repository in which the label will be created. + * @return a {@link Creator} + * @throws IOException + * the io exception + */ + @Preview + @Deprecated + static Creator create(GHRepository repository) throws IOException { + return new Creator(repository); + } + + /** + * Reads a label from a repository. + * + * @param repository + * the repository to read from + * @param name + * the name of the label + * @return a label + * @throws IOException + * the io exception + */ + static GHLabel read(@Nonnull GHRepository repository, @Nonnull String name) throws IOException { + return repository.root.createRequest() + .withUrlPath(repository.getApiTailUrl("labels"), name) + .fetch(GHLabel.class); + + } + + /** + * Reads all labels from a repository. + * + * @param repository + * the repository to read from + * @return iterable of all labels + * @throws IOException + * the io exception + */ + static PagedIterable readAll(@Nonnull final GHRepository repository) throws IOException { + return repository.root.createRequest() + .withUrlPath(repository.getApiTailUrl("labels")) + .toIterable(GHLabel[].class, null); + + } + + /** + * Begins a batch update + * + * Consumer must call {@link Updater#done()} to commit changes. + * + * @return a {@link Updater} + */ + @Preview + @Deprecated + public Updater update() { + return new Updater(this); + } + + /** + * Begins a single property update. + * + * @return a {@link Setter} + */ + @Preview + @Deprecated + public Setter set() { + return new Setter(this); + } + + /** + * Delete this label from the repository. + * + * @throws IOException + * the io exception + */ + public void delete() throws IOException { + root.createRequest().method("DELETE").setRawUrlPath(getUrl()).send(); + } + @Override public boolean equals(final Object o) { if (this == o) @@ -120,11 +214,54 @@ public boolean equals(final Object o) { return false; final GHLabel ghLabel = (GHLabel) o; return Objects.equals(url, ghLabel.url) && Objects.equals(name, ghLabel.name) - && Objects.equals(color, ghLabel.color) && Objects.equals(repo, ghLabel.repo); + && Objects.equals(color, ghLabel.color) && Objects.equals(description, ghLabel.description); } @Override public int hashCode() { - return Objects.hash(url, name, color, repo); + return Objects.hash(url, name, color, description); + } + + /** + * A {@link GHLabelBuilder} that updates a single property per request + * + * {@link #done()} is called automatically after the property is set. + */ + @Preview + @Deprecated + public static class Setter extends GHLabelBuilder { + private Setter(@Nonnull GHLabel base) { + super(GHLabel.class, base.getApiRoot(), base); + requester.method("PATCH").setRawUrlPath(base.getUrl()); + } + } + + /** + * A {@link GHLabelBuilder} that allows multiple properties to be updated per request. + * + * Consumer must call {@link #done()} to commit changes. + */ + @Preview + @Deprecated + public static class Updater extends GHLabelBuilder { + private Updater(@Nonnull GHLabel base) { + super(Updater.class, base.getApiRoot(), base); + requester.method("PATCH").setRawUrlPath(base.getUrl()); + } + } + + /** + * A {@link GHLabelBuilder} that creates a new {@link GHLabel} + * + * Consumer must call {@link #done()} to create the new instance. + */ + @Preview + @Deprecated + public static class Creator extends GHLabelBuilder { + private Creator(@Nonnull GHRepository repository) { + super(Creator.class, repository.root, null); + requester.method("POST").withUrlPath(repository.getApiTailUrl("labels")); + } } + } diff --git a/src/main/java/org/kohsuke/github/GHLabelBuilder.java b/src/main/java/org/kohsuke/github/GHLabelBuilder.java new file mode 100644 index 0000000000..dabdb6ccd2 --- /dev/null +++ b/src/main/java/org/kohsuke/github/GHLabelBuilder.java @@ -0,0 +1,60 @@ +package org.kohsuke.github; + +import java.io.IOException; + +import javax.annotation.CheckForNull; +import javax.annotation.Nonnull; + +/** + * + * @param + * Intermediate return type for this builder returned by calls to {@link #with(String, Object)}. If {@link S} + * the same as {@link GHLabel}, this builder will commit changes after each call to + * {@link #with(String, Object)}. + */ +class GHLabelBuilder extends AbstractBuilder { + + /** + * + * @param intermediateReturnType + * Intermediate return type for this builder returned by calls to {@link #with(String, Object)}. If + * {@link S} the same as {@link GHLabel}, this builder will commit changes after each call to + * {@link #with(String, Object)}. + * @param root + * the GitHub instance to which updates will be sent + * @param baseInstance + * instance on which to base this builder. If {@code null} a new instance will be created. + */ + protected GHLabelBuilder(@Nonnull Class intermediateReturnType, + @Nonnull GitHub root, + @CheckForNull GHLabel baseInstance) { + super(GHLabel.class, intermediateReturnType, root, baseInstance); + + if (baseInstance != null) { + requester.with("name", baseInstance.getName()); + requester.with("color", baseInstance.getColor()); + requester.with("description", baseInstance.getDescription()); + } + } + + @Nonnull + @Preview + @Deprecated + public S name(String value) throws IOException { + return with("name", value); + } + + @Nonnull + @Preview + @Deprecated + public S color(String value) throws IOException { + return with("color", value); + } + + @Nonnull + @Preview + @Deprecated + public S description(String value) throws IOException { + return with("description", value); + } +} diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index 24349f03f7..5ed437af3a 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -1872,9 +1872,7 @@ public PagedIterable listEvents() throws IOException { * the io exception */ public PagedIterable listLabels() throws IOException { - return root.createRequest() - .withUrlPath(getApiTailUrl("labels")) - .toIterable(GHLabel[].class, item -> item.wrapUp(this)); + return GHLabel.readAll(this); } /** @@ -1887,7 +1885,7 @@ public PagedIterable listLabels() throws IOException { * the io exception */ public GHLabel getLabel(String name) throws IOException { - return root.createRequest().withUrlPath(getApiTailUrl("labels/" + name)).fetch(GHLabel.class).wrapUp(this); + return GHLabel.read(this, name); } /** @@ -1902,7 +1900,7 @@ public GHLabel getLabel(String name) throws IOException { * the io exception */ public GHLabel createLabel(String name, String color) throws IOException { - return createLabel(name, color, ""); + return GHLabel.create(this).name(name).color(color).description("").done(); } /** @@ -1919,14 +1917,7 @@ public GHLabel createLabel(String name, String color) throws IOException { * the io exception */ public GHLabel createLabel(String name, String color, String description) throws IOException { - return root.createRequest() - .method("POST") - .with("name", name) - .with("color", color) - .with("description", description) - .withUrlPath(getApiTailUrl("labels")) - .fetch(GHLabel.class) - .wrapUp(this); + return GHLabel.create(this).name(name).color(color).description(description).done(); } /** diff --git a/src/test/java/org/kohsuke/github/AppTest.java b/src/test/java/org/kohsuke/github/AppTest.java index 5041b4f6b7..e61ef30331 100755 --- a/src/test/java/org/kohsuke/github/AppTest.java +++ b/src/test/java/org/kohsuke/github/AppTest.java @@ -10,6 +10,7 @@ import org.kohsuke.github.GHCommit.File; import org.kohsuke.github.GHOrganization.Permission; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.net.URL; @@ -793,7 +794,7 @@ public void testRepoLabel() throws IOException { GHRepository r = gitHub.getRepository("github-api-test-org/test-labels"); List lst = r.listLabels().toList(); for (GHLabel l : lst) { - // System.out.println(l.getName()); + assertThat(l.getUrl(), containsString(l.getName().replace(" ", "%20"))); } assertTrue(lst.size() > 5); GHLabel e = r.getLabel("enhancement"); @@ -803,9 +804,13 @@ public void testRepoLabel() throws IOException { GHLabel t = null; GHLabel t2 = null; + GHLabel t3 = null; try {// CRUD t = r.createLabel("test", "123456"); t2 = r.getLabel("test"); + assertThat(t, not(sameInstance(t2))); + assertThat(t, equalTo(t2)); + assertEquals(t.getName(), t2.getName()); assertEquals(t.getColor(), "123456"); assertEquals(t.getColor(), t2.getColor()); @@ -813,28 +818,69 @@ public void testRepoLabel() throws IOException { assertEquals(t.getDescription(), t2.getDescription()); assertEquals(t.getUrl(), t2.getUrl()); - t.setColor("000000"); + // update works on multiple changes in one call + t3 = t.update().color("000000").description("It is dark!").done(); + + // instances behave as immutable by default. Update returns a new updated instance. + assertThat(t, not(sameInstance(t2))); + assertThat(t, equalTo(t2)); + + assertThat(t, not(sameInstance(t3))); + assertThat(t, not(equalTo(t3))); + + assertEquals(t.getColor(), "123456"); + assertEquals(t.getDescription(), ""); + assertEquals(t3.getColor(), "000000"); + assertEquals(t3.getDescription(), "It is dark!"); + + // Test deprecated methods + t.setDescription("Deprecated"); + t = r.getLabel("test"); - // This is annoying behavior, but it is by design at this time. - // Verifying so we can know when it is fixed. + // By using the old instance t when calling setDescription it also sets color to the old value + // this is a bad behavior, but it is expected assertEquals(t.getColor(), "123456"); + assertEquals(t.getDescription(), "Deprecated"); + t.setColor("000000"); t = r.getLabel("test"); - t.setDescription("this is also a test"); + assertEquals(t.getColor(), "000000"); + assertEquals(t.getDescription(), "Deprecated"); + + // set() makes a single change + t3 = t.set().description("this is also a test"); + + // instances behave as immutable by default. Update returns a new updated instance. + assertThat(t, not(sameInstance(t3))); + assertThat(t, not(equalTo(t3))); - GHLabel t3 = r.getLabel("test"); assertEquals(t3.getColor(), "000000"); assertEquals(t3.getDescription(), "this is also a test"); + t.delete(); + try { + t = r.getLabel("test"); + fail("Test label should be deleted."); + } catch (IOException ex) { + assertThat(ex, instanceOf(FileNotFoundException.class)); + } t = r.createLabel("test2", "123457", "this is a different test"); t2 = r.getLabel("test2"); + assertEquals(t.getName(), t2.getName()); assertEquals(t.getColor(), "123457"); assertEquals(t.getColor(), t2.getColor()); assertEquals(t.getDescription(), "this is a different test"); assertEquals(t.getDescription(), t2.getDescription()); assertEquals(t.getUrl(), t2.getUrl()); + t.delete(); + + // Allow null description + t = GHLabel.create(r).name("test2").color("123458").done(); + assertThat(t.getName(), equalTo("test2")); + assertThat(t.getDescription(), is(nullValue())); + } finally { cleanupLabel("test"); cleanupLabel("test2"); @@ -844,7 +890,7 @@ public void testRepoLabel() throws IOException { void cleanupLabel(String name) { if (mockGitHub.isUseProxy()) { try { - GHLabel t = getGitHubBeforeAfter().getRepository("github-api-test-org/test-labels").getLabel("test"); + GHLabel t = getGitHubBeforeAfter().getRepository("github-api-test-org/test-labels").getLabel(name); t.delete(); } catch (IOException e) { diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/__files/repos_github-api-test-org_test-labels-fbcd5a5d-47a7-4817-bd69-cfe1afa2cdbd.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/__files/repos_github-api-test-org_test-labels-47685ef9-9d9a-4e96-945b-b58a75e9807f.json similarity index 98% rename from src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/__files/repos_github-api-test-org_test-labels-fbcd5a5d-47a7-4817-bd69-cfe1afa2cdbd.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/__files/repos_github-api-test-org_test-labels-47685ef9-9d9a-4e96-945b-b58a75e9807f.json index 9cd54d11ef..491295ca14 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/__files/repos_github-api-test-org_test-labels-fbcd5a5d-47a7-4817-bd69-cfe1afa2cdbd.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/__files/repos_github-api-test-org_test-labels-47685ef9-9d9a-4e96-945b-b58a75e9807f.json @@ -96,9 +96,11 @@ "push": true, "pull": true }, + "temp_clone_token": "", "allow_squash_merge": true, "allow_merge_commit": true, "allow_rebase_merge": true, + "delete_branch_on_merge": false, "organization": { "login": "github-api-test-org", "id": 7544739, @@ -120,5 +122,5 @@ "site_admin": false }, "network_count": 0, - "subscribers_count": 2 + "subscribers_count": 1 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/__files/repos_github-api-test-org_test-labels_labels-82e6433c-0947-48bc-a15a-398eefcc3280.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/__files/repos_github-api-test-org_test-labels_labels-28c58b29-a050-4a83-b08e-bf202cff89a9.json similarity index 100% rename from src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/__files/repos_github-api-test-org_test-labels_labels-82e6433c-0947-48bc-a15a-398eefcc3280.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/__files/repos_github-api-test-org_test-labels_labels-28c58b29-a050-4a83-b08e-bf202cff89a9.json diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/__files/user-05a1d265-edf9-4570-b398-a3eb7d3396e1.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/__files/user-a78a0f34-4527-48ba-88f8-16c319430bc6.json similarity index 90% rename from src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/__files/user-05a1d265-edf9-4570-b398-a3eb7d3396e1.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/__files/user-a78a0f34-4527-48ba-88f8-16c319430bc6.json index 41fc9e3d00..05a796f5ba 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/__files/user-05a1d265-edf9-4570-b398-a3eb7d3396e1.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/__files/user-a78a0f34-4527-48ba-88f8-16c319430bc6.json @@ -24,14 +24,14 @@ "email": "bitwiseman@gmail.com", "hireable": null, "bio": "https://twitter.com/bitwiseman", - "public_repos": 168, - "public_gists": 4, - "followers": 136, + "public_repos": 181, + "public_gists": 7, + "followers": 150, "following": 9, "created_at": "2012-07-11T20:38:33Z", - "updated_at": "2019-09-24T19:32:29Z", - "private_gists": 7, - "total_private_repos": 9, + "updated_at": "2020-03-19T19:17:12Z", + "private_gists": 8, + "total_private_repos": 10, "owned_private_repos": 0, "disk_usage": 33697, "collaborators": 0, diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels-2-fbcd5a.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels-2-47685e.json similarity index 63% rename from src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels-2-fbcd5a.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels-2-47685e.json index dccc4ebeaf..a159930cff 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels-2-fbcd5a.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels-2-47685e.json @@ -1,5 +1,5 @@ { - "id": "fbcd5a5d-47a7-4817-bd69-cfe1afa2cdbd", + "id": "47685ef9-9d9a-4e96-945b-b58a75e9807f", "name": "repos_github-api-test-org_test-labels", "request": { "url": "/repos/github-api-test-org/test-labels", @@ -12,37 +12,35 @@ }, "response": { "status": 200, - "bodyFileName": "repos_github-api-test-org_test-labels-fbcd5a5d-47a7-4817-bd69-cfe1afa2cdbd.json", + "bodyFileName": "repos_github-api-test-org_test-labels-47685ef9-9d9a-4e96-945b-b58a75e9807f.json", "headers": { - "Date": "Sat, 05 Oct 2019 05:21:22 GMT", - "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", + "Date": "Tue, 24 Mar 2020 19:31:26 GMT", + "Content-Type": "application/json; charset=utf-8", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4838", - "X-RateLimit-Reset": "1570253246", + "X-RateLimit-Remaining": "4987", + "X-RateLimit-Reset": "1585080825", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"de5493a4e3cf3def2774a62ae9c04ee2\"", + "ETag": "W/\"6b3e989ed9af12ce6cd75038c1664ab5\"", "Last-Modified": "Sun, 15 Feb 2015 14:49:09 GMT", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "repo", "X-GitHub-Media-Type": "unknown, github.v3", - "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", - "Access-Control-Allow-Origin": "*", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", "X-Frame-Options": "deny", "X-Content-Type-Options": "nosniff", "X-XSS-Protection": "1; mode=block", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "FC58:3C9A:4B940C:5AAD9C:5D982851" + "X-GitHub-Request-Id": "C6C5:5608:1232FC:1FE7E8:5E7A600D" } }, - "uuid": "fbcd5a5d-47a7-4817-bd69-cfe1afa2cdbd", + "uuid": "47685ef9-9d9a-4e96-945b-b58a75e9807f", "persistent": true, "insertionIndex": 2 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-12-b2265f.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-15-6c2ac6.json similarity index 67% rename from src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-12-b2265f.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-15-6c2ac6.json index 363814335d..47e1258536 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-12-b2265f.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-15-6c2ac6.json @@ -1,54 +1,53 @@ { - "id": "b2265f8b-180e-4664-b476-c9f195f07b5d", + "id": "6c2ac6d2-3f11-4386-bb61-17ff5f183285", "name": "repos_github-api-test-org_test-labels_labels", "request": { "url": "/repos/github-api-test-org/test-labels/labels", "method": "POST", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, "bodyPatterns": [ { "equalToJson": "{\"color\":\"123457\",\"name\":\"test2\",\"description\":\"this is a different test\"}", "ignoreArrayOrder": true, "ignoreExtraElements": true } - ], - "headers": { - "Accept": { - "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" - } - } + ] }, "response": { "status": 201, - "body": "{\"id\":1596524813,\"node_id\":\"MDU6TGFiZWwxNTk2NTI0ODEz\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/test2\",\"name\":\"test2\",\"color\":\"123457\",\"default\":false,\"description\":\"this is a different test\"}", + "body": "{\"id\":1932142041,\"node_id\":\"MDU6TGFiZWwxOTMyMTQyMDQx\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/test2\",\"name\":\"test2\",\"color\":\"123457\",\"default\":false,\"description\":\"this is a different test\"}", "headers": { - "Date": "Sat, 05 Oct 2019 05:21:24 GMT", - "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", + "Date": "Tue, 24 Mar 2020 19:31:29 GMT", + "Content-Type": "application/json; charset=utf-8", "Status": "201 Created", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4828", - "X-RateLimit-Reset": "1570253246", + "X-RateLimit-Remaining": "4974", + "X-RateLimit-Reset": "1585080825", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "\"cb7056d812cb1ca0296b75f5e48b462d\"", + "ETag": "\"c3c0744906ceb4103444a9bf92a50cd0\"", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "", "Location": "https://api.github.com/repos/github-api-test-org/test-labels/labels/test2", - "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", - "Access-Control-Allow-Origin": "*", + "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": "FC58:3C9A:4B942E:5AADD4:5D982854" + "X-GitHub-Request-Id": "C6C5:5608:123443:1FEB34:5E7A6011" } }, - "uuid": "b2265f8b-180e-4664-b476-c9f195f07b5d", + "uuid": "6c2ac6d2-3f11-4386-bb61-17ff5f183285", "persistent": true, - "insertionIndex": 12 + "insertionIndex": 15 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-18-b1cf4b.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-18-b1cf4b.json new file mode 100644 index 0000000000..3bc13f1e1f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-18-b1cf4b.json @@ -0,0 +1,53 @@ +{ + "id": "b1cf4bdd-f563-4831-8d5d-057fbee3ac86", + "name": "repos_github-api-test-org_test-labels_labels", + "request": { + "url": "/repos/github-api-test-org/test-labels/labels", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"color\":\"123458\",\"name\":\"test2\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "body": "{\"id\":1932142052,\"node_id\":\"MDU6TGFiZWwxOTMyMTQyMDUy\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/test2\",\"name\":\"test2\",\"color\":\"123458\",\"default\":false,\"description\":null}", + "headers": { + "Server": "GitHub.com", + "Date": "Tue, 24 Mar 2020 19:31:30 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "201 Created", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4971", + "X-RateLimit-Reset": "1585080826", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"32b583a258d93b9d778a1e45ae9b163a\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "Location": "https://api.github.com/repos/github-api-test-org/test-labels/labels/test2", + "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": "C6C5:5608:12349A:1FEBBA:5E7A6012" + } + }, + "uuid": "b1cf4bdd-f563-4831-8d5d-057fbee3ac86", + "persistent": true, + "insertionIndex": 18 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-3-82e643.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-3-28c58b.json similarity index 64% rename from src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-3-82e643.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-3-28c58b.json index 101046d057..9d464b7f51 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-3-82e643.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-3-28c58b.json @@ -1,5 +1,5 @@ { - "id": "82e6433c-0947-48bc-a15a-398eefcc3280", + "id": "28c58b29-a050-4a83-b08e-bf202cff89a9", "name": "repos_github-api-test-org_test-labels_labels", "request": { "url": "/repos/github-api-test-org/test-labels/labels", @@ -12,35 +12,34 @@ }, "response": { "status": 200, - "bodyFileName": "repos_github-api-test-org_test-labels_labels-82e6433c-0947-48bc-a15a-398eefcc3280.json", + "bodyFileName": "repos_github-api-test-org_test-labels_labels-28c58b29-a050-4a83-b08e-bf202cff89a9.json", "headers": { - "Date": "Sat, 05 Oct 2019 05:21:22 GMT", - "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", + "Date": "Tue, 24 Mar 2020 19:31:26 GMT", + "Content-Type": "application/json; charset=utf-8", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4837", - "X-RateLimit-Reset": "1570253246", + "X-RateLimit-Remaining": "4986", + "X-RateLimit-Reset": "1585080825", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"70c6bea1b42c9775915fdf6e8279aa26\"", + "ETag": "W/\"e7c4fba8fbd1312b7b8bc4cac1dfbc25\"", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "repo", - "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", - "Access-Control-Allow-Origin": "*", + "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": "FC58:3C9A:4B940E:5AADB0:5D982852" + "X-GitHub-Request-Id": "C6C5:5608:12330F:1FE940:5E7A600E" } }, - "uuid": "82e6433c-0947-48bc-a15a-398eefcc3280", + "uuid": "28c58b29-a050-4a83-b08e-bf202cff89a9", "persistent": true, "insertionIndex": 3 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-5-ce07a3.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-5-154147.json similarity index 67% rename from src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-5-ce07a3.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-5-154147.json index fc7b11e4b7..366ec7772c 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-5-ce07a3.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels-5-154147.json @@ -1,54 +1,53 @@ { - "id": "ce07a349-37fc-4920-bdd1-0da90c5f95e3", + "id": "154147fd-99f6-4b3f-8fec-3e4ea72e9fc5", "name": "repos_github-api-test-org_test-labels_labels", "request": { "url": "/repos/github-api-test-org/test-labels/labels", "method": "POST", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, "bodyPatterns": [ { "equalToJson": "{\"color\":\"123456\",\"name\":\"test\",\"description\":\"\"}", "ignoreArrayOrder": true, "ignoreExtraElements": true } - ], - "headers": { - "Accept": { - "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" - } - } + ] }, "response": { "status": 201, - "body": "{\"id\":1596524803,\"node_id\":\"MDU6TGFiZWwxNTk2NTI0ODAz\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/test\",\"name\":\"test\",\"color\":\"123456\",\"default\":false,\"description\":\"\"}", + "body": "{\"id\":1932141986,\"node_id\":\"MDU6TGFiZWwxOTMyMTQxOTg2\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/test\",\"name\":\"test\",\"color\":\"123456\",\"default\":false,\"description\":\"\"}", "headers": { - "Date": "Sat, 05 Oct 2019 05:21:23 GMT", - "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", + "Date": "Tue, 24 Mar 2020 19:31:27 GMT", + "Content-Type": "application/json; charset=utf-8", "Status": "201 Created", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4835", - "X-RateLimit-Reset": "1570253246", + "X-RateLimit-Remaining": "4984", + "X-RateLimit-Reset": "1585080826", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "\"f933a77094471805d575559f23304c39\"", + "ETag": "\"746fc424803851d22aad5357c01c224f\"", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "", "Location": "https://api.github.com/repos/github-api-test-org/test-labels/labels/test", - "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", - "Access-Control-Allow-Origin": "*", + "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": "FC58:3C9A:4B9414:5AADB6:5D982853" + "X-GitHub-Request-Id": "C6C5:5608:123338:1FE97F:5E7A600F" } }, - "uuid": "ce07a349-37fc-4920-bdd1-0da90c5f95e3", + "uuid": "154147fd-99f6-4b3f-8fec-3e4ea72e9fc5", "persistent": true, "insertionIndex": 5 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_enhancement-4-ba366e.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_enhancement-4-e1469d.json similarity index 70% rename from src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_enhancement-4-ba366e.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_enhancement-4-e1469d.json index 59462342f1..9ca0baec64 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_enhancement-4-ba366e.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_enhancement-4-e1469d.json @@ -1,5 +1,5 @@ { - "id": "ba366e44-54d8-41e1-a12a-8024a7d41658", + "id": "e1469d4c-5c2e-4efc-8dc4-53336da555a8", "name": "repos_github-api-test-org_test-labels_labels_enhancement", "request": { "url": "/repos/github-api-test-org/test-labels/labels/enhancement", @@ -14,34 +14,33 @@ "status": 200, "body": "{\"id\":177339106,\"node_id\":\"MDU6TGFiZWwxNzczMzkxMDY=\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/enhancement\",\"name\":\"enhancement\",\"color\":\"84b6eb\",\"default\":true,\"description\":null}", "headers": { - "Date": "Sat, 05 Oct 2019 05:21:23 GMT", - "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", + "Date": "Tue, 24 Mar 2020 19:31:27 GMT", + "Content-Type": "application/json; charset=utf-8", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4836", - "X-RateLimit-Reset": "1570253246", + "X-RateLimit-Remaining": "4985", + "X-RateLimit-Reset": "1585080826", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"ac69b781a1575715b24ee0357ce1e51e\"", + "ETag": "W/\"27ddcfc35bfde213e1754cfc9af09e7b\"", "Last-Modified": "Sun, 15 Feb 2015 14:49:10 GMT", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "repo", - "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", - "Access-Control-Allow-Origin": "*", + "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": "FC58:3C9A:4B9412:5AADB3:5D982852" + "X-GitHub-Request-Id": "C6C5:5608:123322:1FE958:5E7A600E" } }, - "uuid": "ba366e44-54d8-41e1-a12a-8024a7d41658", + "uuid": "e1469d4c-5c2e-4efc-8dc4-53336da555a8", "persistent": true, "insertionIndex": 4 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-10-cace49.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-10-cace49.json new file mode 100644 index 0000000000..24f08bdc92 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-10-cace49.json @@ -0,0 +1,52 @@ +{ + "id": "cace497a-c750-4a63-bfac-f0a8a155301c", + "name": "repos_github-api-test-org_test-labels_labels_test", + "request": { + "url": "/repos/github-api-test-org/test-labels/labels/test", + "method": "PATCH", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"color\":\"000000\",\"name\":\"test\",\"description\":\"Deprecated\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"id\":1932141986,\"node_id\":\"MDU6TGFiZWwxOTMyMTQxOTg2\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/test\",\"name\":\"test\",\"color\":\"000000\",\"default\":false,\"description\":\"Deprecated\"}", + "headers": { + "Server": "GitHub.com", + "Date": "Tue, 24 Mar 2020 19:31:28 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4979", + "X-RateLimit-Reset": "1585080826", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"c2b4409465d0fa9da773d945ed7e93b7\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "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": "C6C5:5608:1233C3:1FEA6A:5E7A6010" + } + }, + "uuid": "cace497a-c750-4a63-bfac-f0a8a155301c", + "persistent": true, + "insertionIndex": 10 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-10-3ee113.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-11-e4b594.json similarity index 61% rename from src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-10-3ee113.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-11-e4b594.json index 664dbd9157..9388aa79f5 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-10-3ee113.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-11-e4b594.json @@ -1,5 +1,5 @@ { - "id": "3ee11377-21e9-477f-89c0-9debad44f92b", + "id": "e4b59465-556e-4ecc-9fb7-476a9681503b", "name": "repos_github-api-test-org_test-labels_labels_test", "request": { "url": "/repos/github-api-test-org/test-labels/labels/test", @@ -12,38 +12,38 @@ }, "response": { "status": 200, - "body": "{\"id\":1596524803,\"node_id\":\"MDU6TGFiZWwxNTk2NTI0ODAz\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/test\",\"name\":\"test\",\"color\":\"000000\",\"default\":false,\"description\":\"this is also a test\"}", + "body": "{\"id\":1932141986,\"node_id\":\"MDU6TGFiZWwxOTMyMTQxOTg2\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/test\",\"name\":\"test\",\"color\":\"000000\",\"default\":false,\"description\":\"Deprecated\"}", "headers": { - "Date": "Sat, 05 Oct 2019 05:21:23 GMT", - "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", + "Date": "Tue, 24 Mar 2020 19:31:28 GMT", + "Content-Type": "application/json; charset=utf-8", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4830", - "X-RateLimit-Reset": "1570253246", + "X-RateLimit-Remaining": "4978", + "X-RateLimit-Reset": "1585080825", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"cd828b300f3803bcda7512b44c762a69\"", - "Last-Modified": "Sat, 05 Oct 2019 05:21:23 GMT", + "ETag": "W/\"c2b4409465d0fa9da773d945ed7e93b7\"", + "Last-Modified": "Tue, 24 Mar 2020 19:31:28 GMT", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "repo", - "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", - "Access-Control-Allow-Origin": "*", + "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": "FC58:3C9A:4B9425:5AADCB:5D982853" + "X-GitHub-Request-Id": "C6C5:5608:1233E5:1FEA9C:5E7A6010" } }, - "uuid": "3ee11377-21e9-477f-89c0-9debad44f92b", + "uuid": "e4b59465-556e-4ecc-9fb7-476a9681503b", "persistent": true, "scenarioName": "scenario-1-repos-github-api-test-org-test-labels-labels-test", "requiredScenarioState": "scenario-1-repos-github-api-test-org-test-labels-labels-test-3", - "insertionIndex": 10 + "newScenarioState": "scenario-1-repos-github-api-test-org-test-labels-labels-test-4", + "insertionIndex": 11 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-9-e4f1b8.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-12-0dad57.json similarity index 65% rename from src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-9-e4f1b8.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-12-0dad57.json index d0c0f4518e..c5d00101b2 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-9-e4f1b8.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-12-0dad57.json @@ -1,53 +1,52 @@ { - "id": "e4f1b8e0-0a58-491b-9905-ac4093b64407", + "id": "0dad57a0-5328-486e-a9c6-c5d1fd10695e", "name": "repos_github-api-test-org_test-labels_labels_test", "request": { "url": "/repos/github-api-test-org/test-labels/labels/test", "method": "PATCH", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, "bodyPatterns": [ { "equalToJson": "{\"color\":\"000000\",\"name\":\"test\",\"description\":\"this is also a test\"}", "ignoreArrayOrder": true, "ignoreExtraElements": true } - ], - "headers": { - "Accept": { - "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" - } - } + ] }, "response": { "status": 200, - "body": "{\"id\":1596524803,\"node_id\":\"MDU6TGFiZWwxNTk2NTI0ODAz\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/test\",\"name\":\"test\",\"color\":\"000000\",\"default\":false,\"description\":\"this is also a test\"}", + "body": "{\"id\":1932141986,\"node_id\":\"MDU6TGFiZWwxOTMyMTQxOTg2\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/test\",\"name\":\"test\",\"color\":\"000000\",\"default\":false,\"description\":\"this is also a test\"}", "headers": { - "Date": "Sat, 05 Oct 2019 05:21:23 GMT", - "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", + "Date": "Tue, 24 Mar 2020 19:31:28 GMT", + "Content-Type": "application/json; charset=utf-8", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4831", - "X-RateLimit-Reset": "1570253246", + "X-RateLimit-Remaining": "4977", + "X-RateLimit-Reset": "1585080825", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"cd828b300f3803bcda7512b44c762a69\"", + "ETag": "W/\"70eb410be17b910e7f7ccbee623dc474\"", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "", - "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", - "Access-Control-Allow-Origin": "*", + "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": "FC58:3C9A:4B9422:5AADC8:5D982853" + "X-GitHub-Request-Id": "C6C5:5608:1233F8:1FEABA:5E7A6010" } }, - "uuid": "e4f1b8e0-0a58-491b-9905-ac4093b64407", + "uuid": "0dad57a0-5328-486e-a9c6-c5d1fd10695e", "persistent": true, - "insertionIndex": 9 + "insertionIndex": 12 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-11-f2667d.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-13-09f51c.json similarity index 63% rename from src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-11-f2667d.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-13-09f51c.json index 7575baba9c..573fc9f2f2 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-11-f2667d.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-13-09f51c.json @@ -1,5 +1,5 @@ { - "id": "f2667d3c-85ff-4e42-b633-e677525d4b9c", + "id": "09f51c88-5e9c-4c62-9dac-790df8a09d5d", "name": "repos_github-api-test-org_test-labels_labels_test", "request": { "url": "/repos/github-api-test-org/test-labels/labels/test", @@ -13,28 +13,26 @@ "response": { "status": 204, "headers": { - "Date": "Sat, 05 Oct 2019 05:21:24 GMT", "Server": "GitHub.com", + "Date": "Tue, 24 Mar 2020 19:31:29 GMT", "Status": "204 No Content", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4829", - "X-RateLimit-Reset": "1570253246", + "X-RateLimit-Remaining": "4976", + "X-RateLimit-Reset": "1585080826", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "", "X-GitHub-Media-Type": "unknown, github.v3", - "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", - "Access-Control-Allow-Origin": "*", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", "X-Frame-Options": "deny", "X-Content-Type-Options": "nosniff", "X-XSS-Protection": "1; mode=block", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "Vary": "Accept-Encoding", - "X-GitHub-Request-Id": "FC58:3C9A:4B942A:5AADCE:5D982853" + "Vary": "Accept-Encoding, Accept, X-Requested-With", + "X-GitHub-Request-Id": "C6C5:5608:12341A:1FEAEC:5E7A6010" } }, - "uuid": "f2667d3c-85ff-4e42-b633-e677525d4b9c", + "uuid": "09f51c88-5e9c-4c62-9dac-790df8a09d5d", "persistent": true, - "insertionIndex": 11 + "insertionIndex": 13 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-14-331784.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-14-331784.json new file mode 100644 index 0000000000..2f5ce5d3f6 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-14-331784.json @@ -0,0 +1,42 @@ +{ + "id": "331784da-76b5-4592-bdd3-54afa7ffe0e0", + "name": "repos_github-api-test-org_test-labels_labels_test", + "request": { + "url": "/repos/github-api-test-org/test-labels/labels/test", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 404, + "body": "{\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3/issues/labels/#get-a-single-label\"}", + "headers": { + "Server": "GitHub.com", + "Date": "Tue, 24 Mar 2020 19:31:29 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "404 Not Found", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4975", + "X-RateLimit-Reset": "1585080826", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "Vary": "Accept-Encoding, Accept, X-Requested-With", + "X-GitHub-Request-Id": "C6C5:5608:123433:1FEB1F:5E7A6011" + } + }, + "uuid": "331784da-76b5-4592-bdd3-54afa7ffe0e0", + "persistent": true, + "scenarioName": "scenario-1-repos-github-api-test-org-test-labels-labels-test", + "requiredScenarioState": "scenario-1-repos-github-api-test-org-test-labels-labels-test-4", + "insertionIndex": 14 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-6-6c1d5b.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-6-bee660.json similarity index 65% rename from src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-6-6c1d5b.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-6-bee660.json index abfaf066e2..d314eb6f15 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-6-6c1d5b.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-6-bee660.json @@ -1,5 +1,5 @@ { - "id": "6c1d5bb5-c427-4743-b1c2-0bc8113b155f", + "id": "bee66039-139a-45d5-b7a9-79a79ceb82eb", "name": "repos_github-api-test-org_test-labels_labels_test", "request": { "url": "/repos/github-api-test-org/test-labels/labels/test", @@ -12,36 +12,35 @@ }, "response": { "status": 200, - "body": "{\"id\":1596524803,\"node_id\":\"MDU6TGFiZWwxNTk2NTI0ODAz\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/test\",\"name\":\"test\",\"color\":\"123456\",\"default\":false,\"description\":\"\"}", + "body": "{\"id\":1932141986,\"node_id\":\"MDU6TGFiZWwxOTMyMTQxOTg2\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/test\",\"name\":\"test\",\"color\":\"123456\",\"default\":false,\"description\":\"\"}", "headers": { - "Date": "Sat, 05 Oct 2019 05:21:23 GMT", - "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", + "Date": "Tue, 24 Mar 2020 19:31:27 GMT", + "Content-Type": "application/json; charset=utf-8", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4834", - "X-RateLimit-Reset": "1570253246", + "X-RateLimit-Remaining": "4983", + "X-RateLimit-Reset": "1585080825", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"f933a77094471805d575559f23304c39\"", - "Last-Modified": "Sat, 05 Oct 2019 05:21:23 GMT", + "ETag": "W/\"746fc424803851d22aad5357c01c224f\"", + "Last-Modified": "Tue, 24 Mar 2020 19:31:27 GMT", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "repo", - "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", - "Access-Control-Allow-Origin": "*", + "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": "FC58:3C9A:4B9415:5AADB7:5D982853" + "X-GitHub-Request-Id": "C6C5:5608:12336D:1FE9D0:5E7A600F" } }, - "uuid": "6c1d5bb5-c427-4743-b1c2-0bc8113b155f", + "uuid": "bee66039-139a-45d5-b7a9-79a79ceb82eb", "persistent": true, "scenarioName": "scenario-1-repos-github-api-test-org-test-labels-labels-test", "requiredScenarioState": "Started", diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-7-aceb5f.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-7-528317.json similarity index 62% rename from src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-7-aceb5f.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-7-528317.json index 5a4f20a02c..dc6f2fc2ef 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-7-aceb5f.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-7-528317.json @@ -1,53 +1,52 @@ { - "id": "aceb5f74-bf82-4d06-a87e-9b3294b127e4", + "id": "52831797-1300-4176-bdd4-255cf2fcffde", "name": "repos_github-api-test-org_test-labels_labels_test", "request": { "url": "/repos/github-api-test-org/test-labels/labels/test", "method": "PATCH", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, "bodyPatterns": [ { - "equalToJson": "{\"color\":\"000000\",\"name\":\"test\",\"description\":\"\"}", + "equalToJson": "{\"color\":\"000000\",\"name\":\"test\",\"description\":\"It is dark!\"}", "ignoreArrayOrder": true, "ignoreExtraElements": true } - ], - "headers": { - "Accept": { - "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" - } - } + ] }, "response": { "status": 200, - "body": "{\"id\":1596524803,\"node_id\":\"MDU6TGFiZWwxNTk2NTI0ODAz\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/test\",\"name\":\"test\",\"color\":\"000000\",\"default\":false,\"description\":\"\"}", + "body": "{\"id\":1932141986,\"node_id\":\"MDU6TGFiZWwxOTMyMTQxOTg2\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/test\",\"name\":\"test\",\"color\":\"000000\",\"default\":false,\"description\":\"It is dark!\"}", "headers": { - "Date": "Sat, 05 Oct 2019 05:21:23 GMT", - "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", + "Date": "Tue, 24 Mar 2020 19:31:27 GMT", + "Content-Type": "application/json; charset=utf-8", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4833", - "X-RateLimit-Reset": "1570253246", + "X-RateLimit-Remaining": "4982", + "X-RateLimit-Reset": "1585080825", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"b6be68c4a5dbc522147f58e4b1b1aed1\"", + "ETag": "W/\"77e815d99a6b367bfe8ac24c7089d0bc\"", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "", - "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", - "Access-Control-Allow-Origin": "*", + "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": "FC58:3C9A:4B9419:5AADBC:5D982853" + "X-GitHub-Request-Id": "C6C5:5608:12337A:1FE9F2:5E7A600F" } }, - "uuid": "aceb5f74-bf82-4d06-a87e-9b3294b127e4", + "uuid": "52831797-1300-4176-bdd4-255cf2fcffde", "persistent": true, "insertionIndex": 7 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-8-c772a0.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-8-c772a0.json new file mode 100644 index 0000000000..ce5ba29fc5 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-8-c772a0.json @@ -0,0 +1,52 @@ +{ + "id": "c772a03f-74cd-4858-99dc-c0a66e87fa14", + "name": "repos_github-api-test-org_test-labels_labels_test", + "request": { + "url": "/repos/github-api-test-org/test-labels/labels/test", + "method": "PATCH", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"color\":\"123456\",\"name\":\"test\",\"description\":\"Deprecated\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"id\":1932141986,\"node_id\":\"MDU6TGFiZWwxOTMyMTQxOTg2\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/test\",\"name\":\"test\",\"color\":\"123456\",\"default\":false,\"description\":\"Deprecated\"}", + "headers": { + "Server": "GitHub.com", + "Date": "Tue, 24 Mar 2020 19:31:28 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4981", + "X-RateLimit-Reset": "1585080826", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"69bac1389aaf32d0e34be0b0242c25ea\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "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": "C6C5:5608:12339C:1FEA21:5E7A600F" + } + }, + "uuid": "c772a03f-74cd-4858-99dc-c0a66e87fa14", + "persistent": true, + "insertionIndex": 8 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-8-0dc6e2.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-9-6aef5e.json similarity index 60% rename from src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-8-0dc6e2.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-9-6aef5e.json index f0fca3ba34..8bed64e452 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-8-0dc6e2.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test-9-6aef5e.json @@ -1,5 +1,5 @@ { - "id": "0dc6e214-4dea-4643-b425-713afaa11098", + "id": "6aef5e0a-1161-41dc-b53e-7c8e9d40af50", "name": "repos_github-api-test-org_test-labels_labels_test", "request": { "url": "/repos/github-api-test-org/test-labels/labels/test", @@ -12,39 +12,38 @@ }, "response": { "status": 200, - "body": "{\"id\":1596524803,\"node_id\":\"MDU6TGFiZWwxNTk2NTI0ODAz\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/test\",\"name\":\"test\",\"color\":\"000000\",\"default\":false,\"description\":\"\"}", + "body": "{\"id\":1932141986,\"node_id\":\"MDU6TGFiZWwxOTMyMTQxOTg2\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/test\",\"name\":\"test\",\"color\":\"123456\",\"default\":false,\"description\":\"Deprecated\"}", "headers": { - "Date": "Sat, 05 Oct 2019 05:21:23 GMT", - "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", + "Date": "Tue, 24 Mar 2020 19:31:28 GMT", + "Content-Type": "application/json; charset=utf-8", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4832", - "X-RateLimit-Reset": "1570253246", + "X-RateLimit-Remaining": "4980", + "X-RateLimit-Reset": "1585080826", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"b6be68c4a5dbc522147f58e4b1b1aed1\"", - "Last-Modified": "Sat, 05 Oct 2019 05:21:23 GMT", + "ETag": "W/\"69bac1389aaf32d0e34be0b0242c25ea\"", + "Last-Modified": "Tue, 24 Mar 2020 19:31:28 GMT", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "repo", - "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", - "Access-Control-Allow-Origin": "*", + "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": "FC58:3C9A:4B941E:5AADC4:5D982853" + "X-GitHub-Request-Id": "C6C5:5608:1233B5:1FEA4A:5E7A6010" } }, - "uuid": "0dc6e214-4dea-4643-b425-713afaa11098", + "uuid": "6aef5e0a-1161-41dc-b53e-7c8e9d40af50", "persistent": true, "scenarioName": "scenario-1-repos-github-api-test-org-test-labels-labels-test", "requiredScenarioState": "scenario-1-repos-github-api-test-org-test-labels-labels-test-2", "newScenarioState": "scenario-1-repos-github-api-test-org-test-labels-labels-test-3", - "insertionIndex": 8 + "insertionIndex": 9 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test2-13-633a55.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test2-16-6ad140.json similarity index 61% rename from src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test2-13-633a55.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test2-16-6ad140.json index 3d5769e026..bba2117df6 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test2-13-633a55.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test2-16-6ad140.json @@ -1,5 +1,5 @@ { - "id": "633a55b3-25a5-4c06-9b13-448fc6026aa8", + "id": "6ad14098-9364-4042-aa19-c6079f947dc4", "name": "repos_github-api-test-org_test-labels_labels_test2", "request": { "url": "/repos/github-api-test-org/test-labels/labels/test2", @@ -12,36 +12,35 @@ }, "response": { "status": 200, - "body": "{\"id\":1596524813,\"node_id\":\"MDU6TGFiZWwxNTk2NTI0ODEz\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/test2\",\"name\":\"test2\",\"color\":\"123457\",\"default\":false,\"description\":\"this is a different test\"}", + "body": "{\"id\":1932142041,\"node_id\":\"MDU6TGFiZWwxOTMyMTQyMDQx\",\"url\":\"https://api.github.com/repos/github-api-test-org/test-labels/labels/test2\",\"name\":\"test2\",\"color\":\"123457\",\"default\":false,\"description\":\"this is a different test\"}", "headers": { - "Date": "Sat, 05 Oct 2019 05:21:24 GMT", - "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", + "Date": "Tue, 24 Mar 2020 19:31:29 GMT", + "Content-Type": "application/json; charset=utf-8", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4827", - "X-RateLimit-Reset": "1570253246", + "X-RateLimit-Remaining": "4973", + "X-RateLimit-Reset": "1585080825", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"cb7056d812cb1ca0296b75f5e48b462d\"", - "Last-Modified": "Sat, 05 Oct 2019 05:21:24 GMT", + "ETag": "W/\"c3c0744906ceb4103444a9bf92a50cd0\"", + "Last-Modified": "Tue, 24 Mar 2020 19:31:29 GMT", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "repo", - "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", - "Access-Control-Allow-Origin": "*", + "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": "FC58:3C9A:4B9433:5AADD8:5D982854" + "X-GitHub-Request-Id": "C6C5:5608:12346F:1FEB7B:5E7A6011" } }, - "uuid": "633a55b3-25a5-4c06-9b13-448fc6026aa8", + "uuid": "6ad14098-9364-4042-aa19-c6079f947dc4", "persistent": true, - "insertionIndex": 13 + "insertionIndex": 16 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test2-14-fc4fdf.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test2-17-7c5913.json similarity index 63% rename from src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test2-14-fc4fdf.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test2-17-7c5913.json index 04565c364e..5417e8ed7a 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test2-14-fc4fdf.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/repos_github-api-test-org_test-labels_labels_test2-17-7c5913.json @@ -1,5 +1,5 @@ { - "id": "fc4fdfaa-2dc1-4fa7-bf63-8bd106717b77", + "id": "7c5913e1-8b58-46e6-807b-e65a006e215b", "name": "repos_github-api-test-org_test-labels_labels_test2", "request": { "url": "/repos/github-api-test-org/test-labels/labels/test2", @@ -13,28 +13,26 @@ "response": { "status": 204, "headers": { - "Date": "Sat, 05 Oct 2019 05:21:24 GMT", "Server": "GitHub.com", + "Date": "Tue, 24 Mar 2020 19:31:30 GMT", "Status": "204 No Content", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4826", - "X-RateLimit-Reset": "1570253246", + "X-RateLimit-Remaining": "4972", + "X-RateLimit-Reset": "1585080826", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "", "X-GitHub-Media-Type": "unknown, github.v3", - "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", - "Access-Control-Allow-Origin": "*", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", "X-Frame-Options": "deny", "X-Content-Type-Options": "nosniff", "X-XSS-Protection": "1; mode=block", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "Vary": "Accept-Encoding", - "X-GitHub-Request-Id": "FC58:3C9A:4B9435:5AADDE:5D982854" + "Vary": "Accept-Encoding, Accept, X-Requested-With", + "X-GitHub-Request-Id": "C6C5:5608:123480:1FEB9D:5E7A6011" } }, - "uuid": "fc4fdfaa-2dc1-4fa7-bf63-8bd106717b77", + "uuid": "7c5913e1-8b58-46e6-807b-e65a006e215b", "persistent": true, - "insertionIndex": 14 + "insertionIndex": 17 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/user-1-05a1d2.json b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/user-1-a78a0f.json similarity index 60% rename from src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/user-1-05a1d2.json rename to src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/user-1-a78a0f.json index 0d83826e6d..46ef9c5a2f 100644 --- a/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/user-1-05a1d2.json +++ b/src/test/resources/org/kohsuke/github/AppTest/wiremock/testRepoLabel/mappings/user-1-a78a0f.json @@ -1,5 +1,5 @@ { - "id": "05a1d265-edf9-4570-b398-a3eb7d3396e1", + "id": "a78a0f34-4527-48ba-88f8-16c319430bc6", "name": "user", "request": { "url": "/user", @@ -12,37 +12,35 @@ }, "response": { "status": 200, - "bodyFileName": "user-05a1d265-edf9-4570-b398-a3eb7d3396e1.json", + "bodyFileName": "user-a78a0f34-4527-48ba-88f8-16c319430bc6.json", "headers": { - "Date": "Sat, 05 Oct 2019 05:21:21 GMT", - "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", + "Date": "Tue, 24 Mar 2020 19:31:25 GMT", + "Content-Type": "application/json; charset=utf-8", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4844", - "X-RateLimit-Reset": "1570253246", + "X-RateLimit-Remaining": "4993", + "X-RateLimit-Reset": "1585080826", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"af0c41afcacb8ceee14b7d896719c3bd\"", - "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "ETag": "W/\"6cede2c36b953eb0e7f982fbcb6eb76a\"", + "Last-Modified": "Thu, 19 Mar 2020 19:17:12 GMT", "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", "X-Accepted-OAuth-Scopes": "", "X-GitHub-Media-Type": "unknown, github.v3", - "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", - "Access-Control-Allow-Origin": "*", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", "X-Frame-Options": "deny", "X-Content-Type-Options": "nosniff", "X-XSS-Protection": "1; mode=block", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "FC58:3C9A:4B93FD:5AAD9A:5D982851" + "X-GitHub-Request-Id": "C6C5:5608:123237:1FE7CB:5E7A600C" } }, - "uuid": "05a1d265-edf9-4570-b398-a3eb7d3396e1", + "uuid": "a78a0f34-4527-48ba-88f8-16c319430bc6", "persistent": true, "insertionIndex": 1 } \ No newline at end of file