Class GHRepositoryTest


public class GHRepositoryTest extends AbstractGitHubWireMockTest
The Class GHRepositoryTest.
Author:
Liam Newman
  • Constructor Details

    • GHRepositoryTest

      public GHRepositoryTest()
      Create default GHRepositoryTest instance
  • Method Details

    • getRepository

      protected GHRepository getRepository() throws IOException
      Gets the repository.
      Returns:
      the repository
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • sync

      public void sync() throws IOException
      Test sync of fork
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • syncNoFork

      public void syncNoFork() throws IOException
      Test sync of repository not a fork
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • testZipball

      public void testZipball() throws IOException
      Test zipball.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • testTarball

      public void testTarball() throws IOException
      Test tarball.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • testGetters

      public void testGetters() throws IOException
      Test getters.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • archive

      public void archive() throws Exception
      Archive.
      Throws:
      Exception - the exception
    • isDisabled

      public void isDisabled() throws Exception
      Checks if is disabled.
      Throws:
      Exception - the exception
    • isDisabledTrue

      public void isDisabledTrue() throws Exception
      Checks if is disabled true.
      Throws:
      Exception - the exception
    • getBranch_URLEncoded

      public void getBranch_URLEncoded() throws Exception
      Gets the branch URL encoded.
      Throws:
      Exception - the exception
    • createSignedCommitVerifyError

      public void createSignedCommitVerifyError() throws IOException
      Creates the signed commit verify error.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • createSignedCommitUnknownSignatureType

      public void createSignedCommitUnknownSignatureType() throws IOException
      Creates the signed commit unknown signature type.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • listStargazers

      public void listStargazers() throws IOException
      List stargazers.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getBranchNonExistentBut200Status

      public void getBranchNonExistentBut200Status() throws Exception
      Gets the branch non existent but 200 status.
      Throws:
      Exception - the exception
    • subscription

      public void subscription() throws Exception
      Subscription.
      Throws:
      Exception - the exception
    • testSetPublic

      public void testSetPublic() throws Exception
      Test set public.
      Throws:
      Exception - the exception
    • testCreateVisibilityForOrganization

      public void testCreateVisibilityForOrganization() throws Exception
      Tests the creation of repositories with alternating visibilities for orgs.
      Throws:
      Exception - the exception
    • testCreateVisibilityForUser

      public void testCreateVisibilityForUser() throws Exception
      Tests the creation of repositories with alternating visibilities for users.
      Throws:
      Exception - the exception
    • testUpdateRepository

      public void testUpdateRepository() throws Exception
      Test update repository.
      Throws:
      Exception - the exception
    • testGetRepositoryWithVisibility

      public void testGetRepositoryWithVisibility() throws IOException
      Test get repository with visibility.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • listContributors

      public void listContributors() throws IOException
      List contributors.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getPermission

      public void getPermission() throws Exception
      Gets the permission.
      Throws:
      Exception - the exception
    • hasPermission

      public void hasPermission() throws Exception
      Checks for permission.
      Throws:
      Exception - the exception
    • LatestRepositoryExist

      public void LatestRepositoryExist()
      Latest repository exist.
    • addCollaborators

      public void addCollaborators() throws Exception
      Adds the collaborators.
      Throws:
      Exception - the exception
    • addCollaboratorsRepoPerm

      public void addCollaboratorsRepoPerm() throws Exception
      Adds the collaborators repo perm.
      Throws:
      Exception - the exception
    • LatestRepositoryNotExist

      public void LatestRepositoryNotExist()
      Latest repository not exist.
    • listReleases

      public void listReleases() throws IOException
      List releases.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getReleaseExists

      public void getReleaseExists() throws IOException
      Gets the release exists.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getReleaseDoesNotExist

      public void getReleaseDoesNotExist() throws IOException
      Gets the release does not exist.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getReleaseByTagNameExists

      public void getReleaseByTagNameExists() throws IOException
      Gets the release by tag name exists.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getReleaseByTagNameDoesNotExist

      public void getReleaseByTagNameDoesNotExist() throws IOException
      Gets the release by tag name does not exist.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • listLanguages

      public void listLanguages() throws IOException
      List languages.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • listCommitCommentsNoComments

      public void listCommitCommentsNoComments() throws IOException
      List commit comments no comments.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • searchAllPublicAndForkedRepos

      public void searchAllPublicAndForkedRepos() throws IOException
      Search all public and forked repos.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • searchForPublicForkedOnlyRepos

      public void searchForPublicForkedOnlyRepos() throws IOException
      Search for public forked only repos.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • ghRepositorySearchBuilderIgnoresUnknownVisibility

      public void ghRepositorySearchBuilderIgnoresUnknownVisibility()
      Gh repository search builder ignores unknown visibility.
    • ghRepositorySearchBuilderForkDefaultResetForksSearchTerms

      public void ghRepositorySearchBuilderForkDefaultResetForksSearchTerms()
      Gh repository search builder fork default reset forks search terms.
    • listCommitCommentsSomeComments

      public void listCommitCommentsSomeComments() throws IOException
      List commit comments some comments.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • listEmptyContributors

      public void listEmptyContributors() throws IOException
      List empty contributors.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • searchRepositories

      public void searchRepositories() throws Exception
      Search repositories.
      Throws:
      Exception - the exception
    • searchOrgForRepositories

      public void searchOrgForRepositories() throws Exception
      Search org for repositories.
      Throws:
      Exception - the exception
    • testIssue162

      public void testIssue162() throws Exception
      Test issue 162.
      Throws:
      Exception - the exception
    • markDown

      public void markDown() throws Exception
      Mark down.
      Throws:
      Exception - the exception
    • setMergeOptions

      public void setMergeOptions() throws IOException
      Sets the merge options.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getDeleteBranchOnMerge

      public void getDeleteBranchOnMerge() throws IOException
      Gets the delete branch on merge.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • setDeleteBranchOnMerge

      public void setDeleteBranchOnMerge() throws IOException
      Sets the delete branch on merge.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • testSetTopics

      public void testSetTopics() throws Exception
      Test set topics.
      Throws:
      Exception - the exception
    • getCollaborators

      public void getCollaborators() throws Exception
      Gets the collaborators.
      Throws:
      Exception - the exception
    • getPostCommitHooks

      public void getPostCommitHooks() throws Exception
      Gets the post commit hooks.
      Throws:
      Exception - the exception
    • getRefs

      public void getRefs() throws Exception
      Gets the refs.
      Throws:
      Exception - the exception
    • getPublicKey

      public void getPublicKey() throws Exception
      Gets the public key.
      Throws:
      Exception - the exception
    • getRefsHeads

      public void getRefsHeads() throws Exception
      Gets the refs heads.
      Throws:
      Exception - the exception
    • getRefsEmptyTags

      public void getRefsEmptyTags() throws Exception
      Gets the refs empty tags.
      Throws:
      Exception - the exception
    • listRefs

      public void listRefs() throws Exception
      List refs.
      Throws:
      Exception - the exception
    • getRef

      public void getRef() throws Exception
      Gets the ref.
      Throws:
      Exception - the exception
    • listRefsHeads

      public void listRefsHeads() throws Exception
      List refs heads.
      Throws:
      Exception - the exception
    • listRefsEmptyTags

      public void listRefsEmptyTags() throws Exception
      List refs empty tags.
      Throws:
      Exception - the exception
    • listTagsEmpty

      public void listTagsEmpty() throws Exception
      List tags empty.
      Throws:
      Exception - the exception
    • listTags

      public void listTags() throws Exception
      List tags.
      Throws:
      Exception - the exception
    • checkWatchersCount

      public void checkWatchersCount() throws Exception
      Check watchers count.
      Throws:
      Exception - the exception
    • checkStargazersCount

      public void checkStargazersCount() throws Exception
      Check stargazers count.
      Throws:
      Exception - the exception
    • listCollaborators

      public void listCollaborators() throws Exception
      List collaborators.
      Throws:
      Exception - the exception
    • listCollaboratorsFiltered

      public void listCollaboratorsFiltered() throws Exception
      List collaborators filtered.
      Throws:
      Exception - the exception
    • userIsCollaborator

      public void userIsCollaborator() throws Exception
      User is collaborator.
      Throws:
      Exception - the exception
    • getCheckRuns

      public void getCheckRuns() throws Exception
      Gets the check runs.
      Throws:
      Exception - the exception
    • getCheckRunsWithParams

      public void getCheckRunsWithParams() throws Exception
      Filter out the checks from a reference
      Throws:
      Exception - the exception
    • getLastCommitStatus

      public void getLastCommitStatus() throws Exception
      Gets the last commit status.
      Throws:
      Exception - the exception
    • listCommitsBetween

      public void listCommitsBetween() throws Exception
      List commits between.
      Throws:
      Exception - the exception
    • listCommitsBetweenPaginated

      public void listCommitsBetweenPaginated() throws Exception
      List commits between paginated.
      Throws:
      Exception - the exception
    • getCommitsBetweenOver250

      public void getCommitsBetweenOver250() throws Exception
      Gets the commits between over 250.
      Throws:
      Exception - the exception
    • getCommitsBetweenPaged

      public void getCommitsBetweenPaged() throws Exception
      Gets the commits between paged.
      Throws:
      Exception - the exception
    • createDispatchEventWithoutClientPayload

      public void createDispatchEventWithoutClientPayload() throws Exception
      Creates the dispatch event without client payload.
      Throws:
      Exception - the exception
    • createDispatchEventWithClientPayload

      public void createDispatchEventWithClientPayload() throws Exception
      Creates the dispatch event with client payload.
      Throws:
      Exception - the exception
    • createSecret

      public void createSecret() throws Exception
      Creates the secret.
      Throws:
      Exception - the exception
    • starTest

      public void starTest() throws Exception
      Test to check star method by verifying stargarzer count.
      Throws:
      Exception - the exception
    • testCreateRepoActionVariable

      public void testCreateRepoActionVariable() throws IOException
      Test create repo action variable.
      Throws:
      IOException - the exception
    • testUpdateRepoActionVariable

      public void testUpdateRepoActionVariable() throws IOException
      Test update repo action variable.
      Throws:
      IOException - the exception
    • testDeleteRepoActionVariable

      public void testDeleteRepoActionVariable() throws IOException
      Test delete repo action variable.
      Throws:
      IOException - the exception
    • cannotRetrievePermissionMaintainUser

      public void cannotRetrievePermissionMaintainUser() throws IOException
      Test demoing the issue with a user having the maintain permission on a repository. Test checking the permission fallback mechanism in case the Github API changes. The test was recorded at a time a new permission was added by mistake. If a re-recording it is needed, you'll like have to manually edit the generated mocks to get a non existing permission See https://github.com/hub4j/github-api/issues/1671#issuecomment-1577515662 for the details.
      Throws:
      IOException - the exception
    • testSearchPullRequests

      public void testSearchPullRequests() throws Exception
      Test searching for pull requests.
      Throws:
      IOException - the exception
      Exception
    • testGetTopReferralPaths

      public void testGetTopReferralPaths() throws Exception
      Test getTopReferralPaths.
      Throws:
      Exception - the exception
    • testGetTopReferralSources

      public void testGetTopReferralSources() throws Exception
      Test getTopReferralSources.
      Throws:
      Exception - the exception
    • testGetRulesForBranch

      public void testGetRulesForBranch() throws Exception
      Test getRulesForBranch.
      Throws:
      Exception - the exception
    • testIsVulnerabilityAlertsEnabled

      public void testIsVulnerabilityAlertsEnabled() throws Exception
      Test getVulnerabilityAlerts.
      Throws:
      Exception - the exception