use of com.cloudogu.scm.review.pullrequest.service.PullRequest in project scm-review-plugin by scm-manager.
the class PullRequestMapperTest method shouldMapPullRequestReviser.
@Test
void shouldMapPullRequestReviser() {
PullRequest pullRequest = TestData.createPullRequest();
pullRequest.setReviser("trillian");
PullRequestDto dto = mapper.map(pullRequest, REPOSITORY);
assertThat(dto.getReviser().getDisplayName()).isEqualTo("trillian");
}
use of com.cloudogu.scm.review.pullrequest.service.PullRequest in project scm-review-plugin by scm-manager.
the class PullRequestMapperTest method shouldMapPullRequestApprover.
@Test
void shouldMapPullRequestApprover() {
PullRequest pullRequest = TestData.createPullRequest();
pullRequest.addApprover("deletedUser");
PullRequestDto dto = mapper.map(pullRequest, REPOSITORY);
assertThat(dto.getReviewer()).extracting("id").containsExactly("deletedUser");
}
use of com.cloudogu.scm.review.pullrequest.service.PullRequest in project scm-review-plugin by scm-manager.
the class PullRequestMapperTest method shouldNotAddLinkForWorkflowResultIfPullRequestIsMerged.
@Test
void shouldNotAddLinkForWorkflowResultIfPullRequestIsMerged() {
PullRequest pullRequest = TestData.createPullRequest();
pullRequest.setStatus(PullRequestStatus.MERGED);
PullRequestDto dto = mapper.map(pullRequest, REPOSITORY);
assertThat(dto.getLinks().getLinkBy("workflowResult")).isEmpty();
}
use of com.cloudogu.scm.review.pullrequest.service.PullRequest in project scm-review-plugin by scm-manager.
the class MyOpenTasksTest method createPullRequest.
private static PullRequest createPullRequest(String id, PullRequestStatus status, String author) {
PullRequest existingPullRequest = new PullRequest();
existingPullRequest.setId(id);
existingPullRequest.setTitle("title " + id);
existingPullRequest.setSource("source");
existingPullRequest.setTarget("target");
existingPullRequest.setStatus(status);
existingPullRequest.setAuthor(author);
return existingPullRequest;
}
use of com.cloudogu.scm.review.pullrequest.service.PullRequest in project scm-review-plugin by scm-manager.
the class AllReviewerApprovedRuleTest method shouldReturnSuccess.
@Test
void shouldReturnSuccess() {
PullRequest pullRequest = TestData.createPullRequest();
pullRequest.addApprover("trillian");
pullRequest.addApprover("dent");
Context context = new Context(REPOSITORY, pullRequest);
Result result = rule.validate(context);
assertThat(result.isSuccess()).isTrue();
}
Aggregations