use of com.google.gerrit.extensions.api.changes.HashtagsInput in project gerrit by GerritCodeReview.
the class HashtagsIT method addHashtags.
private void addHashtags(PushOneCommit.Result r, String... toAdd) throws Exception {
HashtagsInput input = new HashtagsInput();
input.add = Sets.newHashSet(toAdd);
change(r).setHashtags(input);
}
use of com.google.gerrit.extensions.api.changes.HashtagsInput in project gerrit by GerritCodeReview.
the class HashtagsIT method removeHashtags.
private void removeHashtags(PushOneCommit.Result r, String... toRemove) throws Exception {
HashtagsInput input = new HashtagsInput();
input.remove = Sets.newHashSet(toRemove);
change(r).setHashtags(input);
}
use of com.google.gerrit.extensions.api.changes.HashtagsInput in project gerrit by GerritCodeReview.
the class AbstractQueryChangesTest method addHashtags.
private void addHashtags(Change.Id changeId, String... hashtags) throws Exception {
HashtagsInput in = new HashtagsInput();
in.add = ImmutableSet.copyOf(hashtags);
gApi.changes().id(changeId.get()).setHashtags(in);
}
use of com.google.gerrit.extensions.api.changes.HashtagsInput in project gerrit by GerritCodeReview.
the class AttentionSetIT method reviewersAreNotAddedForNoReasonBecauseOfAnUpdate.
@Test
public void reviewersAreNotAddedForNoReasonBecauseOfAnUpdate() throws Exception {
PushOneCommit.Result r = createChange();
// implictly adds the user to the attention set when adding as reviewer
change(r).addReviewer(user.email());
change(r).attention(user.id().toString()).remove(new AttentionSetInput("removed"));
HashtagsInput hashtagsInput = new HashtagsInput();
hashtagsInput.add = ImmutableSet.of("tag");
change(r).setHashtags(hashtagsInput);
AttentionSetUpdate attentionSet = Iterables.getOnlyElement(r.getChange().attentionSet());
assertThat(attentionSet).hasAccountIdThat().isEqualTo(user.id());
assertThat(attentionSet).hasOperationThat().isEqualTo(AttentionSetUpdate.Operation.REMOVE);
assertThat(attentionSet).hasReasonThat().isEqualTo("removed");
}
use of com.google.gerrit.extensions.api.changes.HashtagsInput in project gerrit by GerritCodeReview.
the class GetMetaDiffIT method metaDiff.
@Test
public void metaDiff() throws Exception {
PushOneCommit.Result ch = createChange();
ChangeApi chApi = gApi.changes().id(ch.getChangeId());
chApi.topic(TOPIC);
ChangeInfo oldInfo = chApi.get();
chApi.topic(TOPIC + "-2");
chApi.setHashtags(new HashtagsInput(ImmutableSet.of(HASHTAG)));
ChangeInfo newInfo = chApi.get();
ChangeInfoDifference difference = chApi.metaDiff(oldInfo.metaRevId, newInfo.metaRevId);
assertThat(difference.added().topic).isEqualTo(newInfo.topic);
assertThat(difference.added().hashtags).isNotNull();
assertThat(difference.added().hashtags).containsExactly(HASHTAG);
assertThat(difference.removed().topic).isEqualTo(oldInfo.topic);
assertThat(difference.removed().hashtags).isNull();
}
Aggregations