Package com.jcabi.github

Examples of com.jcabi.github.Repo$Smart


     *
     * @throws Exception when a problem occurs.
     */
    @Test
    public void canGetComments() throws Exception {
        final Repo repo =  MkPullTest.repo();
        final Pull pull = repo.pulls().create("", "", "");
        MatcherAssert.assertThat(
            pull.comments(),
            Matchers.notNullValue()
        );
    }
View Full Code Here


     * MkReferences can iterate over references.
     * @throws Exception - If something goes wrong.
     */
    @Test
    public void iteratesReferences() throws Exception {
        final Repo owner = this.repo();
        final References refs = owner.git().references();
        refs.create("refs/heads/br", "qweqwe");
        refs.create("refs/tags/t1", "111t222");
        MatcherAssert.assertThat(
            refs.iterate(),
            Matchers.<Reference>iterableWithSize(2)
View Full Code Here

     * MkReferences can iterate over references in sub-namespace.
     * @throws Exception - If something goes wrong.
     */
    @Test
    public void iteratesReferencesInSubNamespace() throws Exception {
        final Repo owner = this.repo();
        final References refs = owner.git().references();
        refs.create("refs/heads/br", "qweqwe");
        refs.create("refs/tags/t1", "111t222");
        MatcherAssert.assertThat(
            refs.iterate("heads"),
            Matchers.<Reference>iterableWithSize(1)
View Full Code Here

     * MkReferences can iterate over references in Tagsub-namespace.
     * @throws Exception - If something goes wrong.
     */
    @Test
    public void iteratesTags() throws Exception {
        final Repo owner = this.repo();
        final References refs = owner.git().references();
        refs.create("refs/tags/t2", "2322f34");
        MatcherAssert.assertThat(
            refs.tags(),
            Matchers.<Reference>iterableWithSize(1)
        );
View Full Code Here

     * MkReferences can iterate over references in Tagsub-namespace.
     * @throws Exception - If something goes wrong.
     */
    @Test
    public void iteratesHeads() throws Exception {
        final Repo owner = this.repo();
        final References refs = owner.git().references();
        refs.create("refs/heads/branch2", "blahblah");
        MatcherAssert.assertThat(
            refs.heads(),
            Matchers.<Reference>iterableWithSize(1)
        );
View Full Code Here

     * MkReferences can remove a Reference.
     * @throws Exception - If something goes wrong.
     */
    @Test
    public void removesReference() throws Exception {
        final Repo owner = this.repo();
        final References refs = owner.git().references();
        refs.create("refs/heads/testbr", "qweqwe22");
        refs.create("refs/tags/t2", "111teee");
        MatcherAssert.assertThat(
            refs.iterate(),
            Matchers.<Reference>iterableWithSize(2)
View Full Code Here

     * MkLabels can list labels.
     * @throws Exception If some problem inside
     */
    @Test
    public void iteratesLabels() throws Exception {
        final Repo repo = this.repo();
        repo.labels().create("bug", "e0e0e0");
        MatcherAssert.assertThat(
            repo.labels().iterate(),
            Matchers.<Label>iterableWithSize(1)
        );
    }
View Full Code Here

     * MkLabels can delete labels.
     * @throws Exception If some problem inside
     */
    @Test
    public void deletesLabels() throws Exception {
        final Repo repo = this.repo();
        final Labels labels = repo.labels();
        final String name = "label-0";
        labels.create(name, "e1e1e1");
        final Issue issue = repo.issues().create("hey, you!", "");
        issue.labels().add(Collections.singletonList(name));
        labels.delete(name);
        MatcherAssert.assertThat(
            repo.labels().iterate(),
            Matchers.emptyIterable()
        );
        MatcherAssert.assertThat(
            issue.labels().iterate(),
            Matchers.emptyIterable()
View Full Code Here

     * MkLabels can set label color.
     * @throws Exception If some problem inside
     */
    @Test
    public void setsLabelColor() throws Exception {
        final Repo repo = this.repo();
        final String color = "f0f0f0";
        final String name = "task";
        repo.labels().create(name, color);
        MatcherAssert.assertThat(
            new Label.Smart(repo.labels().get(name)).color(),
            Matchers.equalTo(color)
        );
    }
View Full Code Here

     * MkGithub can work.
     * @throws Exception If some problem inside
     */
    @Test
    public void worksWithMockedData() throws Exception {
        final Repo repo = new MkGithub().repos().create(MkGithubTest.json());
        final Issue issue = repo.issues().create("hey", "how are you?");
        final Comment comment = issue.comments().post("hey, works?");
        MatcherAssert.assertThat(
            new Comment.Smart(comment).body(),
            Matchers.startsWith("hey, ")
        );
        MatcherAssert.assertThat(
            repo.issues().get(issue.number()).comments().iterate(),
            Matchers.<Comment>iterableWithSize(1)
        );
        MatcherAssert.assertThat(
            new User.Smart(new Comment.Smart(comment).author()).login(),
            Matchers.equalTo(
                new User.Smart(repo.github().users().self()).login()
            )
        );
    }
View Full Code Here

TOP

Related Classes of com.jcabi.github.Repo$Smart

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.