@Test public void fetchGithubIssue() throws IOException { final String owner = "fdv"; final String repo = "sdfgdh"; final String number = "46576"; final String expectedSolver = "gfhcgj"; final String expectedStatus = "Open"; final Document document = mock(Document.class); when(jsoup.connect("https: when(solverParser.resolve(document, GithubId.builder().owner(owner).repo(repo).number(number).build())).thenReturn(Optional.of(expectedSolver)); when(statusParser.resolve(document)).thenReturn(expectedStatus); final GithubIssue returnedIssue = scraper.fetchGithubIssue(owner, repo, number); assertThat(returnedIssue.getOwner()).isEqualTo(owner); assertThat(returnedIssue.getRepo()).isEqualTo(repo); assertThat(returnedIssue.getNumber()).isEqualTo(number); assertThat(returnedIssue.getSolver()).isEqualTo(expectedSolver); assertThat(returnedIssue.getStatus()).isEqualTo(expectedStatus); }
@Cacheable("github_issues") public GithubIssue fetchGithubIssue(final String owner, final String repo, final String number) { Document document; try { document = jsoup.connect("https: } catch (IOException e) { throw new RuntimeException(e); } return GithubIssue.builder() .owner(owner) .repo(repo) .number(number) .solver(solverResolver.resolve(document, GithubId.builder().owner(owner).repo(repo).number(number).build()).orElse(null)) .status(statusResolver.resolve(document)) .build(); }
GithubScraper { @Cacheable("github_issues") public GithubIssue fetchGithubIssue(final String owner, final String repo, final String number) { Document document; try { document = jsoup.connect("https: } catch (IOException e) { throw new RuntimeException(e); } return GithubIssue.builder() .owner(owner) .repo(repo) .number(number) .solver(solverResolver.resolve(document, GithubId.builder().owner(owner).repo(repo).number(number).build()).orElse(null)) .status(statusResolver.resolve(document)) .build(); } }
GithubScraper { @Cacheable("github_issues") public GithubIssue fetchGithubIssue(final String owner, final String repo, final String number) { Document document; try { document = jsoup.connect("https: } catch (IOException e) { throw new RuntimeException(e); } return GithubIssue.builder() .owner(owner) .repo(repo) .number(number) .solver(solverResolver.resolve(document, GithubId.builder().owner(owner).repo(repo).number(number).build()).orElse(null)) .status(statusResolver.resolve(document)) .build(); } GithubScraper(final JsoupSpringWrapper jsoup, final GithubSolverResolver solverResolver, final GithubStatusResolver statusResolver); }
GithubScraper { @Cacheable("github_issues") public GithubIssue fetchGithubIssue(final String owner, final String repo, final String number) { Document document; try { document = jsoup.connect("https: } catch (IOException e) { throw new RuntimeException(e); } return GithubIssue.builder() .owner(owner) .repo(repo) .number(number) .solver(solverResolver.resolve(document, GithubId.builder().owner(owner).repo(repo).number(number).build()).orElse(null)) .status(statusResolver.resolve(document)) .build(); } GithubScraper(final JsoupSpringWrapper jsoup, final GithubSolverResolver solverResolver, final GithubStatusResolver statusResolver); @Cacheable("github_issues") GithubIssue fetchGithubIssue(final String owner, final String repo, final String number); }
GithubScraper { @Cacheable("github_issues") public GithubIssue fetchGithubIssue(final String owner, final String repo, final String number) { Document document; try { document = jsoup.connect("https: } catch (IOException e) { throw new RuntimeException(e); } return GithubIssue.builder() .owner(owner) .repo(repo) .number(number) .solver(solverResolver.resolve(document, GithubId.builder().owner(owner).repo(repo).number(number).build()).orElse(null)) .status(statusResolver.resolve(document)) .build(); } GithubScraper(final JsoupSpringWrapper jsoup, final GithubSolverResolver solverResolver, final GithubStatusResolver statusResolver); @Cacheable("github_issues") GithubIssue fetchGithubIssue(final String owner, final String repo, final String number);  }