Search in sources :

Example 1 with AutoCloseableChangesCheckInput

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

the class CheckProjectIT method noBranch.

@Test
public void noBranch() throws Exception {
    CheckProjectInput input = new CheckProjectInput();
    input.autoCloseableChangesCheck = new AutoCloseableChangesCheckInput();
    BadRequestException thrown = assertThrows(BadRequestException.class, () -> gApi.projects().name(project.get()).check(input));
    assertThat(thrown).hasMessageThat().contains("branch is required");
}
Also used : BadRequestException(com.google.gerrit.extensions.restapi.BadRequestException) CheckProjectInput(com.google.gerrit.extensions.api.projects.CheckProjectInput) AutoCloseableChangesCheckInput(com.google.gerrit.extensions.api.projects.CheckProjectInput.AutoCloseableChangesCheckInput) Test(org.junit.Test) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest)

Example 2 with AutoCloseableChangesCheckInput

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

the class CheckProjectIT method checkProjectInputForAutoCloseableCheck.

private static CheckProjectInput checkProjectInputForAutoCloseableCheck(String branch) {
    CheckProjectInput input = new CheckProjectInput();
    input.autoCloseableChangesCheck = new AutoCloseableChangesCheckInput();
    input.autoCloseableChangesCheck.branch = branch;
    return input;
}
Also used : CheckProjectInput(com.google.gerrit.extensions.api.projects.CheckProjectInput) AutoCloseableChangesCheckInput(com.google.gerrit.extensions.api.projects.CheckProjectInput.AutoCloseableChangesCheckInput)

Aggregations

CheckProjectInput (com.google.gerrit.extensions.api.projects.CheckProjectInput)2 AutoCloseableChangesCheckInput (com.google.gerrit.extensions.api.projects.CheckProjectInput.AutoCloseableChangesCheckInput)2 AbstractDaemonTest (com.google.gerrit.acceptance.AbstractDaemonTest)1 BadRequestException (com.google.gerrit.extensions.restapi.BadRequestException)1 Test (org.junit.Test)1