use of com.google.gerrit.entities.Change in project gerrit by GerritCodeReview.
the class EventJsonTest method changeAbandonedEvent.
@Test
public void changeAbandonedEvent() {
Change change = newChange();
ChangeAbandonedEvent event = new ChangeAbandonedEvent(change);
event.change = asChangeAttribute(change);
event.abandoner = newAccount("abandoner");
event.reason = "some reason";
assertThatJsonMap(event).isEqualTo(ImmutableMap.builder().put("abandoner", ImmutableMap.builder().put("name", event.abandoner.get().name).put("email", event.abandoner.get().email).put("username", event.abandoner.get().username).build()).put("reason", "some reason").put("change", ImmutableMap.builder().put("project", PROJECT).put("branch", BRANCH).put("id", CHANGE_ID).put("number", CHANGE_NUM_DOUBLE).put("url", URL).put("commitMessage", COMMIT_MESSAGE).put("createdOn", TS1).put("status", NEW.name()).build()).put("project", PROJECT).put("refName", REF).put("changeKey", map("id", CHANGE_ID)).put("type", "change-abandoned").put("eventCreatedOn", TS2).build());
}
use of com.google.gerrit.entities.Change in project gerrit by GerritCodeReview.
the class EventJsonTest method topicChangedEvent.
@Test
public void topicChangedEvent() {
Change change = newChange();
TopicChangedEvent event = new TopicChangedEvent(change);
event.change = asChangeAttribute(change);
assertThatJsonMap(event).isEqualTo(ImmutableMap.builder().put("change", ImmutableMap.builder().put("project", PROJECT).put("branch", BRANCH).put("id", CHANGE_ID).put("number", CHANGE_NUM_DOUBLE).put("url", URL).put("commitMessage", COMMIT_MESSAGE).put("createdOn", TS1).put("status", NEW.name()).build()).put("project", PROJECT).put("refName", REF).put("changeKey", map("id", CHANGE_ID)).put("type", "topic-changed").put("eventCreatedOn", TS2).build());
}
use of com.google.gerrit.entities.Change in project gerrit by GerritCodeReview.
the class EventJsonTest method patchSetCreatedEvent.
@Test
public void patchSetCreatedEvent() {
Change change = newChange();
PatchSetCreatedEvent event = new PatchSetCreatedEvent(change);
event.change = asChangeAttribute(change);
event.uploader = newAccount("uploader");
assertThatJsonMap(event).isEqualTo(ImmutableMap.builder().put("uploader", ImmutableMap.builder().put("name", event.uploader.get().name).put("email", event.uploader.get().email).put("username", event.uploader.get().username).build()).put("change", ImmutableMap.builder().put("project", PROJECT).put("branch", BRANCH).put("id", CHANGE_ID).put("number", CHANGE_NUM_DOUBLE).put("url", URL).put("commitMessage", COMMIT_MESSAGE).put("createdOn", TS1).put("status", NEW.name()).build()).put("project", PROJECT).put("refName", REF).put("changeKey", map("id", CHANGE_ID)).put("type", "patchset-created").put("eventCreatedOn", TS2).build());
}
use of com.google.gerrit.entities.Change in project gerrit by GerritCodeReview.
the class EventJsonTest method hashtagsChangedEvent.
@Test
public void hashtagsChangedEvent() {
Change change = newChange();
HashtagsChangedEvent event = new HashtagsChangedEvent(change);
event.change = asChangeAttribute(change);
event.editor = newAccount("editor");
event.added = new String[] { "added" };
event.removed = new String[] { "removed" };
event.hashtags = new String[] { "hashtags" };
assertThatJsonMap(event).isEqualTo(ImmutableMap.builder().put("editor", ImmutableMap.builder().put("name", event.editor.get().name).put("email", event.editor.get().email).put("username", event.editor.get().username).build()).put("added", list("added")).put("removed", list("removed")).put("hashtags", list("hashtags")).put("change", ImmutableMap.builder().put("project", PROJECT).put("branch", BRANCH).put("id", CHANGE_ID).put("number", CHANGE_NUM_DOUBLE).put("url", URL).put("commitMessage", COMMIT_MESSAGE).put("createdOn", TS1).put("status", NEW.name()).build()).put("project", PROJECT).put("refName", REF).put("changeKey", map("id", CHANGE_ID)).put("type", "hashtags-changed").put("eventCreatedOn", TS2).build());
}
use of com.google.gerrit.entities.Change in project gerrit by GerritCodeReview.
the class EventJsonTest method changeMergedEvent.
@Test
public void changeMergedEvent() {
Change change = newChange();
ChangeMergedEvent event = new ChangeMergedEvent(change);
event.change = asChangeAttribute(change);
assertThatJsonMap(event).isEqualTo(ImmutableMap.builder().put("change", ImmutableMap.builder().put("project", PROJECT).put("branch", BRANCH).put("id", CHANGE_ID).put("number", CHANGE_NUM_DOUBLE).put("url", URL).put("commitMessage", COMMIT_MESSAGE).put("createdOn", TS1).put("status", NEW.name()).build()).put("project", PROJECT).put("refName", REF).put("changeKey", map("id", CHANGE_ID)).put("type", "change-merged").put("eventCreatedOn", TS2).build());
}
Aggregations