use of com.github.sdorra.shiro.SubjectAware in project scm-review-plugin by scm-manager.
the class PullRequestRootResourceTest method shouldGetMarkAsReviewedLink.
@Test
@SubjectAware(username = "dent")
public void shouldGetMarkAsReviewedLink() throws URISyntaxException, IOException {
PullRequest pullRequest = createPullRequest();
when(store.get("1")).thenReturn(pullRequest);
MockHttpRequest request = MockHttpRequest.get("/" + PullRequestRootResource.PULL_REQUESTS_PATH_V2 + "/ns/repo/1");
dispatcher.invoke(request, response);
assertThat(response.getStatus()).isEqualTo(200);
ObjectMapper mapper = new ObjectMapper();
JsonNode jsonNode = mapper.readValue(response.getContentAsString(), JsonNode.class);
assertThat(jsonNode.path("_links").get("reviewMark")).isNotNull();
}
Aggregations