Search in sources :

Example 1 with TeamAddPayload

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

the class IconAndViewTextManager method formatTeamAdd.

void formatTeamAdd(GitHubEvent event, StyledText main, StyledText details) {
    boldActor(main, event);
    main.append(" added ");
    TeamAddPayload payload = (TeamAddPayload) event.payload();
    Repository repo = payload.repository();
    String repoName = repo != null ? repo.name() : null;
    if (repoName != null) {
        main.bold(repoName);
    }
    main.append(" to team");
    Team team = payload.team();
    String teamName = team != null ? team.name() : null;
    if (teamName != null) {
        main.append(' ').bold(teamName);
    }
}
Also used : Repository(com.meisolsson.githubsdk.model.Repository) TeamAddPayload(com.meisolsson.githubsdk.model.payload.TeamAddPayload) Team(com.meisolsson.githubsdk.model.Team)

Example 2 with TeamAddPayload

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

the class NewsEventTextTest method testTeamAdd.

/**
     * Verify text of push event
     */
@UiThreadTest
public void testTeamAdd() {
    Team team = Team.builder().name("t1").build();
    Repository repo = Repository.builder().name("r2").build();
    TeamAddPayload payload = TeamAddPayload.builder().repository(repo).team(team).build();
    GitHubEvent event = createEvent(GitHubEventType.TeamAddEvent, payload);
    updateView(event);
    verify("user added r2 to team t1");
}
Also used : Repository(com.meisolsson.githubsdk.model.Repository) TeamAddPayload(com.meisolsson.githubsdk.model.payload.TeamAddPayload) Team(com.meisolsson.githubsdk.model.Team) GitHubEvent(com.meisolsson.githubsdk.model.GitHubEvent) UiThreadTest(android.test.UiThreadTest)

Aggregations

Repository (com.meisolsson.githubsdk.model.Repository)2 Team (com.meisolsson.githubsdk.model.Team)2 TeamAddPayload (com.meisolsson.githubsdk.model.payload.TeamAddPayload)2 UiThreadTest (android.test.UiThreadTest)1 GitHubEvent (com.meisolsson.githubsdk.model.GitHubEvent)1