Package com.jcabi.github.mock
Class MkGithub
- java.lang.Object
-
- com.jcabi.github.mock.MkGithub
-
- All Implemented Interfaces:
Github
@Immutable @Loggable(1) public final class MkGithub extends Object implements 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
- Version:
- $Id: 6c637fcb5975d327bffb218d61f3e433960bd45e $
- Author:
- Yegor Bugayenko (yegor256@gmail.com)
- Suppressed Checkstyle violations:
- ClassDataAbstractionCoupling (500 lines)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jcabi.github.Github
Github.Time
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.json.JsonObjectemojis()Get emojis.com.jcabi.http.Requestentry()RESTful request, an entry point to the Github API.Gistsgists()Get Gists API entry point.Gitignoresgitignores()Get gitignores.Limitslimits()Rate limit API entry point.Markdownmarkdown()Get Markdown API entry point.javax.json.JsonObjectmeta()Get meta information.Organizationsorganizations()Get Organizations API entry point.ReporandomRepo()Create repo with random name.Githubrelogin(String login)Relogin.Reposrepos()Get repositories.Searchsearch()Search API entry point.StringtoString()Usersusers()Get Users API entry point.
-
-
-
Constructor Detail
-
MkGithub
public MkGithub() throws IOExceptionPublic ctor.- Throws:
IOException- If there is any I/O problem
-
MkGithub
public MkGithub(String login) throws IOException
Public ctor.- Parameters:
login- User to login- Throws:
IOException- If there is any I/O problem
-
-
Method Detail
-
entry
public com.jcabi.http.Request entry()
Description copied from interface:GithubRESTful request, an entry point to the Github API.
-
organizations
public Organizations organizations()
Description copied from interface:GithubGet Organizations API entry point.- Specified by:
organizationsin interfaceGithub- Returns:
- Organizations API entry point
-
meta
public javax.json.JsonObject meta()
Description copied from interface:GithubGet meta information.
-
gitignores
public Gitignores gitignores() throws IOException
Description copied from interface:GithubGet gitignores.- Specified by:
gitignoresin interfaceGithub- Returns:
- Gitignotes API
- Throws:
IOException- If there is any I/O problem- See Also:
- Gitignore API
-
emojis
public javax.json.JsonObject emojis()
Description copied from interface:GithubGet emojis.- Specified by:
emojisin interfaceGithub- Returns:
- JSON with emojis
- See Also:
- Emojis API
-
markdown
public Markdown markdown()
Description copied from interface:GithubGet Markdown API entry point.
-
relogin
public Github relogin(String login) throws IOException
Relogin.- Parameters:
login- User to login- Returns:
- Github
- Throws:
IOException- If there is any I/O problem
-
randomRepo
public Repo randomRepo() throws IOException
Create repo with random name.- Returns:
- Repo
- Throws:
IOException- If fails
-
-