@Test public void canClaim_issueNotClosed() { final Principal principal = PrincipalMother.davyvanroy(); final RequestDto requestDto = RequestDtoMother.fundRequestArea51(); final IssueInformationDto issueInformation = requestDto.getIssueInformation(); when(githubScraper.fetchGithubIssue(issueInformation.getOwner(), issueInformation.getRepo(), issueInformation.getNumber())).thenReturn(GithubIssue.builder() .status("Open") .build()); assertThat(claimResolver.canClaim(principal, requestDto)).isFalse(); }
public Boolean canClaim(final Principal user, final RequestDto request) { final String owner = request.getIssueInformation().getOwner(); final String repo = request.getIssueInformation().getRepo(); final String number = request.getIssueInformation().getNumber(); final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); return isIssueClosed(githubIssue) && isClaimalbeByLoggedInUser(user, request, githubIssue.getSolver()); }
GithubClaimResolver { public Boolean canClaim(final Principal user, final RequestDto request) { final String owner = request.getIssueInformation().getOwner(); final String repo = request.getIssueInformation().getRepo(); final String number = request.getIssueInformation().getNumber(); final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); return isIssueClosed(githubIssue) && isClaimalbeByLoggedInUser(user, request, githubIssue.getSolver()); } }
GithubClaimResolver { public Boolean canClaim(final Principal user, final RequestDto request) { final String owner = request.getIssueInformation().getOwner(); final String repo = request.getIssueInformation().getRepo(); final String number = request.getIssueInformation().getNumber(); final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); return isIssueClosed(githubIssue) && isClaimalbeByLoggedInUser(user, request, githubIssue.getSolver()); } GithubClaimResolver(final GithubScraper githubScraper,
                               final AzraelClient azraelClient,
                               final KeycloakRepository keycloakRepository); }
GithubClaimResolver { public Boolean canClaim(final Principal user, final RequestDto request) { final String owner = request.getIssueInformation().getOwner(); final String repo = request.getIssueInformation().getRepo(); final String number = request.getIssueInformation().getNumber(); final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); return isIssueClosed(githubIssue) && isClaimalbeByLoggedInUser(user, request, githubIssue.getSolver()); } GithubClaimResolver(final GithubScraper githubScraper,
                               final AzraelClient azraelClient,
                               final KeycloakRepository keycloakRepository); SignedClaim getSignedClaim(final Principal user, final UserClaimRequest userClaimRequest, final RequestDto request); Boolean canClaim(final Principal user, final RequestDto request); ClaimableResultDto claimableResult(final String owner, final String repo, final String number, final RequestStatus requestStatus); Optional<String> getUserPlatformUsername(final Principal user, final Platform platform); }
GithubClaimResolver { public Boolean canClaim(final Principal user, final RequestDto request) { final String owner = request.getIssueInformation().getOwner(); final String repo = request.getIssueInformation().getRepo(); final String number = request.getIssueInformation().getNumber(); final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); return isIssueClosed(githubIssue) && isClaimalbeByLoggedInUser(user, request, githubIssue.getSolver()); } GithubClaimResolver(final GithubScraper githubScraper,
                               final AzraelClient azraelClient,
                               final KeycloakRepository keycloakRepository); SignedClaim getSignedClaim(final Principal user, final UserClaimRequest userClaimRequest, final RequestDto request); Boolean canClaim(final Principal user, final RequestDto request); ClaimableResultDto claimableResult(final String owner, final String repo, final String number, final RequestStatus requestStatus); Optional<String> getUserPlatformUsername(final Principal user, final Platform platform);  }