java.lang.Object
org.kohsuke.github.AbstractGitHubWireMockTest
org.kohsuke.github.GHLicenseTest
The Class GHLicenseTest.
- 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Accesses the 'kohsuke/github-api' repo usingGitHub.getRepository(String)
and then callsGHRepository.getLicense()
and checks that certain properties are correct.void
Accesses the 'kohsuke/github-api' repo usingGitHub.getRepository(String)
and checks that the license is correct.void
Accesses the 'atom/atom' repo usingGitHub.getRepository(String)
and checks that the license is correct.void
Accesses the 'pomes/pomes' repo usingGitHub.getRepository(String)
and then callsGHRepository.getLicenseContent()
and checks that certain properties are correct.void
Accesses the 'bndtools/bnd' repo usingGitHub.getRepository(String)
and then callsGHRepository.getLicense()
.void
Accesses the 'pomes/pomes' repo usingGitHub.getRepository(String)
and checks that the license is correct.void
Accesses the 'dedickinson/test-repo' repo usingGitHub.getRepository(String)
and checks that *no* license is returned as the repo doesn't have one.void
Checks that the request for an individual license usingGitHub.getLicense(String)
returns expected values (not all properties are checked).void
Basic test to ensure that the list of licenses fromGitHub.listLicenses()
is returned.void
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
-
Constructor Details
-
GHLicenseTest
public GHLicenseTest()Create default GHLicenseTest instance
-
-
Method Details
-
listLicenses
Basic test to ensure that the list of licenses fromGitHub.listLicenses()
is returned.- Throws:
IOException
- if test fails
-
listLicensesCheckIndividualLicense
Tests thatGitHub.listLicenses()
returns the MIT license in the expected manner.- Throws:
IOException
- if test fails
-
getLicense
Checks that the request for an individual license usingGitHub.getLicense(String)
returns expected values (not all properties are checked).- Throws:
IOException
- if test fails
-
checkRepositoryLicense
Accesses the 'kohsuke/github-api' repo usingGitHub.getRepository(String)
and checks that the license is correct.- Throws:
IOException
- if test failss
-
checkRepositoryLicenseAtom
Accesses the 'atom/atom' repo usingGitHub.getRepository(String)
and checks that the license is correct.- Throws:
IOException
- if test fails
-
checkRepositoryLicensePomes
Accesses the 'pomes/pomes' repo usingGitHub.getRepository(String)
and checks that the license is correct.- Throws:
IOException
- if test fails
-
checkRepositoryWithoutLicense
Accesses 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
Accesses 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
Accesses the 'pomes/pomes' repo usingGitHub.getRepository(String)
and then callsGHRepository.getLicenseContent()
and checks that certain properties are correct.- Throws:
IOException
- if test fails
-
checkRepositoryLicenseForIndeterminate
Accesses the 'bndtools/bnd' repo usingGitHub.getRepository(String)
and then callsGHRepository.getLicense()
. The description is null due to multiple licences- Throws:
IOException
- if test fails
-