Skip to content

Commit

Permalink
Fix test javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwiseman committed Sep 27, 2022
1 parent e2d129e commit a09587b
Show file tree
Hide file tree
Showing 73 changed files with 2,362 additions and 702 deletions.
1 change: 1 addition & 0 deletions src/main/java/org/kohsuke/github/AbuseLimitHandler.java
Expand Up @@ -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.
*
Expand Down
14 changes: 9 additions & 5 deletions src/test/java/org/kohsuke/HookApp.java
Expand Up @@ -16,12 +16,14 @@
* @author Kohsuke Kawaguchi
*/
public class HookApp {

/**
* The main method.
*
* @param args the arguments
* @throws Exception the exception
* @param args
* the arguments
* @throws Exception
* the exception
*/
public static void main(String[] args) throws Exception {
// GitHub.connect().getMyself().getRepository("sandbox").createWebHook(
Expand All @@ -34,8 +36,10 @@ public static void main(String[] args) throws Exception {
/**
* Do index.
*
* @param req the req
* @throws IOException Signals that an I/O exception has occurred.
* @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");
Expand Down
Expand Up @@ -33,10 +33,10 @@ public class AbstractGHAppInstallationTest extends AbstractGitHubWireMockTest {

/** The jwt provider 1. */
protected final AuthorizationProvider jwtProvider1;

/** The jwt provider 2. */
protected final AuthorizationProvider jwtProvider2;

/** The jwt provider 3. */
protected final AuthorizationProvider jwtProvider3;

Expand Down Expand Up @@ -82,9 +82,11 @@ private String createJwtToken(String keyFileResouceName, String appId) {
/**
* Gets the app installation with token.
*
* @param jwtToken the jwt token
* @param jwtToken
* the jwt token
* @return the app installation with token
* @throws IOException Signals that an I/O exception has occurred.
* @throws IOException
* Signals that an I/O exception has occurred.
*/
protected GHAppInstallation getAppInstallationWithToken(String jwtToken) throws IOException {
GitHub gitHub = getGitHubBuilder().withJwtToken(jwtToken)
Expand Down
59 changes: 38 additions & 21 deletions src/test/java/org/kohsuke/github/AbstractGitHubWireMockTest.java
Expand Up @@ -39,7 +39,7 @@ public abstract class AbstractGitHubWireMockTest {

/** 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";

Expand All @@ -58,7 +58,7 @@ public abstract class AbstractGitHubWireMockTest {

/** 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";

Expand Down Expand Up @@ -136,7 +136,8 @@ protected GitHubBuilder getGitHubBuilder() {
/**
* Wire mock setup.
*
* @throws Exception the exception
* @throws Exception
* the exception
*/
@Before
public void wireMockSetup() throws Exception {
Expand Down Expand Up @@ -164,7 +165,8 @@ protected void snapshotNotAllowed() {
/**
* Require proxy.
*
* @param reason the reason
* @param reason
* the reason
*/
protected void requireProxy(String reason) {
assumeTrue("Test only valid when proxying (-Dtest.github.useProxy to enable): " + reason,
Expand All @@ -174,7 +176,8 @@ protected void requireProxy(String reason) {
/**
* Verify authenticated.
*
* @param instance the instance
* @param instance
* the instance
*/
protected void verifyAuthenticated(GitHub instance) {
assertThat(
Expand All @@ -195,7 +198,8 @@ protected GHUser getUser() {
/**
* Gets the user.
*
* @param gitHub the git hub
* @param gitHub
* the git hub
* @return the user
*/
protected static GHUser getUser(GitHub gitHub) {
Expand Down Expand Up @@ -255,7 +259,8 @@ protected GHRepository getTempRepository(String name) throws IOException {
/**
* Cleanup temp repositories.
*
* @throws IOException Signals that an I/O exception has occurred.
* @throws IOException
* Signals that an I/O exception has occurred.
*/
@Before
@After
Expand All @@ -270,8 +275,10 @@ public void cleanupTempRepositories() throws IOException {
/**
* Cleanup repository.
*
* @param fullName the full name
* @throws IOException Signals that an I/O exception has occurred.
* @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()) {
Expand Down Expand Up @@ -331,11 +338,12 @@ private String getOrganization() throws IOException {
public static void fail() {
Assert.fail();
}

/**
* Fail.
*
* @param reason the reason
* @param reason
* the reason
*/
public static void fail(String reason) {
Assert.fail(reason);
Expand All @@ -344,9 +352,12 @@ public static void fail(String reason) {
/**
* Assert that.
*
* @param <T> the generic type
* @param actual the actual
* @param matcher the matcher
* @param <T>
* the generic type
* @param actual
* the actual
* @param matcher
* the matcher
*/
public static <T> void assertThat(T actual, Matcher<? super T> matcher) {
MatcherAssert.assertThat("", actual, matcher);
Expand All @@ -355,10 +366,14 @@ public static <T> void assertThat(T actual, Matcher<? super T> matcher) {
/**
* Assert that.
*
* @param <T> the generic type
* @param reason the reason
* @param actual the actual
* @param matcher the matcher
* @param <T>
* the generic type
* @param reason
* the reason
* @param actual
* the actual
* @param matcher
* the matcher
*/
public static <T> void assertThat(String reason, T actual, Matcher<? super T> matcher) {
MatcherAssert.assertThat(reason, actual, matcher);
Expand All @@ -367,8 +382,10 @@ public static <T> void assertThat(String reason, T actual, Matcher<? super T> ma
/**
* Assert that.
*
* @param reason the reason
* @param assertion the assertion
* @param reason
* the reason
* @param assertion
* the assertion
*/
public static void assertThat(String reason, boolean assertion) {
MatcherAssert.assertThat(reason, assertion);
Expand All @@ -378,7 +395,7 @@ public static void assertThat(String reason, boolean assertion) {
* The Class TemplatingHelper.
*/
protected static class TemplatingHelper {

/** The test start date. */
public Date testStartDate = new Date();

Expand Down
12 changes: 8 additions & 4 deletions src/test/java/org/kohsuke/github/AbuseLimitHandlerTest.java
Expand Up @@ -61,7 +61,8 @@ protected WireMockConfiguration getWireMockOptions() {
/**
* Test handler fail.
*
* @throws Exception the exception
* @throws Exception
* the exception
*/
@Test
public void testHandler_Fail() throws Exception {
Expand Down Expand Up @@ -222,7 +223,8 @@ public void onError(IOException e, HttpURLConnection uc) throws IOException {
/**
* Test handler http status fail.
*
* @throws Exception the exception
* @throws Exception
* the exception
*/
@Test
public void testHandler_HttpStatus_Fail() throws Exception {
Expand Down Expand Up @@ -254,7 +256,8 @@ public void testHandler_HttpStatus_Fail() throws Exception {
/**
* Test handler wait.
*
* @throws Exception the exception
* @throws Exception
* the exception
*/
@Test
public void testHandler_Wait() throws Exception {
Expand All @@ -275,7 +278,8 @@ public void testHandler_Wait() throws Exception {
/**
* Test handler wait stuck.
*
* @throws Exception the exception
* @throws Exception
* the exception
*/
@Test
public void testHandler_WaitStuck() throws Exception {
Expand Down

0 comments on commit a09587b

Please sign in to comment.