Skip to content

jac1013/jcabi-github

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

More details are here: github.jcabi.com

Set of classes in com.jcabi.github package is an object oriented API of Github:

public class Main {
  public static void main(String[] args) {
    Github github = new RtGithub(".. your OAuth token ..");
    Repo repo = github.repo("jcabi/jcabi-github");
    Issue issue = repo.issues().create("How are you?", "Please tell me...");
    issue.post("My first comment!");
  }
}

We also provide MkGithub, a mock version of Github server, which you can use in unit tests, for example:

public class FooTest {
  public void submitsCommentToGithubIssue() {
    final Repo repo = new MkGithub().repos().create(
      Json.createObjectBuilder().add("name", "test").build()
    );
    final Issue issue = repo.issues().create("how are you?", "");
    new Foo(issue).doSomething(); // should post a message to the issue
    MasterAssert.assertThat(
      issue.comments().iterate(),
      Matchers.iterableWithSize(1)
    );
  }
}

You need just this dependency:

<dependency>
  <groupId>com.jcabi</groupId>
  <artifactId>jcabi-github</artifactId>
  <version>0.7</version>
</dependency>

Questions?

If you have any questions about the framework, or something doesn't work as expected, please submit an issue here. If you want to discuss, please use our Google Group.

How to contribute?

Fork the repository, make changes, submit a pull request. We promise to review your changes same day and apply to the master branch, if they look correct.

Please run Maven build before submitting a pull request:

$ mvn clean install -Pqulice

There are many integration tests that check our classes against live Github accounts. In order to run them, you should create a new Github OAuth access token (how?), and provide it in command line, like this:

$ mvn clean install -Dit.test=RtGistITCase -Dfailsafe.github.key=<token> -Dfailsafe.github.repo=<repo>

Replace <token> with the OAuth access token, and <repo> with the name of repository you create in your account (for test purposes only), for example yegor256/test.

About

Object Oriented Wrapper of Github API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%