Package org.kohsuke.github
Class GHLicenseTest
- java.lang.Object
-
- org.kohsuke.github.AbstractGitHubWireMockTest
-
- org.kohsuke.github.GHLicenseTest
-
public class GHLicenseTest extends AbstractGitHubWireMockTest
- Author:
- Duncan Dickinson
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.kohsuke.github.AbstractGitHubWireMockTest
AbstractGitHubWireMockTest.TemplatingHelper
-
-
Field Summary
-
Fields inherited from class org.kohsuke.github.AbstractGitHubWireMockTest
baseFilesClassPath, baseRecordPath, gitHub, mockGitHub, tempGitHubRepositories, templating, useDefaultGitHub
-
-
Constructor Summary
Constructors Constructor Description GHLicenseTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckRepositoryFullLicense()Accesses the 'kohsuke/github-api' repo usingGitHub.getRepository(String)and then callsGHRepository.getLicense()and checks that certain properties are correctvoidcheckRepositoryLicense()Accesses the 'kohsuke/github-api' repo usingGitHub.getRepository(String)and checks that the license is correctvoidcheckRepositoryLicenseAtom()Accesses the 'atom/atom' repo usingGitHub.getRepository(String)and checks that the license is correctvoidcheckRepositoryLicenseContent()Accesses the 'pomes/pomes' repo usingGitHub.getRepository(String)and then callsGHRepository.getLicenseContent()and checks that certain properties are correctvoidcheckRepositoryLicenseForIndeterminate()Accesses the 'bndtools/bnd' repo usingGitHub.getRepository(String)and then callsGHRepository.getLicense().voidcheckRepositoryLicensePomes()Accesses the 'pomes/pomes' repo usingGitHub.getRepository(String)and checks that the license is correctvoidcheckRepositoryWithoutLicense()Accesses the 'dedickinson/test-repo' repo usingGitHub.getRepository(String)and checks that *no* license is returned as the repo doesn't have onevoidgetLicense()Checks that the request for an individual license usingGitHub.getLicense(String)returns expected values (not all properties are checked)voidlistLicenses()Basic test to ensure that the list of licenses fromGitHub.listLicenses()is returnedvoidlistLicensesCheckIndividualLicense()Tests thatGitHub.listLicenses()returns the MIT license in the expected manner.-
Methods inherited from class org.kohsuke.github.AbstractGitHubWireMockTest
assertThat, assertThat, assertThat, cleanupRepository, cleanupTempRepositories, fail, fail, getGitHubBuilder, getNonRecordingGitHub, getTempRepository, getTempRepository, getUser, getUser, getWireMockOptions, kohsuke, requireProxy, snapshotNotAllowed, verifyAuthenticated, wireMockSetup
-
-
-
-
Method Detail
-
listLicenses
public void listLicenses() throws IOExceptionBasic test to ensure that the list of licenses fromGitHub.listLicenses()is returned- Throws:
IOException- if test fails
-
listLicensesCheckIndividualLicense
public void listLicensesCheckIndividualLicense() throws IOExceptionTests thatGitHub.listLicenses()returns the MIT license in the expected manner.- Throws:
IOException- if test fails
-
getLicense
public void getLicense() throws IOExceptionChecks that the request for an individual license usingGitHub.getLicense(String)returns expected values (not all properties are checked)- Throws:
IOException- if test fails
-
checkRepositoryLicense
public void checkRepositoryLicense() throws IOExceptionAccesses the 'kohsuke/github-api' repo usingGitHub.getRepository(String)and checks that the license is correct- Throws:
IOException- if test failss
-
checkRepositoryLicenseAtom
public void checkRepositoryLicenseAtom() throws IOExceptionAccesses the 'atom/atom' repo usingGitHub.getRepository(String)and checks that the license is correct- Throws:
IOException- if test fails
-
checkRepositoryLicensePomes
public void checkRepositoryLicensePomes() throws IOExceptionAccesses the 'pomes/pomes' repo usingGitHub.getRepository(String)and checks that the license is correct- Throws:
IOException- if test fails
-
checkRepositoryWithoutLicense
public void checkRepositoryWithoutLicense() throws IOExceptionAccesses the 'dedickinson/test-repo' repo usingGitHub.getRepository(String)and checks that *no* license is returned as the repo doesn't have one- Throws:
IOException- if test fails
-
checkRepositoryFullLicense
public void checkRepositoryFullLicense() throws IOExceptionAccesses the 'kohsuke/github-api' repo usingGitHub.getRepository(String)and then callsGHRepository.getLicense()and checks that certain properties are correct- Throws:
IOException- if test fails
-
checkRepositoryLicenseContent
public void checkRepositoryLicenseContent() throws IOExceptionAccesses the 'pomes/pomes' repo usingGitHub.getRepository(String)and then callsGHRepository.getLicenseContent()and checks that certain properties are correct- Throws:
IOException- if test fails
-
checkRepositoryLicenseForIndeterminate
public void checkRepositoryLicenseForIndeterminate() throws IOExceptionAccesses the 'bndtools/bnd' repo usingGitHub.getRepository(String)and then callsGHRepository.getLicense(). The description is null due to multiple licences- Throws:
IOException- if test fails
-
-