Skip to content

Commit

Permalink
#1262 renamed ISSUE_COMMENT to NEW_COMMENT for better semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
amihaiemil committed Oct 30, 2021
1 parent cfe1fb2 commit 3c96674
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion self-api/src/main/java/com/selfxdsd/api/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private Type(){}
/**
* Event for a comment.
*/
public static final String ISSUE_COMMENT = "comment_created";
public static final String NEW_COMMENT = "comment_created";

/**
* Event for renaming a repo.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public String type() {
} else if ("issue_comment".equalsIgnoreCase(type)) {
final String act = event.getString("action");
if("created".equalsIgnoreCase(act)) {
resolved = Type.ISSUE_COMMENT;
resolved = Type.NEW_COMMENT;
} else {
resolved = type;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public String type() {
).getString("noteable_type", "");
if("Issue".equalsIgnoreCase(noteableType)
|| "MergeRequest".equalsIgnoreCase(noteableType)) {
resolved = Type.ISSUE_COMMENT;
resolved = Type.NEW_COMMENT;
} else {
resolved = this.type;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public void resolve(final Event event) {
case Event.Type.ASSIGNED_TASKS:
this.projectManager.assignedTasks(event);
break;
case Event.Type.ISSUE_COMMENT:
case Event.Type.NEW_COMMENT:
this.projectManager.comment(event);
break;
case Event.Type.REPO_RENAMED:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ public void returnsIssueCommentType() {
);
MatcherAssert.assertThat(
event.type(),
Matchers.equalTo(Event.Type.ISSUE_COMMENT)
Matchers.equalTo(Event.Type.NEW_COMMENT)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public void typeIssueCommentForIssueComment() {
);
MatcherAssert.assertThat(
gitlabEvent.type(),
Matchers.equalTo(Event.Type.ISSUE_COMMENT)
Matchers.equalTo(Event.Type.NEW_COMMENT)
);
}

Expand All @@ -251,7 +251,7 @@ public void typeIssueCommentForMergeRequestComment() {
);
MatcherAssert.assertThat(
gitlabEvent.type(),
Matchers.equalTo(Event.Type.ISSUE_COMMENT)
Matchers.equalTo(Event.Type.NEW_COMMENT)
);
}

Expand Down

0 comments on commit 3c96674

Please sign in to comment.