java.lang.Object
org.kohsuke.github.AbstractGitHubWireMockTest
- Direct Known Subclasses:
AbstractGHAppInstallationTest,AbuseLimitHandlerTest,AppTest,AuthorizationTokenRefreshTest,CommitTest,DefaultGitHubConnectorTest,EnterpriseManagedSupportTest,EnumTest,GHAppExtendedTest,GHAutolinkTest,GHBranchProtectionTest,GHBranchTest,GHCodeownersErrorTest,GHContentIntegrationTest,GHDeployKeyTest,GHDeploymentTest,GHDiscussionTest,GHEventPayloadTest,GHExternalGroupTest,GHGistTest,GHGistUpdaterTest,GHIssueEventAttributeTest,GHIssueEventTest,GHIssueTest,GHLicenseTest,GHMarketplacePlanTest,GHMilestoneTest,GHObjectTest,GHOrganizationTest,GHPersonTest,GHProjectCardTest,GHProjectColumnTest,GHProjectTest,GHPublicKeyTest,GHPullRequestTest,GHRateLimitTest,GHReleaseTest,GHRepositoryForkBuilderTest,GHRepositoryStatisticsTest,GHRepositoryTest,GHTagTest,GHTeamBuilderTest,GHTeamTest,GHTreeBuilderTest,GHUserTest,GHVerificationReasonTest,GHWorkflowRunTest,GHWorkflowTest,Github2faTest,GitHubCachingTest,GitHubConnectionTest,GitHubConnectorResponseTest,GitHubStaticTest,GitHubTest,LifecycleTest,OkHttpGitHubConnectorTest,RateLimitCheckerTest,RateLimitHandlerTest,RepositoryTrafficTest,RequesterRetryTest,WireMockStatusReporterTest
The Class AbstractGitHubWireMockTest.
- Author:
- Liam Newman
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classThe Class TemplatingHelper. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StringThe base files class path.protected final StringThe base record path.protected GitHubGitHubinstance for use during test.final GitHubWireMockRuleThe mock git hub.The temp git hub repositories.protected final AbstractGitHubWireMockTest.TemplatingHelperThe templating.protected booleanThe use default git hub. -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new abstract git hub wire mock test. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertThat(String reason, boolean assertion) Assert that.static <T> voidassertThat(String reason, T actual, org.hamcrest.Matcher<? super T> matcher) Assert that.static <T> voidassertThat(T actual, org.hamcrest.Matcher<? super T> matcher) Assert that.protected voidcleanupRepository(String fullName) Cleanup repository.voidCleanup temp repositories.static voidfail()Fail.static voidFail.protected GitHubBuilderGets the git hub builder.GitHubinstance for use before/after test.protected GHRepositoryCreates a temporary repository that will be deleted at the end of the test.protected GHRepositorygetTempRepository(String name) Creates a temporary repository that will be deleted at the end of the test.protected GHUsergetUser()Gets the user.protected static GHUserGets the user.protected com.github.tomakehurst.wiremock.core.WireMockConfigurationGets the wire mock options.protected voidkohsuke()Kohsuke.protected voidrequireProxy(String reason) Require proxy.protected voidSnapshot not allowed.protected voidverifyAuthenticated(GitHub instance) Verify authenticated.voidWire mock setup.
-
Field Details
-
mockGitHub
The mock git hub. -
baseFilesClassPath
The base files class path. -
baseRecordPath
The base record path. -
gitHub
GitHubinstance for use during test. Traffic will be part of snapshot when taken. -
tempGitHubRepositories
The temp git hub repositories. -
templating
The templating. -
useDefaultGitHub
protected boolean useDefaultGitHubThe use default git hub.
-
-
Constructor Details
-
AbstractGitHubWireMockTest
public AbstractGitHubWireMockTest()Instantiates a new abstract git hub wire mock test.
-
-
Method Details
-
assertThat
Assert that.- Type Parameters:
T- the generic type- Parameters:
reason- the reasonactual- the actualmatcher- the matcher
-
assertThat
Assert that.- Parameters:
reason- the reasonassertion- the assertion
-
assertThat
public static <T> void assertThat(T actual, org.hamcrest.Matcher<? super T> matcher) Assert that.- Type Parameters:
T- the generic type- Parameters:
actual- the actualmatcher- the matcher
-
fail
public static void fail()Fail. -
fail
Fail.- Parameters:
reason- the reason
-
getUser
Gets the user.- Parameters:
gitHub- the git hub- Returns:
- the user
-
cleanupTempRepositories
Cleanup temp repositories.- Throws:
IOException- Signals that an I/O exception has occurred.
-
getNonRecordingGitHub
GitHubinstance for use before/after test. Traffic will not be part of snapshot when taken. Should only be used when isUseProxy() or isTakeSnapShot().- Returns:
- a github instance after checking Authentication
-
wireMockSetup
Wire mock setup.- Throws:
Exception- the exception
-
cleanupRepository
Cleanup repository.- Parameters:
fullName- the full name- Throws:
IOException- Signals that an I/O exception has occurred.
-
getGitHubBuilder
Gets the git hub builder.- Returns:
- the git hub builder
-
getTempRepository
Creates a temporary repository that will be deleted at the end of the test. Repository name is based on the current test method.- Returns:
- a temporary repository
- Throws:
IOException- if repository could not be created or retrieved.
-
getTempRepository
Creates a temporary repository that will be deleted at the end of the test.- Parameters:
name- string name of the repository- Returns:
- a temporary repository
- Throws:
IOException- if repository could not be created or retrieved.
-
getUser
Gets the user.- Returns:
- the user
-
getWireMockOptions
protected com.github.tomakehurst.wiremock.core.WireMockConfiguration getWireMockOptions()Gets the wire mock options.- Returns:
- the wire mock options
-
kohsuke
protected void kohsuke()Kohsuke. -
requireProxy
Require proxy.- Parameters:
reason- the reason
-
snapshotNotAllowed
protected void snapshotNotAllowed()Snapshot not allowed. -
verifyAuthenticated
Verify authenticated.- Parameters:
instance- the instance
-