use of com.google.copybara.exception.EmptyChangeException in project copybara by google.
the class GitHubPrOriginTest method gitResolveRequiredCheckRunsFail.
@Test
public void gitResolveRequiredCheckRunsFail() throws Exception {
MockPullRequest.create(gitUtil).setState("open").setPrNumber(125).addLabels("bar: yes").addCheckRun("foo/one", "success").addCheckRun("foo/two", "failure").mock();
EmptyChangeException thrown = assertThrows(EmptyChangeException.class, () -> checkResolve(githubPrOrigin("url = 'https://github.com/google/example'", "required_check_runs = ['foo/one', 'foo/two']"), sha, 125));
assertThat(thrown).hasMessageThat().contains("Cannot migrate http://github.com/google/example/pull/125 because the following check" + " runs have not been passed: [foo/two]");
}
use of com.google.copybara.exception.EmptyChangeException in project copybara by google.
the class GitHubPrOriginTest method testAlreadyClosed_only_closed.
@Test
public void testAlreadyClosed_only_closed() throws Exception {
MockPullRequest.create(gitUtil).setState("open").setPrNumber(125).addLabels("foo: yes").mock();
EmptyChangeException thrown = assertThrows(EmptyChangeException.class, () -> checkResolve(githubPrOrigin("url = 'https://github.com/google/example', state = 'CLOSED'"), "125", 125));
assertThat(thrown).hasMessageThat().contains("Pull Request 125 is open");
}
Aggregations