use of sonia.scm.NotFoundException in project scm-review-plugin by scm-manager.
the class PullRequestRootResourceTest method shouldHandleMissingBranch.
@Test
@SubjectAware(username = "slarti")
public void shouldHandleMissingBranch() throws URISyntaxException, IOException {
when(branchResolver.resolve(repository, "sourceBranch")).thenThrow(new NotFoundException("x", "y"));
byte[] pullRequestJson = loadJson("com/cloudogu/scm/review/pullRequest.json");
MockHttpRequest request = MockHttpRequest.post("/" + PullRequestRootResource.PULL_REQUESTS_PATH_V2 + "/" + REPOSITORY_NAMESPACE + "/" + REPOSITORY_NAME).content(pullRequestJson).contentType(PullRequestMediaType.PULL_REQUEST);
dispatcher.invoke(request, response);
assertThat(response.getContentAsString()).containsPattern("could not find.*");
}
Aggregations