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.JsonObject
emojis()
Get emojis.com.jcabi.http.Request
entry()
RESTful request, an entry point to the Github API.Gists
gists()
Get Gists API entry point.Gitignores
gitignores()
Get gitignores.Limits
limits()
Rate limit API entry point.Markdown
markdown()
Get Markdown API entry point.javax.json.JsonObject
meta()
Get meta information.Organizations
organizations()
Get Organizations API entry point.Repo
randomRepo()
Create repo with random name.Github
relogin(String login)
Relogin.Repos
repos()
Get repositories.Search
search()
Search API entry point.String
toString()
Users
users()
Get Users API entry point.
-
-
-
Constructor Detail
-
MkGithub
public MkGithub() throws IOException
Public 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:Github
RESTful request, an entry point to the Github API.
-
organizations
public Organizations organizations()
Description copied from interface:Github
Get Organizations API entry point.- Specified by:
organizations
in interfaceGithub
- Returns:
- Organizations API entry point
-
meta
public javax.json.JsonObject meta()
Description copied from interface:Github
Get meta information.
-
gitignores
public Gitignores gitignores() throws IOException
Description copied from interface:Github
Get gitignores.- Specified by:
gitignores
in 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:Github
Get emojis.- Specified by:
emojis
in interfaceGithub
- Returns:
- JSON with emojis
- See Also:
- Emojis API
-
markdown
public Markdown markdown()
Description copied from interface:Github
Get 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
-
-