@Test public void extractIssuesFromMessageWithMoreThanOneIssue() throws Exception { String message = "test(#TEST-1): issue related to #TEST-15289"; final List<String> issues = jiraService.extractIssuesFromMessage(message); assertThat(issues) .hasSize(2) .containsExactly("TEST-1", "TEST-15289"); }
public List<String> extractIssuesFromMessage(String message) { List<String> issues = Lists.newArrayList(); Matcher matcher = ISSUE_PATTERN.matcher(message); while (matcher.find()) { issues.add(matcher.group(1)); } return issues; }
JiraService { public List<String> extractIssuesFromMessage(String message) { List<String> issues = Lists.newArrayList(); Matcher matcher = ISSUE_PATTERN.matcher(message); while (matcher.find()) { issues.add(matcher.group(1)); } return issues; } }
JiraService { public List<String> extractIssuesFromMessage(String message) { List<String> issues = Lists.newArrayList(); Matcher matcher = ISSUE_PATTERN.matcher(message); while (matcher.find()) { issues.add(matcher.group(1)); } return issues; } @Inject  JiraService(@NonNull JiraConfiguration jiraConfiguration); }
JiraService { public List<String> extractIssuesFromMessage(String message) { List<String> issues = Lists.newArrayList(); Matcher matcher = ISSUE_PATTERN.matcher(message); while (matcher.find()) { issues.add(matcher.group(1)); } return issues; } @Inject  JiraService(@NonNull JiraConfiguration jiraConfiguration); Response<Object> getIssue(String issue); Response<CommentResponse> getCommentsOfIssue(String issue); Response<Comment> commentIssue(String issue, Comment comment); TransitionResponse getTransitionsOfIssue(String issue); boolean transitionOnIssue(String issue, TransitionInput transitionInput); Response<Map<String, Object>> serverInfo(); List<String> extractIssuesFromMessage(String message); Map<String, String> extractMatchingTransitionsFromMessage(String message); Optional<String> extractMatchingTransitionsFromMessage(String message, String issue); boolean performTransition(String message, String issue, String comment); boolean isExistingIssue(String issue); Optional<Transition> getTransition(String issue, String name); boolean isExistingTransition(String issue, String name); boolean isIssueAlreadyCommented(String issue, String commitId); }
JiraService { public List<String> extractIssuesFromMessage(String message) { List<String> issues = Lists.newArrayList(); Matcher matcher = ISSUE_PATTERN.matcher(message); while (matcher.find()) { issues.add(matcher.group(1)); } return issues; } @Inject  JiraService(@NonNull JiraConfiguration jiraConfiguration); Response<Object> getIssue(String issue); Response<CommentResponse> getCommentsOfIssue(String issue); Response<Comment> commentIssue(String issue, Comment comment); TransitionResponse getTransitionsOfIssue(String issue); boolean transitionOnIssue(String issue, TransitionInput transitionInput); Response<Map<String, Object>> serverInfo(); List<String> extractIssuesFromMessage(String message); Map<String, String> extractMatchingTransitionsFromMessage(String message); Optional<String> extractMatchingTransitionsFromMessage(String message, String issue); boolean performTransition(String message, String issue, String comment); boolean isExistingIssue(String issue); Optional<Transition> getTransition(String issue, String name); boolean isExistingTransition(String issue, String name); boolean isIssueAlreadyCommented(String issue, String commitId); static final String TRANSITION_HOLDER; static final Pattern ISSUE_PATTERN; }