use of com.cloudogu.scm.review.comment.service.BasicComment in project scm-review-plugin by scm-manager.
the class PermissionCheckTest method shouldNotFailOnModificationsForAuthor.
@Test
@SubjectAware(username = "trillian", password = "secret")
public void shouldNotFailOnModificationsForAuthor() {
BasicComment comment = createComment("trillian");
PermissionCheck.checkModifyComment(createRepository(), comment);
}
use of com.cloudogu.scm.review.comment.service.BasicComment in project scm-review-plugin by scm-manager.
the class PermissionCheckTest method shouldAllowModificationsForPushPermission.
@Test
@SubjectAware(username = "slarti", password = "secret")
public void shouldAllowModificationsForPushPermission() {
BasicComment comment = createComment("author");
boolean modificationsAllowed = PermissionCheck.mayModifyComment(createRepository(), comment);
assertTrue(modificationsAllowed);
}
use of com.cloudogu.scm.review.comment.service.BasicComment in project scm-review-plugin by scm-manager.
the class PermissionCheckTest method shouldNotFailOnModificationsForPushPermission.
@Test
@SubjectAware(username = "slarti", password = "secret")
public void shouldNotFailOnModificationsForPushPermission() {
BasicComment comment = createComment("trillian");
PermissionCheck.checkModifyComment(createRepository(), comment);
}
use of com.cloudogu.scm.review.comment.service.BasicComment in project scm-review-plugin by scm-manager.
the class MentionMapperTest method shouldParseUserIdsToDisplayNames.
@Test
void shouldParseUserIdsToDisplayNames() {
setupExistingUserMock("dent", "Arthur Dent", "dent@hitchhiker.org");
setupExistingUserMock("_anonymous", "SCM Anonymous", "anonymous@hitchhiker.org");
BasicComment unparsedComment = Comment.createComment("1", "new comment @[dent] @[_anonymous]", "author", new Location());
unparsedComment.setMentionUserIds(ImmutableSet.of("dent", "_anonymous"));
BasicComment parsedComment = mentionMapper.parseMentionsUserIdsToDisplayNames(unparsedComment);
assertThat(parsedComment.getComment()).isEqualTo("new comment @Arthur Dent @SCM Anonymous");
}
Aggregations