use of com.google.gerrit.extensions.api.projects.DeleteTagsInput in project gerrit by GerritCodeReview.
the class DeleteTagsIT method deleteTagsNotFoundContinue.
@Test
public void deleteTagsNotFoundContinue() throws Exception {
// If it fails on the first tag in the input, it should still
// continue to process the remaining tags.
DeleteTagsInput input = new DeleteTagsInput();
List<String> tags = Lists.newArrayList("refs/tags/does-not-exist");
tags.addAll(TAGS);
input.tags = tags;
try {
project().deleteTags(input);
fail("Expected ResourceConflictException");
} catch (ResourceConflictException e) {
assertThat(e).hasMessageThat().isEqualTo(errorMessageForTags(ImmutableList.of("refs/tags/does-not-exist")));
}
assertTagsDeleted();
}
use of com.google.gerrit.extensions.api.projects.DeleteTagsInput in project gerrit by GerritCodeReview.
the class DeleteTagsIT method deleteTags.
@Test
public void deleteTags() throws Exception {
HashMap<String, RevCommit> initialRevisions = initialRevisions(TAGS);
DeleteTagsInput input = new DeleteTagsInput();
input.tags = TAGS;
project().deleteTags(input);
assertTagsDeleted();
assertRefUpdatedEvents(initialRevisions);
}
use of com.google.gerrit.extensions.api.projects.DeleteTagsInput in project gerrit by GerritCodeReview.
the class DeleteTagsIT method deleteTagsForbidden.
@Test
public void deleteTagsForbidden() throws Exception {
DeleteTagsInput input = new DeleteTagsInput();
input.tags = TAGS;
setApiUser(user);
try {
project().deleteTags(input);
fail("Expected ResourceConflictException");
} catch (ResourceConflictException e) {
assertThat(e).hasMessageThat().isEqualTo(errorMessageForTags(TAGS));
}
setApiUser(admin);
assertTags(TAGS);
}
use of com.google.gerrit.extensions.api.projects.DeleteTagsInput in project gerrit by GerritCodeReview.
the class DeleteTagsIT method deleteTagsNotFound.
@Test
public void deleteTagsNotFound() throws Exception {
DeleteTagsInput input = new DeleteTagsInput();
List<String> tags = Lists.newArrayList(TAGS);
tags.add("refs/tags/does-not-exist");
input.tags = tags;
try {
project().deleteTags(input);
fail("Expected ResourceConflictException");
} catch (ResourceConflictException e) {
assertThat(e).hasMessageThat().isEqualTo(errorMessageForTags(ImmutableList.of("refs/tags/does-not-exist")));
}
assertTagsDeleted();
}
Aggregations