Package com.jcabi.github.mock
Class MkGitHub
java.lang.Object
com.jcabi.github.mock.MkGitHub
- All Implemented Interfaces:
GitHub
Mock GitHub client.
This is how you use it:
GitHub gitHub = new MkGitHub("username");
Repos.RepoCreate create = new Repos.RepoCreate("dummy", false);
Repo repo = gitHub.repos().create(create);
Issue issue = repo.issues().create("title", "body");
By default, it works with a temporary file, which will be deleted on JVM exit:
GitHub github = new MkGitHub("jeff");- Since:
- 0.5
- Suppressed Checkstyle violations:
- ClassDataAbstractionCoupling (500 lines)
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jcabi.github.GitHub
GitHub.Time -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.json.JsonObjectemojis()Get emojis.com.jcabi.http.Requestentry()RESTful request, an entry point to the GitHub API.gists()Get Gists API entry point.Get gitignores.limits()Rate limit API entry point.markdown()Get Markdown API entry point.jakarta.json.JsonObjectmeta()Get meta information.Get Organizations API entry point.Create repo with random name.Relogin.repos()Get repositories.search()Search API entry point.toString()users()Get Users API entry point.
-
Constructor Details
-
MkGitHub
Public ctor.- Throws:
IOException- If there is any I/O problem
-
MkGitHub
Public ctor.- Parameters:
login- User to login- Throws:
IOException- If there is any I/O problem
-
MkGitHub
Public ctor.- Parameters:
stg- Storagelogin- User to login
-
-
Method Details
-
toString
-
entry
public com.jcabi.http.Request entry()Description copied from interface:GitHubRESTful request, an entry point to the GitHub API. -
repos
Description copied from interface:GitHubGet repositories. -
gists
Description copied from interface:GitHubGet Gists API entry point. -
users
Description copied from interface:GitHubGet Users API entry point. -
organizations
Description copied from interface:GitHubGet Organizations API entry point.- Specified by:
organizationsin interfaceGitHub- Returns:
- Organizations API entry point
-
limits
Description copied from interface:GitHubRate limit API entry point. -
meta
public jakarta.json.JsonObject meta()Description copied from interface:GitHubGet meta information. -
search
Description copied from interface:GitHubSearch API entry point. -
gitignores
Description copied from interface:GitHubGet gitignores.- Specified by:
gitignoresin interfaceGitHub- Returns:
- Gitignotes API
- See Also:
-
emojis
public jakarta.json.JsonObject emojis()Description copied from interface:GitHubGet emojis. -
markdown
Description copied from interface:GitHubGet Markdown API entry point. -
relogin
Relogin.- Parameters:
login- User to login- Returns:
- GitHub
-
randomRepo
Create repo with random name.- Returns:
- Repo
- Throws:
IOException- If fails
-