package org.kohsuke.github;

import java.io.IOException;
import org.junit.Test;

/**
 * @author Martin van Zijl
 */
public class GHIssueEventTest extends AbstractGitHubApiTestBase {

    @Test
    public void testEventsForSingleIssue() throws Exception {
        GHRepository repo = getRepository();
        GHIssue issue = repo.getIssue(1);

        for (GHIssueEvent event : issue.listEvents()) {
            System.out.println(event);
        }

        //TODO: Use the following...
        //GHIssueBuilder builder = repo.createIssue("test from the api");
        //GHIssue issue = builder.create();
    }

    @Test
    public void testRepositoryEvents() throws Exception {
        GHRepository repo = getRepository();
        PagedIterable<GHIssueEvent> list = repo.listIssueEvents();

        for (GHIssueEvent event : list) {
            System.out.println(event);
        }
    }

    @Test
    public void testRepositorySingleEvent() throws Exception {
        GHRepository repo = getRepository();
        GHIssueEvent event = repo.getIssueEvent(2615868520L);

        System.out.println(event);
    }

    protected GHRepository getRepository() throws IOException {
        return getRepository(gitHub);
    }

    private GHRepository getRepository(GitHub gitHub) throws IOException {
        return gitHub.getOrganization("github-api-test-org").getRepository("github-api");
    }
}

@@ -332,24 +332,69 @@
 tIssue(1);%0A%0A
+        System.out.println(%22Single issue:%22);%0A
         for 
@@ -433,24 +433,24 @@
 Events()) %7B%0A
-
             
@@ -826,24 +826,92 @@
 eEvents();%0A%0A
+        System.out.println(%22Repository (all):%22);%0A        int i = 0;%0A
         for 
@@ -936,16 +936,25 @@
 t : list
+.asList()
 ) %7B%0A    
@@ -980,32 +980,65 @@
 println(event);%0A
+            if (i++ %3E 10) break;%0A
         %7D%0A    %7D%0A
@@ -1215,24 +1215,82 @@
 5868520L);%0A%0A
+        System.out.println(%22Repository (single event):%22);%0A
         Syst

Make unit test output neater.