Compare commits

...

5 Commits

Author SHA1 Message Date
Liam Newman
9aeb422157 [maven-release-plugin] prepare release github-api-1.119 2021-01-05 17:27:08 -08:00
Liam Newman
fba0f8cf8e Merge pull request #1015 from seregamorph/feature/mock-previews
Fix mocking Previews
2021-01-05 17:23:55 -08:00
seregamorph
0f4a5227e1 internal package 2021-01-05 23:03:49 +03:00
seregamorph
d16a752b43 Fix mocking Previews 2021-01-05 18:50:24 +03:00
Liam Newman
4bec27fd49 [maven-release-plugin] prepare for next development iteration 2021-01-04 01:48:27 -08:00
37 changed files with 77 additions and 31 deletions

View File

@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.kohsuke</groupId> <groupId>org.kohsuke</groupId>
<artifactId>github-api</artifactId> <artifactId>github-api</artifactId>
<version>1.118</version> <version>1.119</version>
<name>GitHub API for Java</name> <name>GitHub API for Java</name>
<url>https://github-api.kohsuke.org/</url> <url>https://github-api.kohsuke.org/</url>
<description>GitHub API for Java</description> <description>GitHub API for Java</description>
@@ -11,7 +11,7 @@
<connection>scm:git:git@github.com/hub4j/${project.artifactId}.git</connection> <connection>scm:git:git@github.com/hub4j/${project.artifactId}.git</connection>
<developerConnection>scm:git:ssh://git@github.com/hub4j/${project.artifactId}.git</developerConnection> <developerConnection>scm:git:ssh://git@github.com/hub4j/${project.artifactId}.git</developerConnection>
<url>https://github.com/hub4j/github-api/</url> <url>https://github.com/hub4j/github-api/</url>
<tag>github-api-1.118</tag> <tag>github-api-1.119</tag>
</scm> </scm>
<distributionManagement> <distributionManagement>
@@ -153,7 +153,7 @@
<exclude>org.kohsuke.github.example.*</exclude> <exclude>org.kohsuke.github.example.*</exclude>
<!-- No methods --> <!-- No methods -->
<exclude>org.kohsuke.github.Previews</exclude> <exclude>org.kohsuke.github.internal.Previews</exclude>
<!-- Deprecated --> <!-- Deprecated -->
<exclude>org.kohsuke.github.extras.OkHttp3Connector</exclude> <exclude>org.kohsuke.github.extras.OkHttp3Connector</exclude>

View File

@@ -5,7 +5,7 @@ import java.net.URL;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static org.kohsuke.github.Previews.MACHINE_MAN; import static org.kohsuke.github.internal.Previews.MACHINE_MAN;
/** /**
* A Github App. * A Github App.

View File

@@ -5,7 +5,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static org.kohsuke.github.Previews.MACHINE_MAN; import static org.kohsuke.github.internal.Previews.MACHINE_MAN;
/** /**
* Creates a access token for a GitHub App Installation * Creates a access token for a GitHub App Installation

View File

@@ -8,8 +8,8 @@ import java.net.URL;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static org.kohsuke.github.Previews.GAMBIT; import static org.kohsuke.github.internal.Previews.GAMBIT;
import static org.kohsuke.github.Previews.MACHINE_MAN; import static org.kohsuke.github.internal.Previews.MACHINE_MAN;
/** /**
* A Github App Installation. * A Github App Installation.

View File

@@ -3,6 +3,7 @@ package org.kohsuke.github;
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.kohsuke.github.internal.Previews;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;

View File

@@ -6,7 +6,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException; import java.io.IOException;
import java.util.Collection; import java.util.Collection;
import static org.kohsuke.github.Previews.ZZZAX; import static org.kohsuke.github.internal.Previews.ZZZAX;
/** /**
* The type GHBranchProtection. * The type GHBranchProtection.

View File

@@ -12,7 +12,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import static org.kohsuke.github.Previews.*; import static org.kohsuke.github.internal.Previews.LUKE_CAGE;
/** /**
* Builder to configure the branch protection settings. * Builder to configure the branch protection settings.

View File

@@ -3,6 +3,7 @@ package org.kohsuke.github;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.kohsuke.github.internal.Previews;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;

View File

@@ -28,6 +28,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import edu.umd.cs.findbugs.annotations.CheckForNull; import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.kohsuke.github.internal.Previews;
import java.io.IOException; import java.io.IOException;
import java.util.Collections; import java.util.Collections;

View File

@@ -11,8 +11,8 @@ import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import static org.kohsuke.github.Previews.ANTIOPE; import static org.kohsuke.github.internal.Previews.ANTIOPE;
import static org.kohsuke.github.Previews.GROOT; import static org.kohsuke.github.internal.Previews.GROOT;
/** /**
* A commit in a repository. * A commit in a repository.

View File

@@ -5,7 +5,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
import static org.kohsuke.github.Previews.*; import static org.kohsuke.github.internal.Previews.SQUIRREL_GIRL;
/** /**
* A comment attached to a commit (or a specific line in a specific file of a commit.) * A comment attached to a commit (or a specific line in a specific file of a commit.)

View File

@@ -1,6 +1,7 @@
package org.kohsuke.github; package org.kohsuke.github;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.kohsuke.github.internal.Previews;
import java.io.IOException; import java.io.IOException;

View File

@@ -2,7 +2,7 @@ package org.kohsuke.github;
import java.io.IOException; import java.io.IOException;
import static org.kohsuke.github.Previews.BAPTISTE; import static org.kohsuke.github.internal.Previews.BAPTISTE;
/** /**
* Creates a repository * Creates a repository

View File

@@ -1,5 +1,7 @@
package org.kohsuke.github; package org.kohsuke.github;
import org.kohsuke.github.internal.Previews;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.util.Map; import java.util.Map;

View File

@@ -1,5 +1,7 @@
package org.kohsuke.github; package org.kohsuke.github;
import org.kohsuke.github.internal.Previews;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;

View File

@@ -1,5 +1,7 @@
package org.kohsuke.github; package org.kohsuke.github;
import org.kohsuke.github.internal.Previews;
/** /**
* Represents the state of deployment * Represents the state of deployment
*/ */

