@Test void parse_noDiscussionItems() { final GithubId issueGithubId = GithubId.builder().owner("tfjgk").repo("hfcjgv").number("35").build(); final Document doc = DocumentMockBuilder.documentBuilder().build(); final Optional<String> result = parser.resolve(doc, issueGithubId); assertThat(result).isEmpty(); }
public Optional<String> resolve(final Document document, final GithubId issueGithubId) { return document.select(".TimelineItem") .stream() .filter(this::isPullRequest) .filter(this::isMerged) .map(this::resolvePullRequestGithubId) .map(this::fetchPullrequest) .filter(pullRequest -> pullRequest != null && pullRequestFixesIssue(pullRequest, issueGithubId)) .map(pullRequest -> pullRequest.getUser().getLogin()) .filter(StringUtils::isNotEmpty) .findFirst(); }
GithubSolverResolver { public Optional<String> resolve(final Document document, final GithubId issueGithubId) { return document.select(".TimelineItem") .stream() .filter(this::isPullRequest) .filter(this::isMerged) .map(this::resolvePullRequestGithubId) .map(this::fetchPullrequest) .filter(pullRequest -> pullRequest != null && pullRequestFixesIssue(pullRequest, issueGithubId)) .map(pullRequest -> pullRequest.getUser().getLogin()) .filter(StringUtils::isNotEmpty) .findFirst(); } }
GithubSolverResolver { public Optional<String> resolve(final Document document, final GithubId issueGithubId) { return document.select(".TimelineItem") .stream() .filter(this::isPullRequest) .filter(this::isMerged) .map(this::resolvePullRequestGithubId) .map(this::fetchPullrequest) .filter(pullRequest -> pullRequest != null && pullRequestFixesIssue(pullRequest, issueGithubId)) .map(pullRequest -> pullRequest.getUser().getLogin()) .filter(StringUtils::isNotEmpty) .findFirst(); } GithubSolverResolver(final GithubGateway githubGateway); }
GithubSolverResolver { public Optional<String> resolve(final Document document, final GithubId issueGithubId) { return document.select(".TimelineItem") .stream() .filter(this::isPullRequest) .filter(this::isMerged) .map(this::resolvePullRequestGithubId) .map(this::fetchPullrequest) .filter(pullRequest -> pullRequest != null && pullRequestFixesIssue(pullRequest, issueGithubId)) .map(pullRequest -> pullRequest.getUser().getLogin()) .filter(StringUtils::isNotEmpty) .findFirst(); } GithubSolverResolver(final GithubGateway githubGateway); Optional<String> resolve(final Document document, final GithubId issueGithubId); }
GithubSolverResolver { public Optional<String> resolve(final Document document, final GithubId issueGithubId) { return document.select(".TimelineItem") .stream() .filter(this::isPullRequest) .filter(this::isMerged) .map(this::resolvePullRequestGithubId) .map(this::fetchPullrequest) .filter(pullRequest -> pullRequest != null && pullRequestFixesIssue(pullRequest, issueGithubId)) .map(pullRequest -> pullRequest.getUser().getLogin()) .filter(StringUtils::isNotEmpty) .findFirst(); } GithubSolverResolver(final GithubGateway githubGateway); Optional<String> resolve(final Document document, final GithubId issueGithubId);  }