Search in sources :

Example 16 with GitHubEvent

use of com.meisolsson.githubsdk.model.GitHubEvent in project PocketHub by pockethub.

the class NewsEventTextTest method testPullRequest.

/**
 * Verify text of pull request event
 */
@UiThreadTest
public void testPullRequest() {
    PullRequestPayload payload = PullRequestPayload.builder().number(30).action(PullRequestPayload.Action.Closed).build();
    GitHubEvent event = createEvent(GitHubEventType.PullRequestEvent, payload);
    updateView(event);
    verify("user closed pull request 30 on user/repo");
}
Also used : PullRequestPayload(com.meisolsson.githubsdk.model.payload.PullRequestPayload) GitHubEvent(com.meisolsson.githubsdk.model.GitHubEvent) UiThreadTest(android.test.UiThreadTest)

Example 17 with GitHubEvent

use of com.meisolsson.githubsdk.model.GitHubEvent in project PocketHub by pockethub.

the class NewsEventTextTest method testCommitCommentEvent.

/**
 * Verify text of commit comment event
 */
@UiThreadTest
public void testCommitCommentEvent() {
    GitHubEvent event = createEvent(GitHubEventType.CommitCommentEvent, CommitCommentPayload.builder().build());
    updateView(event);
    verify("user commented on user/repo");
}
Also used : GitHubEvent(com.meisolsson.githubsdk.model.GitHubEvent) UiThreadTest(android.test.UiThreadTest)

Example 18 with GitHubEvent

use of com.meisolsson.githubsdk.model.GitHubEvent in project PocketHub by pockethub.

the class NewsEventTextTest method testDelete.

/**
 * Verify text of delete event
 */
@UiThreadTest
public void testDelete() {
    DeletePayload payload = DeletePayload.builder().refType(ReferenceType.Branch).ref("b1").build();
    GitHubEvent event = createEvent(GitHubEventType.DeleteEvent, payload);
    updateView(event);
    verify("user deleted branch b1 at user/repo");
}
Also used : DeletePayload(com.meisolsson.githubsdk.model.payload.DeletePayload) GitHubEvent(com.meisolsson.githubsdk.model.GitHubEvent) UiThreadTest(android.test.UiThreadTest)

Example 19 with GitHubEvent

use of com.meisolsson.githubsdk.model.GitHubEvent in project PocketHub by pockethub.

the class NewsEventTextTest method testGist.

/**
 * Verify text of Gist event
 */
@UiThreadTest
public void testGist() {
    Gist gist = Gist.builder().id("1").build();
    GistPayload payload = GistPayload.builder().action(GistPayload.Action.Created).gist(gist).build();
    GitHubEvent event = createEvent(GitHubEventType.GistEvent, payload);
    updateView(event);
    verify("user created Gist 1");
}
Also used : Gist(com.meisolsson.githubsdk.model.Gist) GistPayload(com.meisolsson.githubsdk.model.payload.GistPayload) GitHubEvent(com.meisolsson.githubsdk.model.GitHubEvent) UiThreadTest(android.test.UiThreadTest)

Example 20 with GitHubEvent

use of com.meisolsson.githubsdk.model.GitHubEvent in project PocketHub by pockethub.

the class NewsEventTextTest method testFollow.

/**
 * Verify text of follow event
 */
@UiThreadTest
public void testFollow() {
    User target = User.builder().login("user2").build();
    FollowPayload payload = FollowPayload.builder().target(target).build();
    GitHubEvent event = createEvent(GitHubEventType.FollowEvent, payload);
    updateView(event);
    verify("user started following user2");
}
Also used : User(com.meisolsson.githubsdk.model.User) FollowPayload(com.meisolsson.githubsdk.model.payload.FollowPayload) GitHubEvent(com.meisolsson.githubsdk.model.GitHubEvent) UiThreadTest(android.test.UiThreadTest)

Aggregations

GitHubEvent (com.meisolsson.githubsdk.model.GitHubEvent)43 Test (org.junit.Test)18 UiThreadTest (android.test.UiThreadTest)15 Repository (com.meisolsson.githubsdk.model.Repository)9 User (com.meisolsson.githubsdk.model.User)8 IssuesPayload (com.meisolsson.githubsdk.model.payload.IssuesPayload)8 Issue (com.meisolsson.githubsdk.model.Issue)6 CreatePayload (com.meisolsson.githubsdk.model.payload.CreatePayload)5 FollowPayload (com.meisolsson.githubsdk.model.payload.FollowPayload)5 IssueCommentPayload (com.meisolsson.githubsdk.model.payload.IssueCommentPayload)5 PullRequestPayload (com.meisolsson.githubsdk.model.payload.PullRequestPayload)5 PushPayload (com.meisolsson.githubsdk.model.payload.PushPayload)5 CommitCommentPayload (com.meisolsson.githubsdk.model.payload.CommitCommentPayload)4 DownloadPayload (com.meisolsson.githubsdk.model.payload.DownloadPayload)4 ForkPayload (com.meisolsson.githubsdk.model.payload.ForkPayload)4 GistPayload (com.meisolsson.githubsdk.model.payload.GistPayload)4 GollumPayload (com.meisolsson.githubsdk.model.payload.GollumPayload)4 ReleasePayload (com.meisolsson.githubsdk.model.payload.ReleasePayload)4 List (java.util.List)4 View (android.view.View)3