View File

@@ -1,5 +1,7 @@
package org.kohsuke.github; package org.kohsuke.github;
import org.kohsuke.github.internal.Previews;
import java.net.URL; import java.net.URL;
import java.util.Locale; import java.util.Locale;

View File

@@ -1,5 +1,7 @@
package org.kohsuke.github; package org.kohsuke.github;
import org.kohsuke.github.internal.Previews;
import java.io.IOException; import java.io.IOException;
/** /**

View File

@@ -1,6 +1,7 @@
package org.kohsuke.github; package org.kohsuke.github;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import org.kohsuke.github.internal.Previews;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;

View File

@@ -39,7 +39,7 @@ import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Objects; import java.util.Objects;
import static org.kohsuke.github.Previews.SQUIRREL_GIRL; import static org.kohsuke.github.internal.Previews.SQUIRREL_GIRL;
/** /**
* Represents an issue on GitHub. * Represents an issue on GitHub.

View File

@@ -26,7 +26,7 @@ package org.kohsuke.github;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
import static org.kohsuke.github.Previews.*; import static org.kohsuke.github.internal.Previews.SQUIRREL_GIRL;
/** /**
* Comment to the issue * Comment to the issue

View File

@@ -10,7 +10,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.TreeMap; import java.util.TreeMap;
import static org.kohsuke.github.Previews.INERTIA; import static org.kohsuke.github.internal.Previews.INERTIA;
/** /**
* The type GHOrganization. * The type GHOrganization.

View File

@@ -28,7 +28,7 @@ import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.util.Locale; import java.util.Locale;
import static org.kohsuke.github.Previews.INERTIA; import static org.kohsuke.github.internal.Previews.INERTIA;
/** /**
* A GitHub project. * A GitHub project.

View File

@@ -6,7 +6,7 @@ import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
import static org.kohsuke.github.Previews.INERTIA; import static org.kohsuke.github.internal.Previews.INERTIA;
/** /**
* The type GHProjectCard. * The type GHProjectCard.

View File

@@ -4,7 +4,7 @@ import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
import static org.kohsuke.github.Previews.INERTIA; import static org.kohsuke.github.internal.Previews.INERTIA;
/** /**
* The type GHProjectColumn. * The type GHProjectColumn.

View File

@@ -36,8 +36,8 @@ import java.util.Objects;
import javax.annotation.CheckForNull; import javax.annotation.CheckForNull;
import static org.kohsuke.github.Previews.LYDIAN; import static org.kohsuke.github.internal.Previews.LYDIAN;
import static org.kohsuke.github.Previews.SHADOW_CAT; import static org.kohsuke.github.internal.Previews.SHADOW_CAT;
/** /**
* A pull request. * A pull request.

View File

@@ -1,6 +1,6 @@
package org.kohsuke.github; package org.kohsuke.github;
import static org.kohsuke.github.Previews.SHADOW_CAT; import static org.kohsuke.github.internal.Previews.SHADOW_CAT;
/** /**
* Lists up pull requests with some filtering and sorting. * Lists up pull requests with some filtering and sorting.

View File

@@ -28,7 +28,7 @@ import java.net.URL;
import javax.annotation.CheckForNull; import javax.annotation.CheckForNull;
import static org.kohsuke.github.Previews.*; import static org.kohsuke.github.internal.Previews.SQUIRREL_GIRL;
/** /**
* Review comment to the pull request * Review comment to the pull request

View File

@@ -3,7 +3,7 @@ package org.kohsuke.github;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
import static org.kohsuke.github.Previews.*; import static org.kohsuke.github.internal.Previews.SQUIRREL_GIRL;
/** /**
* Reaction to issue, comment, PR, and so on. * Reaction to issue, comment, PR, and so on.

View File

@@ -57,7 +57,13 @@ import java.util.WeakHashMap;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import static java.util.Arrays.*; import static java.util.Arrays.*;
import static org.kohsuke.github.Previews.*; import static org.kohsuke.github.internal.Previews.ANTIOPE;
import static org.kohsuke.github.internal.Previews.ANT_MAN;
import static org.kohsuke.github.internal.Previews.BAPTISTE;
import static org.kohsuke.github.internal.Previews.FLASH;
import static org.kohsuke.github.internal.Previews.INERTIA;
import static org.kohsuke.github.internal.Previews.MERCY;
import static org.kohsuke.github.internal.Previews.SHADOW_CAT;
/** /**
* A repository on GitHub. * A repository on GitHub.

View File

@@ -3,7 +3,7 @@ package org.kohsuke.github;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
import static org.kohsuke.github.Previews.BAPTISTE; import static org.kohsuke.github.internal.Previews.BAPTISTE;
abstract class GHRepositoryBuilder<S> extends AbstractBuilder<GHRepository, S> { abstract class GHRepositoryBuilder<S> extends AbstractBuilder<GHRepository, S> {

View File

@@ -26,6 +26,7 @@ package org.kohsuke.github;
import com.fasterxml.jackson.databind.ObjectReader; import com.fasterxml.jackson.databind.ObjectReader;
import com.fasterxml.jackson.databind.ObjectWriter; import com.fasterxml.jackson.databind.ObjectWriter;
import com.infradna.tool.bridge_method_injector.WithBridgeMethods; import com.infradna.tool.bridge_method_injector.WithBridgeMethods;
import org.kohsuke.github.internal.Previews;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
@@ -37,8 +38,8 @@ import java.util.logging.Logger;
import javax.annotation.CheckForNull; import javax.annotation.CheckForNull;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import static org.kohsuke.github.Previews.INERTIA; import static org.kohsuke.github.internal.Previews.INERTIA;
import static org.kohsuke.github.Previews.MACHINE_MAN; import static org.kohsuke.github.internal.Previews.MACHINE_MAN;
/** /**
* Root of the GitHub API. * Root of the GitHub API.

View File

@@ -2,6 +2,7 @@ package org.kohsuke.github;
import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.NonNull;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.kohsuke.github.internal.Previews;
import java.io.InputStream; import java.io.InputStream;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;

View File

@@ -1,5 +1,7 @@
package org.kohsuke.github; package org.kohsuke.github;
import org.kohsuke.github.internal.Previews;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;

View File

@@ -2,7 +2,7 @@ package org.kohsuke.github;
import java.io.IOException; import java.io.IOException;
import static org.kohsuke.github.Previews.SQUIRREL_GIRL; import static org.kohsuke.github.internal.Previews.SQUIRREL_GIRL;
/** /**
* Those {@link GHObject}s that can have {@linkplain GHReaction reactions}. * Those {@link GHObject}s that can have {@linkplain GHReaction reactions}.

View File

@@ -1,4 +1,4 @@
package org.kohsuke.github; package org.kohsuke.github.internal;
/** /**
* Provides the media type strings for GitHub API previews * Provides the media type strings for GitHub API previews
@@ -7,7 +7,7 @@ package org.kohsuke.github;
* *
* @author Kohsuke Kawaguchi * @author Kohsuke Kawaguchi
*/ */
enum Previews { public enum Previews {
/** /**
* Check-runs and check-suites * Check-runs and check-suites

View File

@@ -0,0 +1,21 @@
package org.kohsuke.github;
import org.junit.Test;
import java.io.IOException;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class GHPullRequestMockTest {
@Test
public void shouldMockGHPullRequest() throws IOException {
GHPullRequest pullRequest = mock(GHPullRequest.class);
when(pullRequest.isDraft()).thenReturn(true);
assertTrue("Mock should return true", pullRequest.isDraft());
}
}