use of com.cloudogu.scm.review.comment.service.PullRequestComments in project scm-review-plugin by scm-manager.
the class AddTypeToCommentUpdateStepTest method shouldAddTypeToPullRequestComments.
@Test
void shouldAddTypeToPullRequestComments() throws IOException {
Path one = copyResource(store, "1");
updateStep.doUpdate();
PullRequestComments commentsOfOne = JAXB.unmarshal(one.toFile(), PullRequestComments.class);
assertThat(commentsOfOne.getComments()).hasSize(4).extracting(Comment::getType).containsExactly(CommentType.COMMENT, CommentType.COMMENT, CommentType.COMMENT, CommentType.COMMENT);
}
use of com.cloudogu.scm.review.comment.service.PullRequestComments in project scm-review-plugin by scm-manager.
the class AddTypeToCommentUpdateStepTest method shouldNotAddTypeToCommentTextContentNode.
@Test
void shouldNotAddTypeToCommentTextContentNode() throws IOException {
Path one = copyResource(store, "1");
updateStep.doUpdate();
PullRequestComments commentsOfOne = JAXB.unmarshal(one.toFile(), PullRequestComments.class);
assertThat(commentsOfOne.getComments().get(0).getComment()).isEqualTo("Don't panic!");
}
use of com.cloudogu.scm.review.comment.service.PullRequestComments in project scm-review-plugin by scm-manager.
the class CommentLocationUpdateStepTest method shouldUpdateLocation.
@Test
void shouldUpdateLocation(@TempDir Path temp) throws Exception {
Path store = createStore(temp);
doAnswer(ic -> {
BiConsumer<String, Path> consumer = ic.getArgument(0);
consumer.accept("repo", temp);
return null;
}).when(resolverInstance).forAllLocations(any());
Path one = copyResource(store, "1");
Path two = copyResource(store, "2");
updateStep.doUpdate();
PullRequestComments commentsOfOne = JAXB.unmarshal(one.toFile(), PullRequestComments.class);
assertThat(commentsOfOne.getComments()).hasSize(4).extracting(Comment::getLocation).containsOnly(null, null, new Location("README.md", "@@ -1,3 +1,41 @@", null, 25), new Location("README.md", "@@ -1,3 +1,41 @@", null, 39));
PullRequestComments commentsOfTwo = JAXB.unmarshal(two.toFile(), PullRequestComments.class);
assertThat(commentsOfTwo.getComments()).hasSize(3).extracting(Comment::getLocation).containsOnly(new Location("README.md", "@@ -1,3 +1,41 @@", null, 39), new Location("README.md", "@@ -1,3 +1,41 @@", 39, null), new Location("README.md", "@@ -1,3 +1,41 @@", 39, 39));
}
use of com.cloudogu.scm.review.comment.service.PullRequestComments in project scm-review-plugin by scm-manager.
the class AddTypeToCommentUpdateStepTest method shouldNotOverwriteExistingTypeInPullRequestComments.
@Test
void shouldNotOverwriteExistingTypeInPullRequestComments() throws IOException {
Path two = copyResource(store, "2");
updateStep.doUpdate();
PullRequestComments commentsOfTwo = JAXB.unmarshal(two.toFile(), PullRequestComments.class);
assertThat(commentsOfTwo.getComments()).hasSize(3).extracting(Comment::getType).containsExactly(CommentType.COMMENT, CommentType.TASK_TODO, CommentType.TASK_DONE);
}
Aggregations