Search in sources :

Example 6 with DeleteBranchesInput

use of com.google.gerrit.extensions.api.projects.DeleteBranchesInput in project gerrit by GerritCodeReview.

the class DeleteBranchesIT method deleteBranches.

@Test
public void deleteBranches() throws Exception {
    HashMap<String, RevCommit> initialRevisions = initialRevisions(BRANCHES);
    DeleteBranchesInput input = new DeleteBranchesInput();
    input.branches = BRANCHES;
    project().deleteBranches(input);
    assertBranchesDeleted();
    assertRefUpdatedEvents(initialRevisions);
}
Also used : DeleteBranchesInput(com.google.gerrit.extensions.api.projects.DeleteBranchesInput) RevCommit(org.eclipse.jgit.revwalk.RevCommit) Test(org.junit.Test) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest)

Example 7 with DeleteBranchesInput

use of com.google.gerrit.extensions.api.projects.DeleteBranchesInput in project gerrit by GerritCodeReview.

the class DeleteBranchesIT method missingInput.

@Test
public void missingInput() throws Exception {
    DeleteBranchesInput input = null;
    exception.expect(BadRequestException.class);
    exception.expectMessage("branches must be specified");
    project().deleteBranches(input);
}
Also used : DeleteBranchesInput(com.google.gerrit.extensions.api.projects.DeleteBranchesInput) Test(org.junit.Test) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest)

Aggregations

AbstractDaemonTest (com.google.gerrit.acceptance.AbstractDaemonTest)7 DeleteBranchesInput (com.google.gerrit.extensions.api.projects.DeleteBranchesInput)7 Test (org.junit.Test)7 ResourceConflictException (com.google.gerrit.extensions.restapi.ResourceConflictException)3 RevCommit (org.eclipse.jgit.revwalk.RevCommit)1