target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test void hasRefunds_fndRefunds() { assertThat(UserFundsDto.builder().fndRefunds(TokenValueDto.builder().build()).build().hasRefunds()).isTrue(); } | public boolean hasRefunds() { return fndRefunds != null || otherRefunds != null; } | UserFundsDto { public boolean hasRefunds() { return fndRefunds != null || otherRefunds != null; } } | UserFundsDto { public boolean hasRefunds() { return fndRefunds != null || otherRefunds != null; } } | UserFundsDto { public boolean hasRefunds() { return fndRefunds != null || otherRefunds != null; } boolean hasRefunds(); } | UserFundsDto { public boolean hasRefunds() { return fndRefunds != null || otherRefunds != null; } boolean hasRefunds(); } |
@Test void hasRefunds_otherRefunds() { assertThat(UserFundsDto.builder().otherRefunds(TokenValueDto.builder().build()).build().hasRefunds()).isTrue(); } | public boolean hasRefunds() { return fndRefunds != null || otherRefunds != null; } | UserFundsDto { public boolean hasRefunds() { return fndRefunds != null || otherRefunds != null; } } | UserFundsDto { public boolean hasRefunds() { return fndRefunds != null || otherRefunds != null; } } | UserFundsDto { public boolean hasRefunds() { return fndRefunds != null || otherRefunds != null; } boolean hasRefunds(); } | UserFundsDto { public boolean hasRefunds() { return fndRefunds != null || otherRefunds != null; } boolean hasRefunds(); } |
@Test void hasRefunds_fndAndOtherRefunds() { assertThat(UserFundsDto.builder().fndRefunds(TokenValueDto.builder().build()).otherRefunds(TokenValueDto.builder().build()).build().hasRefunds()).isTrue(); } | public boolean hasRefunds() { return fndRefunds != null || otherRefunds != null; } | UserFundsDto { public boolean hasRefunds() { return fndRefunds != null || otherRefunds != null; } } | UserFundsDto { public boolean hasRefunds() { return fndRefunds != null || otherRefunds != null; } } | UserFundsDto { public boolean hasRefunds() { return fndRefunds != null || otherRefunds != null; } boolean hasRefunds(); } | UserFundsDto { public boolean hasRefunds() { return fndRefunds != null || otherRefunds != null; } boolean hasRefunds(); } |
@Test public void showMessagesOfTypePage() throws Exception { String type = MessageType.REFERRAL_SHARE.toString(); MessageDto messageDto1 = mock(MessageDto.class); MessageDto messageDto2 = mock(MessageDto.class); MessageDto messageDto3 = mock(MessageDto.class); List<MessageDto> messages = Arrays.asList(messageDto1, mes... | @RequestMapping("/messages/{type}") public ModelAndView showMessagesOfTypePage(final Model model, @PathVariable String type) { model.addAttribute("type", type.toUpperCase()); model.addAttribute("messages", messageService.getMessagesByType(MessageType.valueOf(type.toUpperCase()))); return new ModelAndView("messages/type... | MessagesController extends AbstractController { @RequestMapping("/messages/{type}") public ModelAndView showMessagesOfTypePage(final Model model, @PathVariable String type) { model.addAttribute("type", type.toUpperCase()); model.addAttribute("messages", messageService.getMessagesByType(MessageType.valueOf(type.toUpperC... | MessagesController extends AbstractController { @RequestMapping("/messages/{type}") public ModelAndView showMessagesOfTypePage(final Model model, @PathVariable String type) { model.addAttribute("type", type.toUpperCase()); model.addAttribute("messages", messageService.getMessagesByType(MessageType.valueOf(type.toUpperC... | MessagesController extends AbstractController { @RequestMapping("/messages/{type}") public ModelAndView showMessagesOfTypePage(final Model model, @PathVariable String type) { model.addAttribute("type", type.toUpperCase()); model.addAttribute("messages", messageService.getMessagesByType(MessageType.valueOf(type.toUpperC... | MessagesController extends AbstractController { @RequestMapping("/messages/{type}") public ModelAndView showMessagesOfTypePage(final Model model, @PathVariable String type) { model.addAttribute("type", type.toUpperCase()); model.addAttribute("messages", messageService.getMessagesByType(MessageType.valueOf(type.toUpperC... |
@Test void onRefund_fundsPresent() { final long requestId = 254L; when(fundService.getTotalFundsForRequest(requestId)).thenReturn(Arrays.asList(TokenValueDtoMother.FND().totalAmount(new BigDecimal("45")).build(), TokenValueDtoMother.ZRX().totalAmount(new BigDecimal("23")).build())); handler.handleRefund(new RefundProce... | @EventListener public void handleRefund(final RefundProcessedEvent refundProcessedEvent) { final Long requestId = refundProcessedEvent.getRefund().getRequestId(); if (!hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, FUNDED)) { requestService.update(new UpdateRequestSta... | CheckFundsGtZeroHandler { @EventListener public void handleRefund(final RefundProcessedEvent refundProcessedEvent) { final Long requestId = refundProcessedEvent.getRefund().getRequestId(); if (!hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, FUNDED)) { requestService.u... | CheckFundsGtZeroHandler { @EventListener public void handleRefund(final RefundProcessedEvent refundProcessedEvent) { final Long requestId = refundProcessedEvent.getRefund().getRequestId(); if (!hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, FUNDED)) { requestService.u... | CheckFundsGtZeroHandler { @EventListener public void handleRefund(final RefundProcessedEvent refundProcessedEvent) { final Long requestId = refundProcessedEvent.getRefund().getRequestId(); if (!hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, FUNDED)) { requestService.u... | CheckFundsGtZeroHandler { @EventListener public void handleRefund(final RefundProcessedEvent refundProcessedEvent) { final Long requestId = refundProcessedEvent.getRefund().getRequestId(); if (!hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, FUNDED)) { requestService.u... |
@Test void onRefund_noMoreFundsPresent() { final long requestId = 32L; final RequestDto requestDto = RequestDtoMother.fundRequestArea51(); requestDto.setStatus(FUNDED); when(fundService.getTotalFundsForRequest(requestId)).thenReturn(Arrays.asList(TokenValueDtoMother.FND().totalAmount(new BigDecimal("0")).build(), Token... | @EventListener public void handleRefund(final RefundProcessedEvent refundProcessedEvent) { final Long requestId = refundProcessedEvent.getRefund().getRequestId(); if (!hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, FUNDED)) { requestService.update(new UpdateRequestSta... | CheckFundsGtZeroHandler { @EventListener public void handleRefund(final RefundProcessedEvent refundProcessedEvent) { final Long requestId = refundProcessedEvent.getRefund().getRequestId(); if (!hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, FUNDED)) { requestService.u... | CheckFundsGtZeroHandler { @EventListener public void handleRefund(final RefundProcessedEvent refundProcessedEvent) { final Long requestId = refundProcessedEvent.getRefund().getRequestId(); if (!hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, FUNDED)) { requestService.u... | CheckFundsGtZeroHandler { @EventListener public void handleRefund(final RefundProcessedEvent refundProcessedEvent) { final Long requestId = refundProcessedEvent.getRefund().getRequestId(); if (!hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, FUNDED)) { requestService.u... | CheckFundsGtZeroHandler { @EventListener public void handleRefund(final RefundProcessedEvent refundProcessedEvent) { final Long requestId = refundProcessedEvent.getRefund().getRequestId(); if (!hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, FUNDED)) { requestService.u... |
@Test void onRefund_nothingPresent() { final long requestId = 87L; final RequestDto requestDto = RequestDtoMother.fundRequestArea51(); requestDto.setStatus(FUNDED); when(fundService.getTotalFundsForRequest(requestId)).thenReturn(new ArrayList<>()); when(requestService.findRequest(requestId)).thenReturn(requestDto); han... | @EventListener public void handleRefund(final RefundProcessedEvent refundProcessedEvent) { final Long requestId = refundProcessedEvent.getRefund().getRequestId(); if (!hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, FUNDED)) { requestService.update(new UpdateRequestSta... | CheckFundsGtZeroHandler { @EventListener public void handleRefund(final RefundProcessedEvent refundProcessedEvent) { final Long requestId = refundProcessedEvent.getRefund().getRequestId(); if (!hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, FUNDED)) { requestService.u... | CheckFundsGtZeroHandler { @EventListener public void handleRefund(final RefundProcessedEvent refundProcessedEvent) { final Long requestId = refundProcessedEvent.getRefund().getRequestId(); if (!hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, FUNDED)) { requestService.u... | CheckFundsGtZeroHandler { @EventListener public void handleRefund(final RefundProcessedEvent refundProcessedEvent) { final Long requestId = refundProcessedEvent.getRefund().getRequestId(); if (!hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, FUNDED)) { requestService.u... | CheckFundsGtZeroHandler { @EventListener public void handleRefund(final RefundProcessedEvent refundProcessedEvent) { final Long requestId = refundProcessedEvent.getRefund().getRequestId(); if (!hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, FUNDED)) { requestService.u... |
@Test void onRefund_statusNotFUNDED() { final long requestId = 254L; final RequestDto requestDto = RequestDtoMother.fundRequestArea51(); requestDto.setStatus(OPEN); when(fundService.getTotalFundsForRequest(requestId)).thenReturn(Arrays.asList(TokenValueDtoMother.FND().totalAmount(new BigDecimal("0")).build(), TokenValu... | @EventListener public void handleRefund(final RefundProcessedEvent refundProcessedEvent) { final Long requestId = refundProcessedEvent.getRefund().getRequestId(); if (!hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, FUNDED)) { requestService.update(new UpdateRequestSta... | CheckFundsGtZeroHandler { @EventListener public void handleRefund(final RefundProcessedEvent refundProcessedEvent) { final Long requestId = refundProcessedEvent.getRefund().getRequestId(); if (!hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, FUNDED)) { requestService.u... | CheckFundsGtZeroHandler { @EventListener public void handleRefund(final RefundProcessedEvent refundProcessedEvent) { final Long requestId = refundProcessedEvent.getRefund().getRequestId(); if (!hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, FUNDED)) { requestService.u... | CheckFundsGtZeroHandler { @EventListener public void handleRefund(final RefundProcessedEvent refundProcessedEvent) { final Long requestId = refundProcessedEvent.getRefund().getRequestId(); if (!hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, FUNDED)) { requestService.u... | CheckFundsGtZeroHandler { @EventListener public void handleRefund(final RefundProcessedEvent refundProcessedEvent) { final Long requestId = refundProcessedEvent.getRefund().getRequestId(); if (!hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, FUNDED)) { requestService.u... |
@Test void onFund_fundsPresent() { final long requestId = 254L; final RequestDto requestDto = RequestDtoMother.fundRequestArea51(); requestDto.setStatus(OPEN); when(fundService.getTotalFundsForRequest(requestId)).thenReturn(Arrays.asList(TokenValueDtoMother.FND().totalAmount(new BigDecimal("45")).build(), TokenValueDto... | @EventListener public void handleFund(final RequestFundedEvent requestFundedEvent) { final Long requestId = requestFundedEvent.getRequestId(); if (hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, OPEN)) { requestService.update(new UpdateRequestStatusCommand(requestId, F... | CheckFundsGtZeroHandler { @EventListener public void handleFund(final RequestFundedEvent requestFundedEvent) { final Long requestId = requestFundedEvent.getRequestId(); if (hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, OPEN)) { requestService.update(new UpdateRequest... | CheckFundsGtZeroHandler { @EventListener public void handleFund(final RequestFundedEvent requestFundedEvent) { final Long requestId = requestFundedEvent.getRequestId(); if (hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, OPEN)) { requestService.update(new UpdateRequest... | CheckFundsGtZeroHandler { @EventListener public void handleFund(final RequestFundedEvent requestFundedEvent) { final Long requestId = requestFundedEvent.getRequestId(); if (hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, OPEN)) { requestService.update(new UpdateRequest... | CheckFundsGtZeroHandler { @EventListener public void handleFund(final RequestFundedEvent requestFundedEvent) { final Long requestId = requestFundedEvent.getRequestId(); if (hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, OPEN)) { requestService.update(new UpdateRequest... |
@Test void onFund_statusNotOPEN() { final long requestId = 254L; final RequestDto requestDto = RequestDtoMother.fundRequestArea51(); requestDto.setStatus(FUNDED); when(fundService.getTotalFundsForRequest(requestId)).thenReturn(Arrays.asList(TokenValueDtoMother.FND().totalAmount(new BigDecimal("45")).build(), TokenValue... | @EventListener public void handleFund(final RequestFundedEvent requestFundedEvent) { final Long requestId = requestFundedEvent.getRequestId(); if (hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, OPEN)) { requestService.update(new UpdateRequestStatusCommand(requestId, F... | CheckFundsGtZeroHandler { @EventListener public void handleFund(final RequestFundedEvent requestFundedEvent) { final Long requestId = requestFundedEvent.getRequestId(); if (hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, OPEN)) { requestService.update(new UpdateRequest... | CheckFundsGtZeroHandler { @EventListener public void handleFund(final RequestFundedEvent requestFundedEvent) { final Long requestId = requestFundedEvent.getRequestId(); if (hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, OPEN)) { requestService.update(new UpdateRequest... | CheckFundsGtZeroHandler { @EventListener public void handleFund(final RequestFundedEvent requestFundedEvent) { final Long requestId = requestFundedEvent.getRequestId(); if (hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, OPEN)) { requestService.update(new UpdateRequest... | CheckFundsGtZeroHandler { @EventListener public void handleFund(final RequestFundedEvent requestFundedEvent) { final Long requestId = requestFundedEvent.getRequestId(); if (hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, OPEN)) { requestService.update(new UpdateRequest... |
@Test void onFund_noMoreFundsPresent() { final long requestId = 32L; when(fundService.getTotalFundsForRequest(requestId)).thenReturn(Arrays.asList(TokenValueDtoMother.FND().totalAmount(new BigDecimal("0")).build(), TokenValueDtoMother.ZRX().totalAmount(new BigDecimal("0")).build())); handler.handleFund(RequestFundedEve... | @EventListener public void handleFund(final RequestFundedEvent requestFundedEvent) { final Long requestId = requestFundedEvent.getRequestId(); if (hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, OPEN)) { requestService.update(new UpdateRequestStatusCommand(requestId, F... | CheckFundsGtZeroHandler { @EventListener public void handleFund(final RequestFundedEvent requestFundedEvent) { final Long requestId = requestFundedEvent.getRequestId(); if (hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, OPEN)) { requestService.update(new UpdateRequest... | CheckFundsGtZeroHandler { @EventListener public void handleFund(final RequestFundedEvent requestFundedEvent) { final Long requestId = requestFundedEvent.getRequestId(); if (hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, OPEN)) { requestService.update(new UpdateRequest... | CheckFundsGtZeroHandler { @EventListener public void handleFund(final RequestFundedEvent requestFundedEvent) { final Long requestId = requestFundedEvent.getRequestId(); if (hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, OPEN)) { requestService.update(new UpdateRequest... | CheckFundsGtZeroHandler { @EventListener public void handleFund(final RequestFundedEvent requestFundedEvent) { final Long requestId = requestFundedEvent.getRequestId(); if (hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, OPEN)) { requestService.update(new UpdateRequest... |
@Test void onFund_nothingPresent() { final long requestId = 87L; when(fundService.getTotalFundsForRequest(requestId)).thenReturn(new ArrayList<>()); handler.handleFund(RequestFundedEvent.builder().requestId(requestId).build()); verifyZeroInteractions(requestService); } | @EventListener public void handleFund(final RequestFundedEvent requestFundedEvent) { final Long requestId = requestFundedEvent.getRequestId(); if (hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, OPEN)) { requestService.update(new UpdateRequestStatusCommand(requestId, F... | CheckFundsGtZeroHandler { @EventListener public void handleFund(final RequestFundedEvent requestFundedEvent) { final Long requestId = requestFundedEvent.getRequestId(); if (hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, OPEN)) { requestService.update(new UpdateRequest... | CheckFundsGtZeroHandler { @EventListener public void handleFund(final RequestFundedEvent requestFundedEvent) { final Long requestId = requestFundedEvent.getRequestId(); if (hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, OPEN)) { requestService.update(new UpdateRequest... | CheckFundsGtZeroHandler { @EventListener public void handleFund(final RequestFundedEvent requestFundedEvent) { final Long requestId = requestFundedEvent.getRequestId(); if (hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, OPEN)) { requestService.update(new UpdateRequest... | CheckFundsGtZeroHandler { @EventListener public void handleFund(final RequestFundedEvent requestFundedEvent) { final Long requestId = requestFundedEvent.getRequestId(); if (hasTokenValueGtZero(fundService.getTotalFundsForRequest(requestId)) && hasRequestStatus(requestId, OPEN)) { requestService.update(new UpdateRequest... |
@Test void onClaimed() { final RequestClaimedEvent claimedEvent = RequestClaimedEvent.builder() .claimDto(ClaimDtoMother.aClaimDto().build()) .timestamp(LocalDateTime.now()) .blockchainEventId(24L) .requestDto(RequestDtoMother.fundRequestArea51()) .solver("sbsgdb") .build(); final RequestClaimedNotificationDto expected... | @TransactionalEventListener public void onClaimed(final RequestClaimedEvent claimedEvent) { eventPublisher.publishEvent(RequestClaimedNotificationDto.builder() .blockchainEventId(claimedEvent.getBlockchainEventId()) .date(claimedEvent.getTimestamp()) .requestId(claimedEvent.getRequestDto().getId()) .claimId(claimedEven... | PublishRequestClaimedNotificationHandler { @TransactionalEventListener public void onClaimed(final RequestClaimedEvent claimedEvent) { eventPublisher.publishEvent(RequestClaimedNotificationDto.builder() .blockchainEventId(claimedEvent.getBlockchainEventId()) .date(claimedEvent.getTimestamp()) .requestId(claimedEvent.ge... | PublishRequestClaimedNotificationHandler { @TransactionalEventListener public void onClaimed(final RequestClaimedEvent claimedEvent) { eventPublisher.publishEvent(RequestClaimedNotificationDto.builder() .blockchainEventId(claimedEvent.getBlockchainEventId()) .date(claimedEvent.getTimestamp()) .requestId(claimedEvent.ge... | PublishRequestClaimedNotificationHandler { @TransactionalEventListener public void onClaimed(final RequestClaimedEvent claimedEvent) { eventPublisher.publishEvent(RequestClaimedNotificationDto.builder() .blockchainEventId(claimedEvent.getBlockchainEventId()) .date(claimedEvent.getTimestamp()) .requestId(claimedEvent.ge... | PublishRequestClaimedNotificationHandler { @TransactionalEventListener public void onClaimed(final RequestClaimedEvent claimedEvent) { eventPublisher.publishEvent(RequestClaimedNotificationDto.builder() .blockchainEventId(claimedEvent.getBlockchainEventId()) .date(claimedEvent.getTimestamp()) .requestId(claimedEvent.ge... |
@Test public void ignoresGithubComment() { handler = new CreateGithubCommentOnFundHandler(githubGateway, githubCommentFactory, requestService, false, "fundrequest-notifier"); handler.createGithubCommentOnRequestFunded(createEvent(65478L)); verifyZeroInteractions(githubGateway); } | @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestFunded(final RequestFundedEvent event) { if (addComment) { final IssueInformationDto issueInformation = requestService.findRequest(event.getRequestId()).getIssueInformation(); if (issueInformation.getPlatform() ==... | CreateGithubCommentOnFundHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestFunded(final RequestFundedEvent event) { if (addComment) { final IssueInformationDto issueInformation = requestService.findRequest(event.getRequestId()).getIssueInformation(); if... | CreateGithubCommentOnFundHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestFunded(final RequestFundedEvent event) { if (addComment) { final IssueInformationDto issueInformation = requestService.findRequest(event.getRequestId()).getIssueInformation(); if... | CreateGithubCommentOnFundHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestFunded(final RequestFundedEvent event) { if (addComment) { final IssueInformationDto issueInformation = requestService.findRequest(event.getRequestId()).getIssueInformation(); if... | CreateGithubCommentOnFundHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestFunded(final RequestFundedEvent event) { if (addComment) { final IssueInformationDto issueInformation = requestService.findRequest(event.getRequestId()).getIssueInformation(); if... |
@Test public void showAddMessageToTypePage() throws Exception { String type = MessageType.REFERRAL_SHARE.toString(); this.mockMvc.perform(get("/messages/{type}/add", type)) .andExpect(MockMvcResultMatchers.status().isOk()) .andExpect(MockMvcResultMatchers.model().attribute("message", MessageDto.builder().type(MessageTy... | @RequestMapping("/messages/{type}/add") public ModelAndView showAddMessageToTypePage(final Model model, @PathVariable String type) { model.addAttribute("message", MessageDto.builder().type(MessageType.valueOf(type)).build()); return new ModelAndView("messages/add"); } | MessagesController extends AbstractController { @RequestMapping("/messages/{type}/add") public ModelAndView showAddMessageToTypePage(final Model model, @PathVariable String type) { model.addAttribute("message", MessageDto.builder().type(MessageType.valueOf(type)).build()); return new ModelAndView("messages/add"); } } | MessagesController extends AbstractController { @RequestMapping("/messages/{type}/add") public ModelAndView showAddMessageToTypePage(final Model model, @PathVariable String type) { model.addAttribute("message", MessageDto.builder().type(MessageType.valueOf(type)).build()); return new ModelAndView("messages/add"); } Mes... | MessagesController extends AbstractController { @RequestMapping("/messages/{type}/add") public ModelAndView showAddMessageToTypePage(final Model model, @PathVariable String type) { model.addAttribute("message", MessageDto.builder().type(MessageType.valueOf(type)).build()); return new ModelAndView("messages/add"); } Mes... | MessagesController extends AbstractController { @RequestMapping("/messages/{type}/add") public ModelAndView showAddMessageToTypePage(final Model model, @PathVariable String type) { model.addAttribute("message", MessageDto.builder().type(MessageType.valueOf(type)).build()); return new ModelAndView("messages/add"); } Mes... |
@Test public void postsGithubComment() { final long requestId = 65478L; final RequestFundedEvent event = createEvent(requestId); final String expectedMessage = "sgdhfjgkh"; final RequestDto requestDto = RequestDtoMother.fundRequestArea51(); final IssueInformationDto issueInformation = requestDto.getIssueInformation(); ... | @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestFunded(final RequestFundedEvent event) { if (addComment) { final IssueInformationDto issueInformation = requestService.findRequest(event.getRequestId()).getIssueInformation(); if (issueInformation.getPlatform() ==... | CreateGithubCommentOnFundHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestFunded(final RequestFundedEvent event) { if (addComment) { final IssueInformationDto issueInformation = requestService.findRequest(event.getRequestId()).getIssueInformation(); if... | CreateGithubCommentOnFundHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestFunded(final RequestFundedEvent event) { if (addComment) { final IssueInformationDto issueInformation = requestService.findRequest(event.getRequestId()).getIssueInformation(); if... | CreateGithubCommentOnFundHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestFunded(final RequestFundedEvent event) { if (addComment) { final IssueInformationDto issueInformation = requestService.findRequest(event.getRequestId()).getIssueInformation(); if... | CreateGithubCommentOnFundHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestFunded(final RequestFundedEvent event) { if (addComment) { final IssueInformationDto issueInformation = requestService.findRequest(event.getRequestId()).getIssueInformation(); if... |
@Test public void onFunded() { final RequestFundedEvent fundedEvent = RequestFundedEvent.builder() .fundDto(FundDtoMother.aFundDto().build()) .timestamp(LocalDateTime.now()) .requestId(35L).build(); final RequestFundedNotificationDto expected = RequestFundedNotificationDto.builder() .blockchainEventId(fundedEvent.getFu... | @TransactionalEventListener public void onFunded(final RequestFundedEvent fundedEvent) { eventPublisher.publishEvent(new RequestFundedNotificationDto(fundedEvent.getFundDto().getBlockchainEventId(), fundedEvent.getTimestamp(), fundedEvent.getRequestId(), fundedEvent.getFundDto().getId())); } | PublishRequestFundedNotificationHandler { @TransactionalEventListener public void onFunded(final RequestFundedEvent fundedEvent) { eventPublisher.publishEvent(new RequestFundedNotificationDto(fundedEvent.getFundDto().getBlockchainEventId(), fundedEvent.getTimestamp(), fundedEvent.getRequestId(), fundedEvent.getFundDto(... | PublishRequestFundedNotificationHandler { @TransactionalEventListener public void onFunded(final RequestFundedEvent fundedEvent) { eventPublisher.publishEvent(new RequestFundedNotificationDto(fundedEvent.getFundDto().getBlockchainEventId(), fundedEvent.getTimestamp(), fundedEvent.getRequestId(), fundedEvent.getFundDto(... | PublishRequestFundedNotificationHandler { @TransactionalEventListener public void onFunded(final RequestFundedEvent fundedEvent) { eventPublisher.publishEvent(new RequestFundedNotificationDto(fundedEvent.getFundDto().getBlockchainEventId(), fundedEvent.getTimestamp(), fundedEvent.getRequestId(), fundedEvent.getFundDto(... | PublishRequestFundedNotificationHandler { @TransactionalEventListener public void onFunded(final RequestFundedEvent fundedEvent) { eventPublisher.publishEvent(new RequestFundedNotificationDto(fundedEvent.getFundDto().getBlockchainEventId(), fundedEvent.getTimestamp(), fundedEvent.getRequestId(), fundedEvent.getFundDto(... |
@Test public void shouldRemoveFailedPendingFunds() { final PendingFund pendingFund = PendingFundMother.aPendingFund(); when(pendingFundService.findAll()) .thenReturn(of(pendingFund)); when(azraelClient.getTransactionStatus(prettify(pendingFund.getTransactionHash()))).thenReturn(TransactionStatus.FAILED); pendingFundCle... | @Scheduled(fixedDelay = 300_000 ) public void cleanupPendingFunds() { pendingFundService.findAll() .stream() .filter(fund -> { try { return hasFailed(fund) || hasAged(fund); } catch (final Exception ex) { log.error("Unable to fetch status for transaction {} : ", fund.getTransactionHash(), ex.getMessage()); return false... | PendingFundCleaner { @Scheduled(fixedDelay = 300_000 ) public void cleanupPendingFunds() { pendingFundService.findAll() .stream() .filter(fund -> { try { return hasFailed(fund) || hasAged(fund); } catch (final Exception ex) { log.error("Unable to fetch status for transaction {} : ", fund.getTransactionHash(), ex.getMes... | PendingFundCleaner { @Scheduled(fixedDelay = 300_000 ) public void cleanupPendingFunds() { pendingFundService.findAll() .stream() .filter(fund -> { try { return hasFailed(fund) || hasAged(fund); } catch (final Exception ex) { log.error("Unable to fetch status for transaction {} : ", fund.getTransactionHash(), ex.getMes... | PendingFundCleaner { @Scheduled(fixedDelay = 300_000 ) public void cleanupPendingFunds() { pendingFundService.findAll() .stream() .filter(fund -> { try { return hasFailed(fund) || hasAged(fund); } catch (final Exception ex) { log.error("Unable to fetch status for transaction {} : ", fund.getTransactionHash(), ex.getMes... | PendingFundCleaner { @Scheduled(fixedDelay = 300_000 ) public void cleanupPendingFunds() { pendingFundService.findAll() .stream() .filter(fund -> { try { return hasFailed(fund) || hasAged(fund); } catch (final Exception ex) { log.error("Unable to fetch status for transaction {} : ", fund.getTransactionHash(), ex.getMes... |
@Test public void shouldRemoveAgedPendingFunds() { final PendingFund pendingFund = PendingFundMother.aPendingFund(); when(pendingFundService.findAll()) .thenReturn(of(pendingFund)); when(azraelClient.getTransactionStatus(prettify(pendingFund.getTransactionHash()))).thenReturn(TransactionStatus.SUCCEEDED); ReflectionUti... | @Scheduled(fixedDelay = 300_000 ) public void cleanupPendingFunds() { pendingFundService.findAll() .stream() .filter(fund -> { try { return hasFailed(fund) || hasAged(fund); } catch (final Exception ex) { log.error("Unable to fetch status for transaction {} : ", fund.getTransactionHash(), ex.getMessage()); return false... | PendingFundCleaner { @Scheduled(fixedDelay = 300_000 ) public void cleanupPendingFunds() { pendingFundService.findAll() .stream() .filter(fund -> { try { return hasFailed(fund) || hasAged(fund); } catch (final Exception ex) { log.error("Unable to fetch status for transaction {} : ", fund.getTransactionHash(), ex.getMes... | PendingFundCleaner { @Scheduled(fixedDelay = 300_000 ) public void cleanupPendingFunds() { pendingFundService.findAll() .stream() .filter(fund -> { try { return hasFailed(fund) || hasAged(fund); } catch (final Exception ex) { log.error("Unable to fetch status for transaction {} : ", fund.getTransactionHash(), ex.getMes... | PendingFundCleaner { @Scheduled(fixedDelay = 300_000 ) public void cleanupPendingFunds() { pendingFundService.findAll() .stream() .filter(fund -> { try { return hasFailed(fund) || hasAged(fund); } catch (final Exception ex) { log.error("Unable to fetch status for transaction {} : ", fund.getTransactionHash(), ex.getMes... | PendingFundCleaner { @Scheduled(fixedDelay = 300_000 ) public void cleanupPendingFunds() { pendingFundService.findAll() .stream() .filter(fund -> { try { return hasFailed(fund) || hasAged(fund); } catch (final Exception ex) { log.error("Unable to fetch status for transaction {} : ", fund.getTransactionHash(), ex.getMes... |
@Test public void shouldntRemoveWhenThrownExceptionFromAzrael() { final PendingFund pendingFund = PendingFundMother.aPendingFund(); when(pendingFundService.findAll()) .thenReturn(of(pendingFund)); when(azraelClient.getTransactionStatus(prettify(pendingFund.getTransactionHash()))).thenThrow(new IllegalArgumentException(... | @Scheduled(fixedDelay = 300_000 ) public void cleanupPendingFunds() { pendingFundService.findAll() .stream() .filter(fund -> { try { return hasFailed(fund) || hasAged(fund); } catch (final Exception ex) { log.error("Unable to fetch status for transaction {} : ", fund.getTransactionHash(), ex.getMessage()); return false... | PendingFundCleaner { @Scheduled(fixedDelay = 300_000 ) public void cleanupPendingFunds() { pendingFundService.findAll() .stream() .filter(fund -> { try { return hasFailed(fund) || hasAged(fund); } catch (final Exception ex) { log.error("Unable to fetch status for transaction {} : ", fund.getTransactionHash(), ex.getMes... | PendingFundCleaner { @Scheduled(fixedDelay = 300_000 ) public void cleanupPendingFunds() { pendingFundService.findAll() .stream() .filter(fund -> { try { return hasFailed(fund) || hasAged(fund); } catch (final Exception ex) { log.error("Unable to fetch status for transaction {} : ", fund.getTransactionHash(), ex.getMes... | PendingFundCleaner { @Scheduled(fixedDelay = 300_000 ) public void cleanupPendingFunds() { pendingFundService.findAll() .stream() .filter(fund -> { try { return hasFailed(fund) || hasAged(fund); } catch (final Exception ex) { log.error("Unable to fetch status for transaction {} : ", fund.getTransactionHash(), ex.getMes... | PendingFundCleaner { @Scheduled(fixedDelay = 300_000 ) public void cleanupPendingFunds() { pendingFundService.findAll() .stream() .filter(fund -> { try { return hasFailed(fund) || hasAged(fund); } catch (final Exception ex) { log.error("Unable to fetch status for transaction {} : ", fund.getTransactionHash(), ex.getMes... |
@Test void requestRefund() { final long requestId = 547L; final String funderAddress = "hjfgkh"; final String requestedBy = "4567gjfh"; refundService.requestRefund(RequestRefundCommand.builder().requestId(requestId).funderAddress(funderAddress).requestedBy(requestedBy).build()); verify(refundRequestRepository).save(ref... | @Override @Transactional public void requestRefund(final RequestRefundCommand requestRefundCommand) { refundRequestRepository.save(RefundRequest.builder() .requestId(requestRefundCommand.getRequestId()) .funderAddress(requestRefundCommand.getFunderAddress()) .requestedBy(requestRefundCommand.getRequestedBy()) .build())... | RefundServiceImpl implements RefundService { @Override @Transactional public void requestRefund(final RequestRefundCommand requestRefundCommand) { refundRequestRepository.save(RefundRequest.builder() .requestId(requestRefundCommand.getRequestId()) .funderAddress(requestRefundCommand.getFunderAddress()) .requestedBy(req... | RefundServiceImpl implements RefundService { @Override @Transactional public void requestRefund(final RequestRefundCommand requestRefundCommand) { refundRequestRepository.save(RefundRequest.builder() .requestId(requestRefundCommand.getRequestId()) .funderAddress(requestRefundCommand.getFunderAddress()) .requestedBy(req... | RefundServiceImpl implements RefundService { @Override @Transactional public void requestRefund(final RequestRefundCommand requestRefundCommand) { refundRequestRepository.save(RefundRequest.builder() .requestId(requestRefundCommand.getRequestId()) .funderAddress(requestRefundCommand.getFunderAddress()) .requestedBy(req... | RefundServiceImpl implements RefundService { @Override @Transactional public void requestRefund(final RequestRefundCommand requestRefundCommand) { refundRequestRepository.save(RefundRequest.builder() .requestId(requestRefundCommand.getRequestId()) .funderAddress(requestRefundCommand.getFunderAddress()) .requestedBy(req... |
@Test public void findAllRefundRequestsForRequestIdAndStatus() { final long requestId = 3389L; final RefundRequestStatus status = PENDING; final List<RefundRequest> refundRequests = new ArrayList<>(); final ArrayList<RefundRequestDto> refundRequestDtos = new ArrayList<>(); when(refundRequestRepository.findAllByRequestI... | @Override @Transactional(readOnly = true) public List<RefundRequestDto> findAllRefundRequestsFor(final long requestId, final RefundRequestStatus... statuses) { return refundRequestDtoMapper.mapToList(refundRequestRepository.findAllByRequestIdAndStatusIn(requestId, statuses)); } | RefundServiceImpl implements RefundService { @Override @Transactional(readOnly = true) public List<RefundRequestDto> findAllRefundRequestsFor(final long requestId, final RefundRequestStatus... statuses) { return refundRequestDtoMapper.mapToList(refundRequestRepository.findAllByRequestIdAndStatusIn(requestId, statuses))... | RefundServiceImpl implements RefundService { @Override @Transactional(readOnly = true) public List<RefundRequestDto> findAllRefundRequestsFor(final long requestId, final RefundRequestStatus... statuses) { return refundRequestDtoMapper.mapToList(refundRequestRepository.findAllByRequestIdAndStatusIn(requestId, statuses))... | RefundServiceImpl implements RefundService { @Override @Transactional(readOnly = true) public List<RefundRequestDto> findAllRefundRequestsFor(final long requestId, final RefundRequestStatus... statuses) { return refundRequestDtoMapper.mapToList(refundRequestRepository.findAllByRequestIdAndStatusIn(requestId, statuses))... | RefundServiceImpl implements RefundService { @Override @Transactional(readOnly = true) public List<RefundRequestDto> findAllRefundRequestsFor(final long requestId, final RefundRequestStatus... statuses) { return refundRequestDtoMapper.mapToList(refundRequestRepository.findAllByRequestIdAndStatusIn(requestId, statuses))... |
@Test public void findAllRefundRequestsForRequestIdAndFunderAddressAndStatus() { final long requestId = 347L; final String funderAddress = "0x6457hfd"; final RefundRequestStatus status = PROCESSED; final List<RefundRequest> refundRequests = new ArrayList<>(); final ArrayList<RefundRequestDto> refundRequestDtos = new Ar... | @Override @Transactional(readOnly = true) public List<RefundRequestDto> findAllRefundRequestsFor(final long requestId, final RefundRequestStatus... statuses) { return refundRequestDtoMapper.mapToList(refundRequestRepository.findAllByRequestIdAndStatusIn(requestId, statuses)); } | RefundServiceImpl implements RefundService { @Override @Transactional(readOnly = true) public List<RefundRequestDto> findAllRefundRequestsFor(final long requestId, final RefundRequestStatus... statuses) { return refundRequestDtoMapper.mapToList(refundRequestRepository.findAllByRequestIdAndStatusIn(requestId, statuses))... | RefundServiceImpl implements RefundService { @Override @Transactional(readOnly = true) public List<RefundRequestDto> findAllRefundRequestsFor(final long requestId, final RefundRequestStatus... statuses) { return refundRequestDtoMapper.mapToList(refundRequestRepository.findAllByRequestIdAndStatusIn(requestId, statuses))... | RefundServiceImpl implements RefundService { @Override @Transactional(readOnly = true) public List<RefundRequestDto> findAllRefundRequestsFor(final long requestId, final RefundRequestStatus... statuses) { return refundRequestDtoMapper.mapToList(refundRequestRepository.findAllByRequestIdAndStatusIn(requestId, statuses))... | RefundServiceImpl implements RefundService { @Override @Transactional(readOnly = true) public List<RefundRequestDto> findAllRefundRequestsFor(final long requestId, final RefundRequestStatus... statuses) { return refundRequestDtoMapper.mapToList(refundRequestRepository.findAllByRequestIdAndStatusIn(requestId, statuses))... |
@Test public void refundProcessed_firstEvent() { final long requestId = 644L; final String amount = "4530000000000000000"; final String tokenHash = "0x05466"; final String funderAddress = "0x67879809"; final long blockchainEventId = 34L; final String transactionHash = "0x46578"; final String requestedBy = "gfhchj"; fin... | @Override @Transactional public void refundProcessed(final RefundProcessedCommand command) { final List<RefundRequest> refundRequests = refundRequestRepository.findAllByRequestIdAndStatusIn(command.getRequestId(), APPROVED); refundRequests.forEach(refundRequest -> { refundRequest.setStatus(PROCESSED); refundRequest.set... | RefundServiceImpl implements RefundService { @Override @Transactional public void refundProcessed(final RefundProcessedCommand command) { final List<RefundRequest> refundRequests = refundRequestRepository.findAllByRequestIdAndStatusIn(command.getRequestId(), APPROVED); refundRequests.forEach(refundRequest -> { refundRe... | RefundServiceImpl implements RefundService { @Override @Transactional public void refundProcessed(final RefundProcessedCommand command) { final List<RefundRequest> refundRequests = refundRequestRepository.findAllByRequestIdAndStatusIn(command.getRequestId(), APPROVED); refundRequests.forEach(refundRequest -> { refundRe... | RefundServiceImpl implements RefundService { @Override @Transactional public void refundProcessed(final RefundProcessedCommand command) { final List<RefundRequest> refundRequests = refundRequestRepository.findAllByRequestIdAndStatusIn(command.getRequestId(), APPROVED); refundRequests.forEach(refundRequest -> { refundRe... | RefundServiceImpl implements RefundService { @Override @Transactional public void refundProcessed(final RefundProcessedCommand command) { final List<RefundRequest> refundRequests = refundRequestRepository.findAllByRequestIdAndStatusIn(command.getRequestId(), APPROVED); refundRequests.forEach(refundRequest -> { refundRe... |
@Test public void refundProcessed_nthEvent() { final long requestId = 644L; final String amount = "4530000000000000000"; final String tokenHash = "0x05466"; final String funderAddress = "0x67879809"; final long blockchainEventId = 34L; final String transactionHash = "0x46578"; final String requestedBy = "fhghjvkbj"; fi... | @Override @Transactional public void refundProcessed(final RefundProcessedCommand command) { final List<RefundRequest> refundRequests = refundRequestRepository.findAllByRequestIdAndStatusIn(command.getRequestId(), APPROVED); refundRequests.forEach(refundRequest -> { refundRequest.setStatus(PROCESSED); refundRequest.set... | RefundServiceImpl implements RefundService { @Override @Transactional public void refundProcessed(final RefundProcessedCommand command) { final List<RefundRequest> refundRequests = refundRequestRepository.findAllByRequestIdAndStatusIn(command.getRequestId(), APPROVED); refundRequests.forEach(refundRequest -> { refundRe... | RefundServiceImpl implements RefundService { @Override @Transactional public void refundProcessed(final RefundProcessedCommand command) { final List<RefundRequest> refundRequests = refundRequestRepository.findAllByRequestIdAndStatusIn(command.getRequestId(), APPROVED); refundRequests.forEach(refundRequest -> { refundRe... | RefundServiceImpl implements RefundService { @Override @Transactional public void refundProcessed(final RefundProcessedCommand command) { final List<RefundRequest> refundRequests = refundRequestRepository.findAllByRequestIdAndStatusIn(command.getRequestId(), APPROVED); refundRequests.forEach(refundRequest -> { refundRe... | RefundServiceImpl implements RefundService { @Override @Transactional public void refundProcessed(final RefundProcessedCommand command) { final List<RefundRequest> refundRequests = refundRequestRepository.findAllByRequestIdAndStatusIn(command.getRequestId(), APPROVED); refundRequests.forEach(refundRequest -> { refundRe... |
@Test public void showEditPage() throws Exception { String type = MessageType.REFERRAL_SHARE.toString(); String name = "name"; MessageDto messageDto = mock(MessageDto.class); when(messageService.getMessageByTypeAndName(MessageType.REFERRAL_SHARE, name)).thenReturn(messageDto); this.mockMvc.perform(get("/messages/{type}... | @RequestMapping("/messages/{type}/{name}/edit") public ModelAndView showEditPage(final Model model, @PathVariable String type, @PathVariable String name) { model.addAttribute("message", messageService.getMessageByTypeAndName(MessageType.valueOf(type.toUpperCase()), name)); return new ModelAndView("messages/edit"); } | MessagesController extends AbstractController { @RequestMapping("/messages/{type}/{name}/edit") public ModelAndView showEditPage(final Model model, @PathVariable String type, @PathVariable String name) { model.addAttribute("message", messageService.getMessageByTypeAndName(MessageType.valueOf(type.toUpperCase()), name))... | MessagesController extends AbstractController { @RequestMapping("/messages/{type}/{name}/edit") public ModelAndView showEditPage(final Model model, @PathVariable String type, @PathVariable String name) { model.addAttribute("message", messageService.getMessageByTypeAndName(MessageType.valueOf(type.toUpperCase()), name))... | MessagesController extends AbstractController { @RequestMapping("/messages/{type}/{name}/edit") public ModelAndView showEditPage(final Model model, @PathVariable String type, @PathVariable String name) { model.addAttribute("message", messageService.getMessageByTypeAndName(MessageType.valueOf(type.toUpperCase()), name))... | MessagesController extends AbstractController { @RequestMapping("/messages/{type}/{name}/edit") public ModelAndView showEditPage(final Model model, @PathVariable String type, @PathVariable String name) { model.addAttribute("message", messageService.getMessageByTypeAndName(MessageType.valueOf(type.toUpperCase()), name))... |
@Test public void refundProcessed_nthEventnoRefundRequestForTransactionFound() { final long requestId = 644L; final String amount = "4530000000000000000"; final String tokenHash = "0x05466"; final String funderAddress = "0x67879809"; final long blockchainEventId = 34L; final String transactionHash = "0x46578"; final Ca... | @Override @Transactional public void refundProcessed(final RefundProcessedCommand command) { final List<RefundRequest> refundRequests = refundRequestRepository.findAllByRequestIdAndStatusIn(command.getRequestId(), APPROVED); refundRequests.forEach(refundRequest -> { refundRequest.setStatus(PROCESSED); refundRequest.set... | RefundServiceImpl implements RefundService { @Override @Transactional public void refundProcessed(final RefundProcessedCommand command) { final List<RefundRequest> refundRequests = refundRequestRepository.findAllByRequestIdAndStatusIn(command.getRequestId(), APPROVED); refundRequests.forEach(refundRequest -> { refundRe... | RefundServiceImpl implements RefundService { @Override @Transactional public void refundProcessed(final RefundProcessedCommand command) { final List<RefundRequest> refundRequests = refundRequestRepository.findAllByRequestIdAndStatusIn(command.getRequestId(), APPROVED); refundRequests.forEach(refundRequest -> { refundRe... | RefundServiceImpl implements RefundService { @Override @Transactional public void refundProcessed(final RefundProcessedCommand command) { final List<RefundRequest> refundRequests = refundRequestRepository.findAllByRequestIdAndStatusIn(command.getRequestId(), APPROVED); refundRequests.forEach(refundRequest -> { refundRe... | RefundServiceImpl implements RefundService { @Override @Transactional public void refundProcessed(final RefundProcessedCommand command) { final List<RefundRequest> refundRequests = refundRequestRepository.findAllByRequestIdAndStatusIn(command.getRequestId(), APPROVED); refundRequests.forEach(refundRequest -> { refundRe... |
@Test void testNoDuplicates() throws Exception { String platform = "GITHUB"; String platformId = "FundRequest|FR|area51|FR|3"; when(tokenWhitelistPreconditionContract.amountOftokens().send().intValue()).thenReturn(3); when(tokenWhitelistPreconditionContract.token(BigInteger.valueOf(0))).thenReturn(Optional.of("FND")); ... | @Cacheable(value = "possible_tokens", keyGenerator = "getAllPossibleTokensKeyGenerator") public List<TokenInfoDto> getAllPossibleTokens(final String platform, final String platformId) { return checkNotEmpty(getAllPossibleTokens().stream() .filter(token -> tokenWhitelistPreconditionContract.isValid(platform, platformId,... | FundRequestContractsService { @Cacheable(value = "possible_tokens", keyGenerator = "getAllPossibleTokensKeyGenerator") public List<TokenInfoDto> getAllPossibleTokens(final String platform, final String platformId) { return checkNotEmpty(getAllPossibleTokens().stream() .filter(token -> tokenWhitelistPreconditionContract... | FundRequestContractsService { @Cacheable(value = "possible_tokens", keyGenerator = "getAllPossibleTokensKeyGenerator") public List<TokenInfoDto> getAllPossibleTokens(final String platform, final String platformId) { return checkNotEmpty(getAllPossibleTokens().stream() .filter(token -> tokenWhitelistPreconditionContract... | FundRequestContractsService { @Cacheable(value = "possible_tokens", keyGenerator = "getAllPossibleTokensKeyGenerator") public List<TokenInfoDto> getAllPossibleTokens(final String platform, final String platformId) { return checkNotEmpty(getAllPossibleTokens().stream() .filter(token -> tokenWhitelistPreconditionContract... | FundRequestContractsService { @Cacheable(value = "possible_tokens", keyGenerator = "getAllPossibleTokensKeyGenerator") public List<TokenInfoDto> getAllPossibleTokens(final String platform, final String platformId) { return checkNotEmpty(getAllPossibleTokens().stream() .filter(token -> tokenWhitelistPreconditionContract... |
@Test public void getAllPossibleTokens_throwsResourceNotFoundException_whenEmpty() { final String platform = "GITHUB"; final String platformId = "FundRequest|FR|area51|FR|3"; when(tokenWhitelistPreconditionContract.token(any(BigInteger.class))).thenReturn(Optional.empty()); try { fundRequestContractsService.getAllPossi... | @Cacheable(value = "possible_tokens", keyGenerator = "getAllPossibleTokensKeyGenerator") public List<TokenInfoDto> getAllPossibleTokens(final String platform, final String platformId) { return checkNotEmpty(getAllPossibleTokens().stream() .filter(token -> tokenWhitelistPreconditionContract.isValid(platform, platformId,... | FundRequestContractsService { @Cacheable(value = "possible_tokens", keyGenerator = "getAllPossibleTokensKeyGenerator") public List<TokenInfoDto> getAllPossibleTokens(final String platform, final String platformId) { return checkNotEmpty(getAllPossibleTokens().stream() .filter(token -> tokenWhitelistPreconditionContract... | FundRequestContractsService { @Cacheable(value = "possible_tokens", keyGenerator = "getAllPossibleTokensKeyGenerator") public List<TokenInfoDto> getAllPossibleTokens(final String platform, final String platformId) { return checkNotEmpty(getAllPossibleTokens().stream() .filter(token -> tokenWhitelistPreconditionContract... | FundRequestContractsService { @Cacheable(value = "possible_tokens", keyGenerator = "getAllPossibleTokensKeyGenerator") public List<TokenInfoDto> getAllPossibleTokens(final String platform, final String platformId) { return checkNotEmpty(getAllPossibleTokens().stream() .filter(token -> tokenWhitelistPreconditionContract... | FundRequestContractsService { @Cacheable(value = "possible_tokens", keyGenerator = "getAllPossibleTokensKeyGenerator") public List<TokenInfoDto> getAllPossibleTokens(final String platform, final String platformId) { return checkNotEmpty(getAllPossibleTokens().stream() .filter(token -> tokenWhitelistPreconditionContract... |
@Test void generate_GitHubKey() { final String owner = "sgfgs"; final String repo = "szgff"; final String platform = Platform.GITHUB.name(); final String result = (String) keyGenerator.generate(randomTarget, randomMethod, platform, owner + "|FR|" + repo + "|FR|435"); assertThat(result).isEqualTo(platform + "-" + owner ... | @Override public Object generate(final Object target, final Method method, final Object... params) { final String platform = (String) params[0]; if (Platform.GITHUB.name().equalsIgnoreCase(platform)) { return generateGitHubKey(platform, (String) params[1]); } return fallbackKeyGenerator.generate(target, method, params)... | GetAllPossibleTokensKeyGenerator implements KeyGenerator { @Override public Object generate(final Object target, final Method method, final Object... params) { final String platform = (String) params[0]; if (Platform.GITHUB.name().equalsIgnoreCase(platform)) { return generateGitHubKey(platform, (String) params[1]); } r... | GetAllPossibleTokensKeyGenerator implements KeyGenerator { @Override public Object generate(final Object target, final Method method, final Object... params) { final String platform = (String) params[0]; if (Platform.GITHUB.name().equalsIgnoreCase(platform)) { return generateGitHubKey(platform, (String) params[1]); } r... | GetAllPossibleTokensKeyGenerator implements KeyGenerator { @Override public Object generate(final Object target, final Method method, final Object... params) { final String platform = (String) params[0]; if (Platform.GITHUB.name().equalsIgnoreCase(platform)) { return generateGitHubKey(platform, (String) params[1]); } r... | GetAllPossibleTokensKeyGenerator implements KeyGenerator { @Override public Object generate(final Object target, final Method method, final Object... params) { final String platform = (String) params[0]; if (Platform.GITHUB.name().equalsIgnoreCase(platform)) { return generateGitHubKey(platform, (String) params[1]); } r... |
@Test void generate_OtherPlatformKey() { final String platform = Platform.STACK_OVERFLOW.name(); final String platformId = "sgfgasfdgshd5"; final String expected = "someKey"; when(fallbackKeyGenerator.generate(randomTarget, randomMethod, platform, platformId)).thenReturn(expected); final String result = (String) keyGen... | @Override public Object generate(final Object target, final Method method, final Object... params) { final String platform = (String) params[0]; if (Platform.GITHUB.name().equalsIgnoreCase(platform)) { return generateGitHubKey(platform, (String) params[1]); } return fallbackKeyGenerator.generate(target, method, params)... | GetAllPossibleTokensKeyGenerator implements KeyGenerator { @Override public Object generate(final Object target, final Method method, final Object... params) { final String platform = (String) params[0]; if (Platform.GITHUB.name().equalsIgnoreCase(platform)) { return generateGitHubKey(platform, (String) params[1]); } r... | GetAllPossibleTokensKeyGenerator implements KeyGenerator { @Override public Object generate(final Object target, final Method method, final Object... params) { final String platform = (String) params[0]; if (Platform.GITHUB.name().equalsIgnoreCase(platform)) { return generateGitHubKey(platform, (String) params[1]); } r... | GetAllPossibleTokensKeyGenerator implements KeyGenerator { @Override public Object generate(final Object target, final Method method, final Object... params) { final String platform = (String) params[0]; if (Platform.GITHUB.name().equalsIgnoreCase(platform)) { return generateGitHubKey(platform, (String) params[1]); } r... | GetAllPossibleTokensKeyGenerator implements KeyGenerator { @Override public Object generate(final Object target, final Method method, final Object... params) { final String platform = (String) params[0]; if (Platform.GITHUB.name().equalsIgnoreCase(platform)) { return generateGitHubKey(platform, (String) params[1]); } r... |
@Test public void handle() { long fundId = 243L; long requestId = 764L; final String message = "ewfegdbf"; final RequestFundedNotificationDto notification = RequestFundedNotificationDto.builder().fundId(fundId).requestId(requestId).build(); final TokenValueDto tokenValue = TokenValueDtoMother.FND().build(); final FundD... | @EventListener @Async("taskExecutor") @Transactional(readOnly = true, propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { final FundDto fund = fundService.findOne(notification.getFundId()); Context context = new Context(); context.setVariable("platformBasePath", platformBas... | TweetRequestFundedHandler { @EventListener @Async("taskExecutor") @Transactional(readOnly = true, propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { final FundDto fund = fundService.findOne(notification.getFundId()); Context context = new Context(); context.setVariable("pl... | TweetRequestFundedHandler { @EventListener @Async("taskExecutor") @Transactional(readOnly = true, propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { final FundDto fund = fundService.findOne(notification.getFundId()); Context context = new Context(); context.setVariable("pl... | TweetRequestFundedHandler { @EventListener @Async("taskExecutor") @Transactional(readOnly = true, propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { final FundDto fund = fundService.findOne(notification.getFundId()); Context context = new Context(); context.setVariable("pl... | TweetRequestFundedHandler { @EventListener @Async("taskExecutor") @Transactional(readOnly = true, propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { final FundDto fund = fundService.findOne(notification.getFundId()); Context context = new Context(); context.setVariable("pl... |
@Test void handleRequestFunded() { final RequestFundedNotificationDto notificationDto = RequestFundedNotificationDto.builder().build(); final RequestFundedNotification notification = RequestFundedNotificationMother.aRequestFundedNotification(); when(requestFundedNotificationMapper.map(same(notificationDto))).thenReturn... | @EventListener @Transactional(propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { notificationRepository.save(requestFundedNotificationMapper.map(notification)); } | PersistNotificationHandler { @EventListener @Transactional(propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { notificationRepository.save(requestFundedNotificationMapper.map(notification)); } } | PersistNotificationHandler { @EventListener @Transactional(propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { notificationRepository.save(requestFundedNotificationMapper.map(notification)); } PersistNotificationHandler(final NotificationRepository notificationRepository,
... | PersistNotificationHandler { @EventListener @Transactional(propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { notificationRepository.save(requestFundedNotificationMapper.map(notification)); } PersistNotificationHandler(final NotificationRepository notificationRepository,
... | PersistNotificationHandler { @EventListener @Transactional(propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { notificationRepository.save(requestFundedNotificationMapper.map(notification)); } PersistNotificationHandler(final NotificationRepository notificationRepository,
... |
@Test void handleRequestClaimed() { final RequestClaimedNotificationDto notificationDto = RequestClaimedNotificationDto.builder().build(); final RequestClaimedNotification notification = RequestClaimedNotificationMother.aRequestClaimedNotification(); when(requestClaimedNotificationMapper.map(same(notificationDto))).the... | @EventListener @Transactional(propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { notificationRepository.save(requestFundedNotificationMapper.map(notification)); } | PersistNotificationHandler { @EventListener @Transactional(propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { notificationRepository.save(requestFundedNotificationMapper.map(notification)); } } | PersistNotificationHandler { @EventListener @Transactional(propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { notificationRepository.save(requestFundedNotificationMapper.map(notification)); } PersistNotificationHandler(final NotificationRepository notificationRepository,
... | PersistNotificationHandler { @EventListener @Transactional(propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { notificationRepository.save(requestFundedNotificationMapper.map(notification)); } PersistNotificationHandler(final NotificationRepository notificationRepository,
... | PersistNotificationHandler { @EventListener @Transactional(propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { notificationRepository.save(requestFundedNotificationMapper.map(notification)); } PersistNotificationHandler(final NotificationRepository notificationRepository,
... |
@Test void invoke() { when(env.getProperty("notAGroup2.public")).thenReturn("false"); when(env.getProperty("notAGroup3")).thenReturn("aefsd"); when(env.getProperty("notAGroup3.public")).thenReturn("true"); when(env.getProperty("aszgf.dsads")).thenReturn("sdf"); when(env.getProperty("aszgf.dsads.public")).thenReturn("tr... | @Override public Map<String, Object> invoke() { return filterOutNonPublicProperties(environmentEndpoint.invoke()); } | PublicEnvironmentEndpoint extends AbstractEndpoint<Map<String, Object>> { @Override public Map<String, Object> invoke() { return filterOutNonPublicProperties(environmentEndpoint.invoke()); } } | PublicEnvironmentEndpoint extends AbstractEndpoint<Map<String, Object>> { @Override public Map<String, Object> invoke() { return filterOutNonPublicProperties(environmentEndpoint.invoke()); } PublicEnvironmentEndpoint(final EnvironmentEndpoint environmentEndpoint,
@Value("${endpoints... | PublicEnvironmentEndpoint extends AbstractEndpoint<Map<String, Object>> { @Override public Map<String, Object> invoke() { return filterOutNonPublicProperties(environmentEndpoint.invoke()); } PublicEnvironmentEndpoint(final EnvironmentEndpoint environmentEndpoint,
@Value("${endpoints... | PublicEnvironmentEndpoint extends AbstractEndpoint<Map<String, Object>> { @Override public Map<String, Object> invoke() { return filterOutNonPublicProperties(environmentEndpoint.invoke()); } PublicEnvironmentEndpoint(final EnvironmentEndpoint environmentEndpoint,
@Value("${endpoints... |
@Test void overwritten() { when(env.getProperty("network")).thenReturn("kovan"); when(env.getProperty("network.public")).thenReturn("true"); final Map<String, Object> envProperties = MapBuilder.<String, Object>builder() .put("network", "kovan") .put("network", "main") .put("network.public", "true") .build(); when(envir... | @Override public Map<String, Object> invoke() { return filterOutNonPublicProperties(environmentEndpoint.invoke()); } | PublicEnvironmentEndpoint extends AbstractEndpoint<Map<String, Object>> { @Override public Map<String, Object> invoke() { return filterOutNonPublicProperties(environmentEndpoint.invoke()); } } | PublicEnvironmentEndpoint extends AbstractEndpoint<Map<String, Object>> { @Override public Map<String, Object> invoke() { return filterOutNonPublicProperties(environmentEndpoint.invoke()); } PublicEnvironmentEndpoint(final EnvironmentEndpoint environmentEndpoint,
@Value("${endpoints... | PublicEnvironmentEndpoint extends AbstractEndpoint<Map<String, Object>> { @Override public Map<String, Object> invoke() { return filterOutNonPublicProperties(environmentEndpoint.invoke()); } PublicEnvironmentEndpoint(final EnvironmentEndpoint environmentEndpoint,
@Value("${endpoints... | PublicEnvironmentEndpoint extends AbstractEndpoint<Map<String, Object>> { @Override public Map<String, Object> invoke() { return filterOutNonPublicProperties(environmentEndpoint.invoke()); } PublicEnvironmentEndpoint(final EnvironmentEndpoint environmentEndpoint,
@Value("${endpoints... |
@Test public void add() throws Exception { String type = MessageType.REFERRAL_SHARE.toString(); this.mockMvc.perform(post("/messages/{type}/add", type)) .andExpect(redirectAlert("success", "Message added")) .andExpect(redirectedUrl("/messages/" + type)); } | @PostMapping("/messages/{type}/add") public ModelAndView add(WebRequest request, @PathVariable String type, RedirectAttributes redirectAttributes) { MessageDto messageDto = MessageDto.builder() .name(request.getParameter("name")) .type(MessageType.valueOf(type.toUpperCase())) .title(request.getParameter("title")) .desc... | MessagesController extends AbstractController { @PostMapping("/messages/{type}/add") public ModelAndView add(WebRequest request, @PathVariable String type, RedirectAttributes redirectAttributes) { MessageDto messageDto = MessageDto.builder() .name(request.getParameter("name")) .type(MessageType.valueOf(type.toUpperCase... | MessagesController extends AbstractController { @PostMapping("/messages/{type}/add") public ModelAndView add(WebRequest request, @PathVariable String type, RedirectAttributes redirectAttributes) { MessageDto messageDto = MessageDto.builder() .name(request.getParameter("name")) .type(MessageType.valueOf(type.toUpperCase... | MessagesController extends AbstractController { @PostMapping("/messages/{type}/add") public ModelAndView add(WebRequest request, @PathVariable String type, RedirectAttributes redirectAttributes) { MessageDto messageDto = MessageDto.builder() .name(request.getParameter("name")) .type(MessageType.valueOf(type.toUpperCase... | MessagesController extends AbstractController { @PostMapping("/messages/{type}/add") public ModelAndView add(WebRequest request, @PathVariable String type, RedirectAttributes redirectAttributes) { MessageDto messageDto = MessageDto.builder() .name(request.getParameter("name")) .type(MessageType.valueOf(type.toUpperCase... |
@Test public void svgTemplateResolver() { final ApplicationContext applicationContext = mock(ApplicationContext.class); config.setApplicationContext(applicationContext); final SpringResourceTemplateResolver templateResolver = (SpringResourceTemplateResolver) config.svgTemplateResolver(); assertThat(templateResolver).ha... | @Bean public ITemplateResolver svgTemplateResolver() { final SpringResourceTemplateResolver svgTemplateResolver = new SpringResourceTemplateResolver(); svgTemplateResolver.setApplicationContext(applicationContext); svgTemplateResolver.setPrefix("classpath:/templates/svg/"); svgTemplateResolver.setTemplateMode(TemplateM... | ThymeleafSvgConfig implements ApplicationContextAware { @Bean public ITemplateResolver svgTemplateResolver() { final SpringResourceTemplateResolver svgTemplateResolver = new SpringResourceTemplateResolver(); svgTemplateResolver.setApplicationContext(applicationContext); svgTemplateResolver.setPrefix("classpath:/templat... | ThymeleafSvgConfig implements ApplicationContextAware { @Bean public ITemplateResolver svgTemplateResolver() { final SpringResourceTemplateResolver svgTemplateResolver = new SpringResourceTemplateResolver(); svgTemplateResolver.setApplicationContext(applicationContext); svgTemplateResolver.setPrefix("classpath:/templat... | ThymeleafSvgConfig implements ApplicationContextAware { @Bean public ITemplateResolver svgTemplateResolver() { final SpringResourceTemplateResolver svgTemplateResolver = new SpringResourceTemplateResolver(); svgTemplateResolver.setApplicationContext(applicationContext); svgTemplateResolver.setPrefix("classpath:/templat... | ThymeleafSvgConfig implements ApplicationContextAware { @Bean public ITemplateResolver svgTemplateResolver() { final SpringResourceTemplateResolver svgTemplateResolver = new SpringResourceTemplateResolver(); svgTemplateResolver.setApplicationContext(applicationContext); svgTemplateResolver.setPrefix("classpath:/templat... |
@Test public void svgViewResolver() { final SpringTemplateEngine templateEngine = mock(SpringTemplateEngine.class); final ThymeleafViewResolver viewResolver = config.svgViewResolver(templateEngine); assertThat(viewResolver.getTemplateEngine()).isEqualTo(templateEngine); assertThat(viewResolver.getOrder()).isEqualTo(0);... | @Bean public ThymeleafViewResolver svgViewResolver(final SpringTemplateEngine templateEngine) { final ThymeleafViewResolver thymeleafViewResolver = new ThymeleafViewResolver(); thymeleafViewResolver.setTemplateEngine(templateEngine); thymeleafViewResolver.setOrder(0); thymeleafViewResolver.setCharacterEncoding("UTF-8")... | ThymeleafSvgConfig implements ApplicationContextAware { @Bean public ThymeleafViewResolver svgViewResolver(final SpringTemplateEngine templateEngine) { final ThymeleafViewResolver thymeleafViewResolver = new ThymeleafViewResolver(); thymeleafViewResolver.setTemplateEngine(templateEngine); thymeleafViewResolver.setOrder... | ThymeleafSvgConfig implements ApplicationContextAware { @Bean public ThymeleafViewResolver svgViewResolver(final SpringTemplateEngine templateEngine) { final ThymeleafViewResolver thymeleafViewResolver = new ThymeleafViewResolver(); thymeleafViewResolver.setTemplateEngine(templateEngine); thymeleafViewResolver.setOrder... | ThymeleafSvgConfig implements ApplicationContextAware { @Bean public ThymeleafViewResolver svgViewResolver(final SpringTemplateEngine templateEngine) { final ThymeleafViewResolver thymeleafViewResolver = new ThymeleafViewResolver(); thymeleafViewResolver.setTemplateEngine(templateEngine); thymeleafViewResolver.setOrder... | ThymeleafSvgConfig implements ApplicationContextAware { @Bean public ThymeleafViewResolver svgViewResolver(final SpringTemplateEngine templateEngine) { final ThymeleafViewResolver thymeleafViewResolver = new ThymeleafViewResolver(); thymeleafViewResolver.setTemplateEngine(templateEngine); thymeleafViewResolver.setOrder... |
@Test void showProfile() throws Exception { MessageDto messageDto1 = MessageDto.builder() .type(MessageType.REFERRAL_SHARE) .name("twitter") .title("title1") .description("desc1") .link("https: .build(); MessageDto messageDto2 = MessageDto.builder() .type(MessageType.REFERRAL_SHARE) .name("twitter") .title("title1") .d... | @GetMapping("/profile") public ModelAndView showProfile(Principal principal) throws Exception { final ModelAndView mav = new ModelAndView("pages/profile/index"); mav.addObject("isVerifiedGithub", isVerifiedGithub(principal)); mav.addObject("isVerifiedStackOverflow", isVerifiedStackOverflow(principal)); mav.addObject("r... | ProfileController { @GetMapping("/profile") public ModelAndView showProfile(Principal principal) throws Exception { final ModelAndView mav = new ModelAndView("pages/profile/index"); mav.addObject("isVerifiedGithub", isVerifiedGithub(principal)); mav.addObject("isVerifiedStackOverflow", isVerifiedStackOverflow(principal... | ProfileController { @GetMapping("/profile") public ModelAndView showProfile(Principal principal) throws Exception { final ModelAndView mav = new ModelAndView("pages/profile/index"); mav.addObject("isVerifiedGithub", isVerifiedGithub(principal)); mav.addObject("isVerifiedStackOverflow", isVerifiedStackOverflow(principal... | ProfileController { @GetMapping("/profile") public ModelAndView showProfile(Principal principal) throws Exception { final ModelAndView mav = new ModelAndView("pages/profile/index"); mav.addObject("isVerifiedGithub", isVerifiedGithub(principal)); mav.addObject("isVerifiedStackOverflow", isVerifiedStackOverflow(principal... | ProfileController { @GetMapping("/profile") public ModelAndView showProfile(Principal principal) throws Exception { final ModelAndView mav = new ModelAndView("pages/profile/index"); mav.addObject("isVerifiedGithub", isVerifiedGithub(principal)); mav.addObject("isVerifiedStackOverflow", isVerifiedStackOverflow(principal... |
@Test void manageWallets() throws Exception { KeycloakAuthenticationToken principal = mock(KeycloakAuthenticationToken.class); when(profileService.getArkaneAccessToken(principal)).thenReturn("token"); mockMvc.perform(get("/profile/managewallets") .principal(principal)) .andExpect(status().is3xxRedirection()) .andExpect... | @GetMapping("/profile/managewallets") public ModelAndView manageWallets(Principal principal, HttpServletRequest request) throws UnsupportedEncodingException { String bearerToken = URLEncoder.encode(profileService.getArkaneAccessToken((KeycloakAuthenticationToken) principal), "UTF-8"); String redirectUri = request.getHe... | ProfileController { @GetMapping("/profile/managewallets") public ModelAndView manageWallets(Principal principal, HttpServletRequest request) throws UnsupportedEncodingException { String bearerToken = URLEncoder.encode(profileService.getArkaneAccessToken((KeycloakAuthenticationToken) principal), "UTF-8"); String redirec... | ProfileController { @GetMapping("/profile/managewallets") public ModelAndView manageWallets(Principal principal, HttpServletRequest request) throws UnsupportedEncodingException { String bearerToken = URLEncoder.encode(profileService.getArkaneAccessToken((KeycloakAuthenticationToken) principal), "UTF-8"); String redirec... | ProfileController { @GetMapping("/profile/managewallets") public ModelAndView manageWallets(Principal principal, HttpServletRequest request) throws UnsupportedEncodingException { String bearerToken = URLEncoder.encode(profileService.getArkaneAccessToken((KeycloakAuthenticationToken) principal), "UTF-8"); String redirec... | ProfileController { @GetMapping("/profile/managewallets") public ModelAndView manageWallets(Principal principal, HttpServletRequest request) throws UnsupportedEncodingException { String bearerToken = URLEncoder.encode(profileService.getArkaneAccessToken((KeycloakAuthenticationToken) principal), "UTF-8"); String redirec... |
@Test void updateHeadline() throws Exception { KeycloakAuthenticationToken principal = mock(KeycloakAuthenticationToken.class); when(profileService.getArkaneAccessToken(principal)).thenReturn("token"); mockMvc.perform(post("/profile/headline") .param("headline", "headline") .principal(principal)) .andExpect(status().is... | @PostMapping("/profile/headline") public ModelAndView updateHeadline(Principal principal, @RequestParam("headline") String headline) { profileService.updateHeadline(principal, headline); return redirectToProfile(); } | ProfileController { @PostMapping("/profile/headline") public ModelAndView updateHeadline(Principal principal, @RequestParam("headline") String headline) { profileService.updateHeadline(principal, headline); return redirectToProfile(); } } | ProfileController { @PostMapping("/profile/headline") public ModelAndView updateHeadline(Principal principal, @RequestParam("headline") String headline) { profileService.updateHeadline(principal, headline); return redirectToProfile(); } ProfileController(final ApplicationEventPublisher eventPublisher,
... | ProfileController { @PostMapping("/profile/headline") public ModelAndView updateHeadline(Principal principal, @RequestParam("headline") String headline) { profileService.updateHeadline(principal, headline); return redirectToProfile(); } ProfileController(final ApplicationEventPublisher eventPublisher,
... | ProfileController { @PostMapping("/profile/headline") public ModelAndView updateHeadline(Principal principal, @RequestParam("headline") String headline) { profileService.updateHeadline(principal, headline); return redirectToProfile(); } ProfileController(final ApplicationEventPublisher eventPublisher,
... |
@Test void getAllExpressionObjectNames() { assertThat(objectFactory.getAllExpressionObjectNames()).containsExactlyInAnyOrder(expressionObjectsMap.keySet().toArray(new String[0])); } | @Override public Set<String> getAllExpressionObjectNames() { return expressionObjectsMap.keySet(); } | FundrequestExpressionObjectFactory implements IExpressionObjectFactory { @Override public Set<String> getAllExpressionObjectNames() { return expressionObjectsMap.keySet(); } } | FundrequestExpressionObjectFactory implements IExpressionObjectFactory { @Override public Set<String> getAllExpressionObjectNames() { return expressionObjectsMap.keySet(); } FundrequestExpressionObjectFactory(final Map<String, Object> expressionObjectsMap); } | FundrequestExpressionObjectFactory implements IExpressionObjectFactory { @Override public Set<String> getAllExpressionObjectNames() { return expressionObjectsMap.keySet(); } FundrequestExpressionObjectFactory(final Map<String, Object> expressionObjectsMap); @Override Set<String> getAllExpressionObjectNames(); @Override... | FundrequestExpressionObjectFactory implements IExpressionObjectFactory { @Override public Set<String> getAllExpressionObjectNames() { return expressionObjectsMap.keySet(); } FundrequestExpressionObjectFactory(final Map<String, Object> expressionObjectsMap); @Override Set<String> getAllExpressionObjectNames(); @Override... |
@Test void getExpressionObjectFactory() { assertThat(fundrequestDialect.getExpressionObjectFactory()).isSameAs(fundrequestExpressionObjectFactory); } | @Override public IExpressionObjectFactory getExpressionObjectFactory() { return fundrequestExpressionObjectFactory; } | FundrequestDialect extends AbstractDialect implements IExpressionObjectDialect { @Override public IExpressionObjectFactory getExpressionObjectFactory() { return fundrequestExpressionObjectFactory; } } | FundrequestDialect extends AbstractDialect implements IExpressionObjectDialect { @Override public IExpressionObjectFactory getExpressionObjectFactory() { return fundrequestExpressionObjectFactory; } FundrequestDialect(final IExpressionObjectFactory fundrequestExpressionObjectFactory); } | FundrequestDialect extends AbstractDialect implements IExpressionObjectDialect { @Override public IExpressionObjectFactory getExpressionObjectFactory() { return fundrequestExpressionObjectFactory; } FundrequestDialect(final IExpressionObjectFactory fundrequestExpressionObjectFactory); @Override IExpressionObjectFactory... | FundrequestDialect extends AbstractDialect implements IExpressionObjectDialect { @Override public IExpressionObjectFactory getExpressionObjectFactory() { return fundrequestExpressionObjectFactory; } FundrequestDialect(final IExpressionObjectFactory fundrequestExpressionObjectFactory); @Override IExpressionObjectFactory... |
@Test public void findByUserId() { final UserProfile expected = mock(UserProfile.class); Principal principal = PrincipalMother.davyvanroy(); when(profileService.getNonLoggedInUserProfile(principal.getName())).thenReturn(expected); final Optional<UserProfile> result = profiles.findByUserId(principal.getName()); assertTh... | public Optional<UserProfile> findByUserId(final String userId) { try { return StringUtils.isBlank(userId) ? Optional.empty() : Optional.ofNullable(profileService.getNonLoggedInUserProfile(userId)); } catch (Exception e) { LOGGER.error("Error getting profile for: \"" + userId + "\"", e); return Optional.empty(); } } | ProfilesExpressionObject { public Optional<UserProfile> findByUserId(final String userId) { try { return StringUtils.isBlank(userId) ? Optional.empty() : Optional.ofNullable(profileService.getNonLoggedInUserProfile(userId)); } catch (Exception e) { LOGGER.error("Error getting profile for: \"" + userId + "\"", e); retur... | ProfilesExpressionObject { public Optional<UserProfile> findByUserId(final String userId) { try { return StringUtils.isBlank(userId) ? Optional.empty() : Optional.ofNullable(profileService.getNonLoggedInUserProfile(userId)); } catch (Exception e) { LOGGER.error("Error getting profile for: \"" + userId + "\"", e); retur... | ProfilesExpressionObject { public Optional<UserProfile> findByUserId(final String userId) { try { return StringUtils.isBlank(userId) ? Optional.empty() : Optional.ofNullable(profileService.getNonLoggedInUserProfile(userId)); } catch (Exception e) { LOGGER.error("Error getting profile for: \"" + userId + "\"", e); retur... | ProfilesExpressionObject { public Optional<UserProfile> findByUserId(final String userId) { try { return StringUtils.isBlank(userId) ? Optional.empty() : Optional.ofNullable(profileService.getNonLoggedInUserProfile(userId)); } catch (Exception e) { LOGGER.error("Error getting profile for: \"" + userId + "\"", e); retur... |
@Test public void findByUserId_profileNull() { final String userId = "hgj"; when(profileService.getUserProfile(() -> userId)).thenReturn(null); final Optional<UserProfile> result = profiles.findByUserId(userId); assertThat(result).isEmpty(); } | public Optional<UserProfile> findByUserId(final String userId) { try { return StringUtils.isBlank(userId) ? Optional.empty() : Optional.ofNullable(profileService.getNonLoggedInUserProfile(userId)); } catch (Exception e) { LOGGER.error("Error getting profile for: \"" + userId + "\"", e); return Optional.empty(); } } | ProfilesExpressionObject { public Optional<UserProfile> findByUserId(final String userId) { try { return StringUtils.isBlank(userId) ? Optional.empty() : Optional.ofNullable(profileService.getNonLoggedInUserProfile(userId)); } catch (Exception e) { LOGGER.error("Error getting profile for: \"" + userId + "\"", e); retur... | ProfilesExpressionObject { public Optional<UserProfile> findByUserId(final String userId) { try { return StringUtils.isBlank(userId) ? Optional.empty() : Optional.ofNullable(profileService.getNonLoggedInUserProfile(userId)); } catch (Exception e) { LOGGER.error("Error getting profile for: \"" + userId + "\"", e); retur... | ProfilesExpressionObject { public Optional<UserProfile> findByUserId(final String userId) { try { return StringUtils.isBlank(userId) ? Optional.empty() : Optional.ofNullable(profileService.getNonLoggedInUserProfile(userId)); } catch (Exception e) { LOGGER.error("Error getting profile for: \"" + userId + "\"", e); retur... | ProfilesExpressionObject { public Optional<UserProfile> findByUserId(final String userId) { try { return StringUtils.isBlank(userId) ? Optional.empty() : Optional.ofNullable(profileService.getNonLoggedInUserProfile(userId)); } catch (Exception e) { LOGGER.error("Error getting profile for: \"" + userId + "\"", e); retur... |
@Test public void findByUserId_inputNull() { final Optional<UserProfile> result = profiles.findByUserId(null); verifyZeroInteractions(profileService); assertThat(result).isEmpty(); } | public Optional<UserProfile> findByUserId(final String userId) { try { return StringUtils.isBlank(userId) ? Optional.empty() : Optional.ofNullable(profileService.getNonLoggedInUserProfile(userId)); } catch (Exception e) { LOGGER.error("Error getting profile for: \"" + userId + "\"", e); return Optional.empty(); } } | ProfilesExpressionObject { public Optional<UserProfile> findByUserId(final String userId) { try { return StringUtils.isBlank(userId) ? Optional.empty() : Optional.ofNullable(profileService.getNonLoggedInUserProfile(userId)); } catch (Exception e) { LOGGER.error("Error getting profile for: \"" + userId + "\"", e); retur... | ProfilesExpressionObject { public Optional<UserProfile> findByUserId(final String userId) { try { return StringUtils.isBlank(userId) ? Optional.empty() : Optional.ofNullable(profileService.getNonLoggedInUserProfile(userId)); } catch (Exception e) { LOGGER.error("Error getting profile for: \"" + userId + "\"", e); retur... | ProfilesExpressionObject { public Optional<UserProfile> findByUserId(final String userId) { try { return StringUtils.isBlank(userId) ? Optional.empty() : Optional.ofNullable(profileService.getNonLoggedInUserProfile(userId)); } catch (Exception e) { LOGGER.error("Error getting profile for: \"" + userId + "\"", e); retur... | ProfilesExpressionObject { public Optional<UserProfile> findByUserId(final String userId) { try { return StringUtils.isBlank(userId) ? Optional.empty() : Optional.ofNullable(profileService.getNonLoggedInUserProfile(userId)); } catch (Exception e) { LOGGER.error("Error getting profile for: \"" + userId + "\"", e); retur... |
@Test public void update() throws Exception { String type = MessageType.REFERRAL_SHARE.toString(); String name = "name"; this.mockMvc.perform(post("/messages/{type}/{name}/edit", type, name)) .andExpect(redirectAlert("success", "Saved")) .andExpect(redirectedUrl("/messages/" + type)); } | @PostMapping("/messages/{type}/{name}/edit") public ModelAndView update(WebRequest request, @PathVariable String type, @PathVariable String name, RedirectAttributes redirectAttributes) { MessageDto messageDto = MessageDto.builder() .name(name) .type(MessageType.valueOf(type.toUpperCase())) .title(request.getParameter("... | MessagesController extends AbstractController { @PostMapping("/messages/{type}/{name}/edit") public ModelAndView update(WebRequest request, @PathVariable String type, @PathVariable String name, RedirectAttributes redirectAttributes) { MessageDto messageDto = MessageDto.builder() .name(name) .type(MessageType.valueOf(ty... | MessagesController extends AbstractController { @PostMapping("/messages/{type}/{name}/edit") public ModelAndView update(WebRequest request, @PathVariable String type, @PathVariable String name, RedirectAttributes redirectAttributes) { MessageDto messageDto = MessageDto.builder() .name(name) .type(MessageType.valueOf(ty... | MessagesController extends AbstractController { @PostMapping("/messages/{type}/{name}/edit") public ModelAndView update(WebRequest request, @PathVariable String type, @PathVariable String name, RedirectAttributes redirectAttributes) { MessageDto messageDto = MessageDto.builder() .name(name) .type(MessageType.valueOf(ty... | MessagesController extends AbstractController { @PostMapping("/messages/{type}/{name}/edit") public ModelAndView update(WebRequest request, @PathVariable String type, @PathVariable String name, RedirectAttributes redirectAttributes) { MessageDto messageDto = MessageDto.builder() .name(name) .type(MessageType.valueOf(ty... |
@Test public void getName() { final String name = "jhgk"; final UserProfile userProfile = UserProfile.builder().name(name).build(); final Function<UserProfile, String> result = profiles.getName(); assertThat(result.apply(userProfile)).isEqualTo(name); } | public Function<UserProfile, String> getName() { return UserProfile::getName; } | ProfilesExpressionObject { public Function<UserProfile, String> getName() { return UserProfile::getName; } } | ProfilesExpressionObject { public Function<UserProfile, String> getName() { return UserProfile::getName; } ProfilesExpressionObject(final ProfileService profileService); } | ProfilesExpressionObject { public Function<UserProfile, String> getName() { return UserProfile::getName; } ProfilesExpressionObject(final ProfileService profileService); Optional<UserProfile> findByUserId(final String userId); Function<UserProfile, String> getName(); } | ProfilesExpressionObject { public Function<UserProfile, String> getName() { return UserProfile::getName; } ProfilesExpressionObject(final ProfileService profileService); Optional<UserProfile> findByUserId(final String userId); Function<UserProfile, String> getName(); } |
@Test public void home() throws Exception { mockMvc.perform(get("/")) .andExpect(status().is3xxRedirection()) .andExpect(redirectedUrl("/requests")); } | @RequestMapping("/") public ModelAndView home(@RequestParam(value = "ref", required = false) String ref, RedirectAttributes redirectAttributes, Principal principal) { final List<RequestView> requests = mappers.mapList(RequestDto.class, RequestView.class, requestService.findAll()) .stream() .filter(request -> request.ge... | HomeController extends AbstractController { @RequestMapping("/") public ModelAndView home(@RequestParam(value = "ref", required = false) String ref, RedirectAttributes redirectAttributes, Principal principal) { final List<RequestView> requests = mappers.mapList(RequestDto.class, RequestView.class, requestService.findAl... | HomeController extends AbstractController { @RequestMapping("/") public ModelAndView home(@RequestParam(value = "ref", required = false) String ref, RedirectAttributes redirectAttributes, Principal principal) { final List<RequestView> requests = mappers.mapList(RequestDto.class, RequestView.class, requestService.findAl... | HomeController extends AbstractController { @RequestMapping("/") public ModelAndView home(@RequestParam(value = "ref", required = false) String ref, RedirectAttributes redirectAttributes, Principal principal) { final List<RequestView> requests = mappers.mapList(RequestDto.class, RequestView.class, requestService.findAl... | HomeController extends AbstractController { @RequestMapping("/") public ModelAndView home(@RequestParam(value = "ref", required = false) String ref, RedirectAttributes redirectAttributes, Principal principal) { final List<RequestView> requests = mappers.mapList(RequestDto.class, RequestView.class, requestService.findAl... |
@Test public void login() throws Exception { mockMvc.perform(get("/user/login").header("referer", "localhost")) .andExpect(status().is3xxRedirection()) .andExpect(redirectedUrl("localhost")); } | @RequestMapping("/user/login") public ModelAndView login(RedirectAttributes redirectAttributes, HttpServletRequest request) { return redirectView(redirectAttributes) .url(request.getHeader("referer")) .build(); } | HomeController extends AbstractController { @RequestMapping("/user/login") public ModelAndView login(RedirectAttributes redirectAttributes, HttpServletRequest request) { return redirectView(redirectAttributes) .url(request.getHeader("referer")) .build(); } } | HomeController extends AbstractController { @RequestMapping("/user/login") public ModelAndView login(RedirectAttributes redirectAttributes, HttpServletRequest request) { return redirectView(redirectAttributes) .url(request.getHeader("referer")) .build(); } HomeController(ProfileService profileService,
... | HomeController extends AbstractController { @RequestMapping("/user/login") public ModelAndView login(RedirectAttributes redirectAttributes, HttpServletRequest request) { return redirectView(redirectAttributes) .url(request.getHeader("referer")) .build(); } HomeController(ProfileService profileService,
... | HomeController extends AbstractController { @RequestMapping("/user/login") public ModelAndView login(RedirectAttributes redirectAttributes, HttpServletRequest request) { return redirectView(redirectAttributes) .url(request.getHeader("referer")) .build(); } HomeController(ProfileService profileService,
... |
@Test public void logoutWithPrincipal() throws Exception { Principal principal = PrincipalMother.davyvanroy(); mockMvc.perform(get("/logout").principal(principal)) .andExpect(status().is3xxRedirection()) .andExpect(redirectedUrl("/")); verify(profileService).logout(principal); } | @GetMapping(path = "/logout") public String logout(Principal principal, HttpServletRequest request) throws ServletException { if (principal != null) { profileService.logout(principal); } request.logout(); return "redirect:/"; } | HomeController extends AbstractController { @GetMapping(path = "/logout") public String logout(Principal principal, HttpServletRequest request) throws ServletException { if (principal != null) { profileService.logout(principal); } request.logout(); return "redirect:/"; } } | HomeController extends AbstractController { @GetMapping(path = "/logout") public String logout(Principal principal, HttpServletRequest request) throws ServletException { if (principal != null) { profileService.logout(principal); } request.logout(); return "redirect:/"; } HomeController(ProfileService profileService,
... | HomeController extends AbstractController { @GetMapping(path = "/logout") public String logout(Principal principal, HttpServletRequest request) throws ServletException { if (principal != null) { profileService.logout(principal); } request.logout(); return "redirect:/"; } HomeController(ProfileService profileService,
... | HomeController extends AbstractController { @GetMapping(path = "/logout") public String logout(Principal principal, HttpServletRequest request) throws ServletException { if (principal != null) { profileService.logout(principal); } request.logout(); return "redirect:/"; } HomeController(ProfileService profileService,
... |
@Test public void map() { final RequestDto requestDto = RequestDtoMother.fundRequestArea51(); final IssueInformationDto issueInformation = requestDto.getIssueInformation(); final String status = "rdfjcgv"; final GithubResult githubResult = new GithubResult(); githubResult.setBodyHtml("<html/>"); when(delegate.map(reque... | @Override public RequestDetailsView map(RequestDto r) { RequestDetailsView view = delegate.map(r); if (view != null) { IssueInformationDto issueInfo = r.getIssueInformation(); view.setIcon("https: view.setPlatform(issueInfo.getPlatform().name()); view.setOwner(issueInfo.getOwner()); view.setRepo(issueInfo.getRepo()); v... | RequestDetailsViewMapperDecorator implements RequestDetailsViewMapper { @Override public RequestDetailsView map(RequestDto r) { RequestDetailsView view = delegate.map(r); if (view != null) { IssueInformationDto issueInfo = r.getIssueInformation(); view.setIcon("https: view.setPlatform(issueInfo.getPlatform().name()); v... | RequestDetailsViewMapperDecorator implements RequestDetailsViewMapper { @Override public RequestDetailsView map(RequestDto r) { RequestDetailsView view = delegate.map(r); if (view != null) { IssueInformationDto issueInfo = r.getIssueInformation(); view.setIcon("https: view.setPlatform(issueInfo.getPlatform().name()); v... | RequestDetailsViewMapperDecorator implements RequestDetailsViewMapper { @Override public RequestDetailsView map(RequestDto r) { RequestDetailsView view = delegate.map(r); if (view != null) { IssueInformationDto issueInfo = r.getIssueInformation(); view.setIcon("https: view.setPlatform(issueInfo.getPlatform().name()); v... | RequestDetailsViewMapperDecorator implements RequestDetailsViewMapper { @Override public RequestDetailsView map(RequestDto r) { RequestDetailsView view = delegate.map(r); if (view != null) { IssueInformationDto issueInfo = r.getIssueInformation(); view.setIcon("https: view.setPlatform(issueInfo.getPlatform().name()); v... |
@Test public void map_null() { final RequestDto requestDto = RequestDtoMother.fundRequestArea51(); when(delegate.map(requestDto)).thenReturn(null); final RequestDetailsView result = decorator.map(requestDto); assertThat(result).isNull(); } | @Override public RequestDetailsView map(RequestDto r) { RequestDetailsView view = delegate.map(r); if (view != null) { IssueInformationDto issueInfo = r.getIssueInformation(); view.setIcon("https: view.setPlatform(issueInfo.getPlatform().name()); view.setOwner(issueInfo.getOwner()); view.setRepo(issueInfo.getRepo()); v... | RequestDetailsViewMapperDecorator implements RequestDetailsViewMapper { @Override public RequestDetailsView map(RequestDto r) { RequestDetailsView view = delegate.map(r); if (view != null) { IssueInformationDto issueInfo = r.getIssueInformation(); view.setIcon("https: view.setPlatform(issueInfo.getPlatform().name()); v... | RequestDetailsViewMapperDecorator implements RequestDetailsViewMapper { @Override public RequestDetailsView map(RequestDto r) { RequestDetailsView view = delegate.map(r); if (view != null) { IssueInformationDto issueInfo = r.getIssueInformation(); view.setIcon("https: view.setPlatform(issueInfo.getPlatform().name()); v... | RequestDetailsViewMapperDecorator implements RequestDetailsViewMapper { @Override public RequestDetailsView map(RequestDto r) { RequestDetailsView view = delegate.map(r); if (view != null) { IssueInformationDto issueInfo = r.getIssueInformation(); view.setIcon("https: view.setPlatform(issueInfo.getPlatform().name()); v... | RequestDetailsViewMapperDecorator implements RequestDetailsViewMapper { @Override public RequestDetailsView map(RequestDto r) { RequestDetailsView view = delegate.map(r); if (view != null) { IssueInformationDto issueInfo = r.getIssueInformation(); view.setIcon("https: view.setPlatform(issueInfo.getPlatform().name()); v... |
@Test public void map() { final String status = "szfgdhxf"; final String phase = "sgzdxhfc"; final RequestDto request = RequestDtoMother.fundRequestArea51(); when(enumToCapitalizedStringMapper.map(request.getStatus())).thenReturn(status); when(enumToCapitalizedStringMapper.map(request.getStatus().getPhase())).thenRetur... | @Override public RequestView map(final RequestDto r) { if (r == null) { return null; } return RequestView.builder() .id(r.getId()) .icon("https: .owner(r.getIssueInformation().getOwner()) .repo(r.getIssueInformation().getRepo()) .issueNumber(r.getIssueInformation().getNumber()) .platform(r.getIssueInformation().getPlat... | RequestViewMapper implements BaseMapper<RequestDto, RequestView> { @Override public RequestView map(final RequestDto r) { if (r == null) { return null; } return RequestView.builder() .id(r.getId()) .icon("https: .owner(r.getIssueInformation().getOwner()) .repo(r.getIssueInformation().getRepo()) .issueNumber(r.getIssueI... | RequestViewMapper implements BaseMapper<RequestDto, RequestView> { @Override public RequestView map(final RequestDto r) { if (r == null) { return null; } return RequestView.builder() .id(r.getId()) .icon("https: .owner(r.getIssueInformation().getOwner()) .repo(r.getIssueInformation().getRepo()) .issueNumber(r.getIssueI... | RequestViewMapper implements BaseMapper<RequestDto, RequestView> { @Override public RequestView map(final RequestDto r) { if (r == null) { return null; } return RequestView.builder() .id(r.getId()) .icon("https: .owner(r.getIssueInformation().getOwner()) .repo(r.getIssueInformation().getRepo()) .issueNumber(r.getIssueI... | RequestViewMapper implements BaseMapper<RequestDto, RequestView> { @Override public RequestView map(final RequestDto r) { if (r == null) { return null; } return RequestView.builder() .id(r.getId()) .icon("https: .owner(r.getIssueInformation().getOwner()) .repo(r.getIssueInformation().getRepo()) .issueNumber(r.getIssueI... |
@Test public void map_null() { assertThat(mapper.map(null)).isNull(); } | @Override public RequestView map(final RequestDto r) { if (r == null) { return null; } return RequestView.builder() .id(r.getId()) .icon("https: .owner(r.getIssueInformation().getOwner()) .repo(r.getIssueInformation().getRepo()) .issueNumber(r.getIssueInformation().getNumber()) .platform(r.getIssueInformation().getPlat... | RequestViewMapper implements BaseMapper<RequestDto, RequestView> { @Override public RequestView map(final RequestDto r) { if (r == null) { return null; } return RequestView.builder() .id(r.getId()) .icon("https: .owner(r.getIssueInformation().getOwner()) .repo(r.getIssueInformation().getRepo()) .issueNumber(r.getIssueI... | RequestViewMapper implements BaseMapper<RequestDto, RequestView> { @Override public RequestView map(final RequestDto r) { if (r == null) { return null; } return RequestView.builder() .id(r.getId()) .icon("https: .owner(r.getIssueInformation().getOwner()) .repo(r.getIssueInformation().getRepo()) .issueNumber(r.getIssueI... | RequestViewMapper implements BaseMapper<RequestDto, RequestView> { @Override public RequestView map(final RequestDto r) { if (r == null) { return null; } return RequestView.builder() .id(r.getId()) .icon("https: .owner(r.getIssueInformation().getOwner()) .repo(r.getIssueInformation().getRepo()) .issueNumber(r.getIssueI... | RequestViewMapper implements BaseMapper<RequestDto, RequestView> { @Override public RequestView map(final RequestDto r) { if (r == null) { return null; } return RequestView.builder() .id(r.getId()) .icon("https: .owner(r.getIssueInformation().getOwner()) .repo(r.getIssueInformation().getRepo()) .issueNumber(r.getIssueI... |
@Test public void requests() throws Exception { final List<RequestDto> requestDtos = new ArrayList<>(); final List<RequestView> returnedRequestViews = Arrays.asList(buildRequestView("2", null), buildRequestView("0", null), buildRequestView(null, "3"), buildRequestView(null, "0"), buildRequestView("5", "4"), buildReques... | @GetMapping("/requests") public ModelAndView requests() { final List<RequestView> requests = mappers.mapList(RequestDto.class, RequestView.class, requestService.findAll()) .stream() .filter(request -> hasFunds(request.getFunds().getFndFunds()) || hasFunds(request.getFunds().getOtherFunds())) .collect(toList()); final M... | RequestController extends AbstractController { @GetMapping("/requests") public ModelAndView requests() { final List<RequestView> requests = mappers.mapList(RequestDto.class, RequestView.class, requestService.findAll()) .stream() .filter(request -> hasFunds(request.getFunds().getFndFunds()) || hasFunds(request.getFunds(... | RequestController extends AbstractController { @GetMapping("/requests") public ModelAndView requests() { final List<RequestView> requests = mappers.mapList(RequestDto.class, RequestView.class, requestService.findAll()) .stream() .filter(request -> hasFunds(request.getFunds().getFndFunds()) || hasFunds(request.getFunds(... | RequestController extends AbstractController { @GetMapping("/requests") public ModelAndView requests() { final List<RequestView> requests = mappers.mapList(RequestDto.class, RequestView.class, requestService.findAll()) .stream() .filter(request -> hasFunds(request.getFunds().getFndFunds()) || hasFunds(request.getFunds(... | RequestController extends AbstractController { @GetMapping("/requests") public ModelAndView requests() { final List<RequestView> requests = mappers.mapList(RequestDto.class, RequestView.class, requestService.findAll()) .stream() .filter(request -> hasFunds(request.getFunds().getFndFunds()) || hasFunds(request.getFunds(... |
@Test public void details() throws Exception { final long requestId = 7458L; final RequestDto requestDto = mock(RequestDto.class); final RequestDetailsView requestDetailsView = mock(RequestDetailsView.class); final FundsForRequestDto fundsForRequestDto = mock(FundsForRequestDto.class); final List<RefundRequestDto> pend... | @RequestMapping("/requests/{type}") public ModelAndView details(@PathVariable String type, @RequestParam Map<String, String> queryParameters) { return modelAndView() .withObject("url", queryParameters.get("url")) .withView("pages/fund/" + type) .build(); } | RequestController extends AbstractController { @RequestMapping("/requests/{type}") public ModelAndView details(@PathVariable String type, @RequestParam Map<String, String> queryParameters) { return modelAndView() .withObject("url", queryParameters.get("url")) .withView("pages/fund/" + type) .build(); } } | RequestController extends AbstractController { @RequestMapping("/requests/{type}") public ModelAndView details(@PathVariable String type, @RequestParam Map<String, String> queryParameters) { return modelAndView() .withObject("url", queryParameters.get("url")) .withView("pages/fund/" + type) .build(); } RequestControlle... | RequestController extends AbstractController { @RequestMapping("/requests/{type}") public ModelAndView details(@PathVariable String type, @RequestParam Map<String, String> queryParameters) { return modelAndView() .withObject("url", queryParameters.get("url")) .withView("pages/fund/" + type) .build(); } RequestControlle... | RequestController extends AbstractController { @RequestMapping("/requests/{type}") public ModelAndView details(@PathVariable String type, @RequestParam Map<String, String> queryParameters) { return modelAndView() .withObject("url", queryParameters.get("url")) .withView("pages/fund/" + type) .build(); } RequestControlle... |
@Test public void delete() throws Exception { String type = MessageType.REFERRAL_SHARE.toString(); String name = "name"; this.mockMvc.perform(post("/messages/{type}/{name}/delete", type, name)) .andExpect(redirectAlert("success", "Deleted")) .andExpect(redirectedUrl("/messages/" + type)); } | @PostMapping("/messages/{type}/{name}/delete") public ModelAndView delete(final Model model, @PathVariable String type, @PathVariable String name, RedirectAttributes redirectAttributes) { messageService.delete(MessageType.valueOf(type.toUpperCase()), name); return redirectView(redirectAttributes) .withSuccessMessage("D... | MessagesController extends AbstractController { @PostMapping("/messages/{type}/{name}/delete") public ModelAndView delete(final Model model, @PathVariable String type, @PathVariable String name, RedirectAttributes redirectAttributes) { messageService.delete(MessageType.valueOf(type.toUpperCase()), name); return redirec... | MessagesController extends AbstractController { @PostMapping("/messages/{type}/{name}/delete") public ModelAndView delete(final Model model, @PathVariable String type, @PathVariable String name, RedirectAttributes redirectAttributes) { messageService.delete(MessageType.valueOf(type.toUpperCase()), name); return redirec... | MessagesController extends AbstractController { @PostMapping("/messages/{type}/{name}/delete") public ModelAndView delete(final Model model, @PathVariable String type, @PathVariable String name, RedirectAttributes redirectAttributes) { messageService.delete(MessageType.valueOf(type.toUpperCase()), name); return redirec... | MessagesController extends AbstractController { @PostMapping("/messages/{type}/{name}/delete") public ModelAndView delete(final Model model, @PathVariable String type, @PathVariable String name, RedirectAttributes redirectAttributes) { messageService.delete(MessageType.valueOf(type.toUpperCase()), name); return redirec... |
@Test void me() { mockServer.expect(requestTo("https: .andExpect(method(GET)) .andRespond(withSuccess(new ClassPathResource("/user/me.json", getClass()), APPLICATION_JSON)); final Me me = userResource.me(); assertThat(me.getId()).isEqualTo("553d437215522ed4b3df8c50"); assertThat(me.getUsername()).isEqualTo("MadLittleMo... | @Override public Me me() { return restTemplate.getForObject("https: } | UserResourceTemplate implements UserResource { @Override public Me me() { return restTemplate.getForObject("https: } } | UserResourceTemplate implements UserResource { @Override public Me me() { return restTemplate.getForObject("https: } UserResourceTemplate(final RestTemplate restTemplate); } | UserResourceTemplate implements UserResource { @Override public Me me() { return restTemplate.getForObject("https: } UserResourceTemplate(final RestTemplate restTemplate); @Override Me me(); } | UserResourceTemplate implements UserResource { @Override public Me me() { return restTemplate.getForObject("https: } UserResourceTemplate(final RestTemplate restTemplate); @Override Me me(); } |
@Test public void detailActions() throws Exception { final RequestDto request = RequestDtoMother.freeCodeCampNoUserStories(); final IssueInformationDto issueInformation = request.getIssueInformation(); final UserClaimableDto userClaimableDto = mock(UserClaimableDto.class); final PlatformIssueDto platformIssue = mock(Pl... | @GetMapping("/requests/{id}/actions") public ModelAndView detailActions(final Principal principal, @PathVariable final Long id) { final RequestDto request = requestService.findRequest(id); if (request != null) { final IssueInformationDto issueInformation = request.getIssueInformation(); return modelAndView().withObject... | RequestController extends AbstractController { @GetMapping("/requests/{id}/actions") public ModelAndView detailActions(final Principal principal, @PathVariable final Long id) { final RequestDto request = requestService.findRequest(id); if (request != null) { final IssueInformationDto issueInformation = request.getIssue... | RequestController extends AbstractController { @GetMapping("/requests/{id}/actions") public ModelAndView detailActions(final Principal principal, @PathVariable final Long id) { final RequestDto request = requestService.findRequest(id); if (request != null) { final IssueInformationDto issueInformation = request.getIssue... | RequestController extends AbstractController { @GetMapping("/requests/{id}/actions") public ModelAndView detailActions(final Principal principal, @PathVariable final Long id) { final RequestDto request = requestService.findRequest(id); if (request != null) { final IssueInformationDto issueInformation = request.getIssue... | RequestController extends AbstractController { @GetMapping("/requests/{id}/actions") public ModelAndView detailActions(final Principal principal, @PathVariable final Long id) { final RequestDto request = requestService.findRequest(id); if (request != null) { final IssueInformationDto issueInformation = request.getIssue... |
@Test public void claimRequest() throws Exception { RequestDto request = RequestDtoMother.freeCodeCampNoUserStories(); when(requestService.findRequest(1L)).thenReturn(request); UserClaimableDto userClaimableDto = UserClaimableDto.builder().build(); when(requestService.getUserClaimableResult(principal, 1L)).thenReturn(u... | @PostMapping("/requests/{id}/claim") public ModelAndView claimRequest(Principal principal, @PathVariable Long id, @Valid UserClaimRequest userClaimRequest, RedirectAttributes redirectAttributes) { if (!profileService.getUserProfile(principal).userOwnsAddress(userClaimRequest.getAddress())) { return redirectView(redirec... | RequestController extends AbstractController { @PostMapping("/requests/{id}/claim") public ModelAndView claimRequest(Principal principal, @PathVariable Long id, @Valid UserClaimRequest userClaimRequest, RedirectAttributes redirectAttributes) { if (!profileService.getUserProfile(principal).userOwnsAddress(userClaimReque... | RequestController extends AbstractController { @PostMapping("/requests/{id}/claim") public ModelAndView claimRequest(Principal principal, @PathVariable Long id, @Valid UserClaimRequest userClaimRequest, RedirectAttributes redirectAttributes) { if (!profileService.getUserProfile(principal).userOwnsAddress(userClaimReque... | RequestController extends AbstractController { @PostMapping("/requests/{id}/claim") public ModelAndView claimRequest(Principal principal, @PathVariable Long id, @Valid UserClaimRequest userClaimRequest, RedirectAttributes redirectAttributes) { if (!profileService.getUserProfile(principal).userOwnsAddress(userClaimReque... | RequestController extends AbstractController { @PostMapping("/requests/{id}/claim") public ModelAndView claimRequest(Principal principal, @PathVariable Long id, @Valid UserClaimRequest userClaimRequest, RedirectAttributes redirectAttributes) { if (!profileService.getUserProfile(principal).userOwnsAddress(userClaimReque... |
@Test public void toggleWatchRequest() throws Exception { RequestDto request = RequestDtoMother.freeCodeCampNoUserStories(); RequestView requestView = new RequestView(); when(requestService.findRequest(1L)).thenReturn(request); when(mappers.map(RequestDto.class, RequestView.class, request)).thenReturn(requestView); whe... | @PostMapping(value = {"/requests/{id}/watch"}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @ResponseBody public String toggleWatchRequest(Principal principal, @PathVariable Long id) { RequestDto request = requestService.findRequest(id); if (request.isLoggedInUserIsWatcher()) { request.setLoggedInUserIsWatcher(fal... | RequestController extends AbstractController { @PostMapping(value = {"/requests/{id}/watch"}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @ResponseBody public String toggleWatchRequest(Principal principal, @PathVariable Long id) { RequestDto request = requestService.findRequest(id); if (request.isLoggedInUserIsWa... | RequestController extends AbstractController { @PostMapping(value = {"/requests/{id}/watch"}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @ResponseBody public String toggleWatchRequest(Principal principal, @PathVariable Long id) { RequestDto request = requestService.findRequest(id); if (request.isLoggedInUserIsWa... | RequestController extends AbstractController { @PostMapping(value = {"/requests/{id}/watch"}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @ResponseBody public String toggleWatchRequest(Principal principal, @PathVariable Long id) { RequestDto request = requestService.findRequest(id); if (request.isLoggedInUserIsWa... | RequestController extends AbstractController { @PostMapping(value = {"/requests/{id}/watch"}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @ResponseBody public String toggleWatchRequest(Principal principal, @PathVariable Long id) { RequestDto request = requestService.findRequest(id); if (request.isLoggedInUserIsWa... |
@Test public void userRequests() throws Exception { final List<RequestDto> requests = new ArrayList<>(); final List<RequestView> requestViews = new ArrayList<>(); final List<PendingFundDto> pendingFunds = new ArrayList<>(); final Set<String> projects = new HashSet<>(); boolean isAuthenticated = false; when(requestServi... | @GetMapping("/user/requests") public ModelAndView userRequests(Principal principal) { final List<RequestView> requests = mappers.mapList(RequestDto.class, RequestView.class, requestService.findRequestsForUser(principal)); final List<PendingFundDto> pendingFunds = pendingFundService.findByUser(principal); return modelAn... | RequestController extends AbstractController { @GetMapping("/user/requests") public ModelAndView userRequests(Principal principal) { final List<RequestView> requests = mappers.mapList(RequestDto.class, RequestView.class, requestService.findRequestsForUser(principal)); final List<PendingFundDto> pendingFunds = pendingFu... | RequestController extends AbstractController { @GetMapping("/user/requests") public ModelAndView userRequests(Principal principal) { final List<RequestView> requests = mappers.mapList(RequestDto.class, RequestView.class, requestService.findRequestsForUser(principal)); final List<PendingFundDto> pendingFunds = pendingFu... | RequestController extends AbstractController { @GetMapping("/user/requests") public ModelAndView userRequests(Principal principal) { final List<RequestView> requests = mappers.mapList(RequestDto.class, RequestView.class, requestService.findRequestsForUser(principal)); final List<PendingFundDto> pendingFunds = pendingFu... | RequestController extends AbstractController { @GetMapping("/user/requests") public ModelAndView userRequests(Principal principal) { final List<RequestView> requests = mappers.mapList(RequestDto.class, RequestView.class, requestService.findRequestsForUser(principal)); final List<PendingFundDto> pendingFunds = pendingFu... |
@Test void requestDetails() throws Exception { final String owner = "fundrequest"; final String repo = "platform"; final String issueNumber = "320"; final RequestDto requestDto = RequestDtoMother.fundRequestArea51(); final RequestView requestView = mapper.map(requestDto); final String platformId = owner + "|FR|" + repo... | @GetMapping(value = "/github/{owner}/{repo}/{number}") public RequestView requestDetails(@PathVariable("owner") final String repoOwner, @PathVariable("repo") final String repo, @PathVariable("number") final String issueNumber) { final RequestDto request = requestService.findRequest(Platform.GITHUB, String.format("%s|FR... | RequestRestController { @GetMapping(value = "/github/{owner}/{repo}/{number}") public RequestView requestDetails(@PathVariable("owner") final String repoOwner, @PathVariable("repo") final String repo, @PathVariable("number") final String issueNumber) { final RequestDto request = requestService.findRequest(Platform.GITH... | RequestRestController { @GetMapping(value = "/github/{owner}/{repo}/{number}") public RequestView requestDetails(@PathVariable("owner") final String repoOwner, @PathVariable("repo") final String repo, @PathVariable("number") final String issueNumber) { final RequestDto request = requestService.findRequest(Platform.GITH... | RequestRestController { @GetMapping(value = "/github/{owner}/{repo}/{number}") public RequestView requestDetails(@PathVariable("owner") final String repoOwner, @PathVariable("repo") final String repo, @PathVariable("number") final String issueNumber) { final RequestDto request = requestService.findRequest(Platform.GITH... | RequestRestController { @GetMapping(value = "/github/{owner}/{repo}/{number}") public RequestView requestDetails(@PathVariable("owner") final String repoOwner, @PathVariable("repo") final String repo, @PathVariable("number") final String issueNumber) { final RequestDto request = requestService.findRequest(Platform.GITH... |
@Test void claimDetails() throws Exception { final String owner = "fundrequest"; final String repo = "platform"; final String issueNumber = "320"; final String claimableBy = "hgfgh"; final RequestDto requestDto = RequestDtoMother.fundRequestArea51(); final ClaimView claimView = new ClaimView(true, claimableBy); final S... | @GetMapping(value = "/github/{owner}/{repo}/{number}/claimable") public ClaimView claimDetails(@PathVariable("owner") final String repoOwner, @PathVariable("repo") final String repo, @PathVariable("number") final String issueNumber) { final RequestDto request = requestService.findRequest(Platform.GITHUB, String.format(... | RequestRestController { @GetMapping(value = "/github/{owner}/{repo}/{number}/claimable") public ClaimView claimDetails(@PathVariable("owner") final String repoOwner, @PathVariable("repo") final String repo, @PathVariable("number") final String issueNumber) { final RequestDto request = requestService.findRequest(Platfor... | RequestRestController { @GetMapping(value = "/github/{owner}/{repo}/{number}/claimable") public ClaimView claimDetails(@PathVariable("owner") final String repoOwner, @PathVariable("repo") final String repo, @PathVariable("number") final String issueNumber) { final RequestDto request = requestService.findRequest(Platfor... | RequestRestController { @GetMapping(value = "/github/{owner}/{repo}/{number}/claimable") public ClaimView claimDetails(@PathVariable("owner") final String repoOwner, @PathVariable("repo") final String repo, @PathVariable("number") final String issueNumber) { final RequestDto request = requestService.findRequest(Platfor... | RequestRestController { @GetMapping(value = "/github/{owner}/{repo}/{number}/claimable") public ClaimView claimDetails(@PathVariable("owner") final String repoOwner, @PathVariable("repo") final String repo, @PathVariable("number") final String issueNumber) { final RequestDto request = requestService.findRequest(Platfor... |
@Test void isRefundable() { final String userEtherAddress = "0xeab4"; final UserFundsDto fund = buildUserFundsDto(userEtherAddress, "5", "", "", ""); final long requestId = 35L; final String requestStatus = "Funded"; final UserProfile userProfile = UserProfile.builder().etherAddresses(Collections.singletonList(userEthe... | public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestId) && hasPositiveB... | RefundValidator { public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestI... | RefundValidator { public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestI... | RefundValidator { public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestI... | RefundValidator { public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestI... |
@Test void isRefundable_noProfile() { final String userEtherAddress = "0xeab4"; final UserFundsDto fund = buildUserFundsDto(userEtherAddress, "20", "", "", ""); final long requestId = 35L; final String requestStatus = "Funded"; final TokenValueDto totalFndOnContract = TokenValueDtoMother.FND().totalAmount(TEN).build();... | public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestId) && hasPositiveB... | RefundValidator { public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestI... | RefundValidator { public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestI... | RefundValidator { public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestI... | RefundValidator { public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestI... |
@Test void isRefundable_requestStatusNotFunded() { final String userEtherAddress = "0xeab4"; final UserFundsDto fund = buildUserFundsDto(userEtherAddress, "20", "", "", ""); final long requestId = 35L; final String requestStatus = "Claimable"; final UserProfile userProfile = UserProfile.builder().etherAddresses(Collect... | public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestId) && hasPositiveB... | RefundValidator { public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestI... | RefundValidator { public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestI... | RefundValidator { public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestI... | RefundValidator { public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestI... |
@Test void isRefundable_fundAddressNeUserAddress() { final String userEtherAddress = "0xeab4"; final UserFundsDto fund = buildUserFundsDto("0x4657efa", "20", "", "", ""); final long requestId = 35L; final String requestStatus = "Funded"; final UserProfile userProfile = UserProfile.builder().etherAddresses(Collections.s... | public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestId) && hasPositiveB... | RefundValidator { public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestI... | RefundValidator { public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestI... | RefundValidator { public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestI... | RefundValidator { public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestI... |
@Test void cleanClaims() { final RequestClaim requestClaim1 = RequestClaim.builder().status(ClaimRequestStatus.APPROVED).transactionHash("0x213").build(); final RequestClaim requestClaim2 = RequestClaim.builder().status(ClaimRequestStatus.APPROVED).transactionHash("0x3243").build(); final RequestClaim requestClaim3 = R... | @Scheduled(fixedDelay = 300_000L) public void cleanClaims() { final List<RequestClaim> claims = requestClaimRepository.findByStatus(ClaimRequestStatus.APPROVED); claims.stream() .filter(x -> x.getTransactionHash() != null) .filter(x -> azraelClient.getTransactionStatus(x.getTransactionHash()).equals(TransactionStatus.F... | RequestVacuumer { @Scheduled(fixedDelay = 300_000L) public void cleanClaims() { final List<RequestClaim> claims = requestClaimRepository.findByStatus(ClaimRequestStatus.APPROVED); claims.stream() .filter(x -> x.getTransactionHash() != null) .filter(x -> azraelClient.getTransactionStatus(x.getTransactionHash()).equals(T... | RequestVacuumer { @Scheduled(fixedDelay = 300_000L) public void cleanClaims() { final List<RequestClaim> claims = requestClaimRepository.findByStatus(ClaimRequestStatus.APPROVED); claims.stream() .filter(x -> x.getTransactionHash() != null) .filter(x -> azraelClient.getTransactionStatus(x.getTransactionHash()).equals(T... | RequestVacuumer { @Scheduled(fixedDelay = 300_000L) public void cleanClaims() { final List<RequestClaim> claims = requestClaimRepository.findByStatus(ClaimRequestStatus.APPROVED); claims.stream() .filter(x -> x.getTransactionHash() != null) .filter(x -> azraelClient.getTransactionStatus(x.getTransactionHash()).equals(T... | RequestVacuumer { @Scheduled(fixedDelay = 300_000L) public void cleanClaims() { final List<RequestClaim> claims = requestClaimRepository.findByStatus(ClaimRequestStatus.APPROVED); claims.stream() .filter(x -> x.getTransactionHash() != null) .filter(x -> azraelClient.getTransactionStatus(x.getTransactionHash()).equals(T... |
@Test void isRefundable_refundRequestAlreadyExists() { final String userEtherAddress = "0xeab4"; final UserFundsDto fund = buildUserFundsDto(userEtherAddress, "20", "", "", ""); final long requestId = 35L; final String requestStatus = "Funded"; final UserProfile userProfile = UserProfile.builder().etherAddresses(Collec... | public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestId) && hasPositiveB... | RefundValidator { public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestI... | RefundValidator { public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestI... | RefundValidator { public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestI... | RefundValidator { public boolean isRefundable(final UserProfile userProfile, final UserFundsDto fund, final long requestId, final String requestStatus) { return userProfile != null && userProfile.userOwnsAddress(fund.getFunderAddress()) && "FUNDED".equalsIgnoreCase(requestStatus) && !refundRequestAlreadyExists(requestI... |
@Test public void requestRefund() throws Exception { final long requestId = 38L; final RequestDto request = RequestDtoMother.fundRequestArea51(); request.setStatus(RequestStatus.FUNDED); final String funderAddress = "0x24356789"; when(profileService.getUserProfile(principal)).thenReturn(UserProfile.builder().etherAddre... | @PostMapping(value = "/requests/{requestId}/refunds") public ModelAndView requestRefund(final Principal principal, @PathVariable("requestId") final Long requestId, @RequestParam("funder_address") final String funderAddress, final RedirectAttributes redirectAttributes) { final RedirectBuilder redirectBuilder = redirectV... | FundController extends AbstractController { @PostMapping(value = "/requests/{requestId}/refunds") public ModelAndView requestRefund(final Principal principal, @PathVariable("requestId") final Long requestId, @RequestParam("funder_address") final String funderAddress, final RedirectAttributes redirectAttributes) { final... | FundController extends AbstractController { @PostMapping(value = "/requests/{requestId}/refunds") public ModelAndView requestRefund(final Principal principal, @PathVariable("requestId") final Long requestId, @RequestParam("funder_address") final String funderAddress, final RedirectAttributes redirectAttributes) { final... | FundController extends AbstractController { @PostMapping(value = "/requests/{requestId}/refunds") public ModelAndView requestRefund(final Principal principal, @PathVariable("requestId") final Long requestId, @RequestParam("funder_address") final String funderAddress, final RedirectAttributes redirectAttributes) { final... | FundController extends AbstractController { @PostMapping(value = "/requests/{requestId}/refunds") public ModelAndView requestRefund(final Principal principal, @PathVariable("requestId") final Long requestId, @RequestParam("funder_address") final String funderAddress, final RedirectAttributes redirectAttributes) { final... |
@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.re... | @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) .solve... | 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) .numbe... | 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) .numbe... | 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) .numbe... | 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) .numbe... |
@Test public void parseOpen() { final Document document = mock(Document.class, RETURNS_DEEP_STUBS); final String expectedStatus = "Open"; when(document.select("#partial-discussion-header .State").first().text()).thenReturn(expectedStatus); final String returnedStatus = parser.resolve(document); assertThat(returnedStatu... | public String resolve(final Document document) { return document.select("#partial-discussion-header .State").first().text(); } | GithubStatusResolver { public String resolve(final Document document) { return document.select("#partial-discussion-header .State").first().text(); } } | GithubStatusResolver { public String resolve(final Document document) { return document.select("#partial-discussion-header .State").first().text(); } } | GithubStatusResolver { public String resolve(final Document document) { return document.select("#partial-discussion-header .State").first().text(); } String resolve(final Document document); } | GithubStatusResolver { public String resolve(final Document document) { return document.select("#partial-discussion-header .State").first().text(); } String resolve(final Document document); } |
@Test public void parseClosed() { final Document document = mock(Document.class, RETURNS_DEEP_STUBS); final String expectedStatus = "Closed"; when(document.select("#partial-discussion-header .State").first().text()).thenReturn(expectedStatus); final String returnedStatus = parser.resolve(document); assertThat(returnedS... | public String resolve(final Document document) { return document.select("#partial-discussion-header .State").first().text(); } | GithubStatusResolver { public String resolve(final Document document) { return document.select("#partial-discussion-header .State").first().text(); } } | GithubStatusResolver { public String resolve(final Document document) { return document.select("#partial-discussion-header .State").first().text(); } } | GithubStatusResolver { public String resolve(final Document document) { return document.select("#partial-discussion-header .State").first().text(); } String resolve(final Document document); } | GithubStatusResolver { public String resolve(final Document document) { return document.select("#partial-discussion-header .State").first().text(); } String resolve(final Document document); } |
@Test public void fromString_issue() { final String owner = "FundRequest"; final String repo = "area51"; final String number = "38"; final Optional<GithubId> result = GithubId.fromString(String.format("/%s/%s/issues/%s", owner, repo, number)); assertThat(result).isPresent() .contains(GithubId.builder().owner(owner).rep... | public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.group("owner"... | GithubId { public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... | GithubId { public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... | GithubId { public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... | GithubId { public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... |
@Test public void fromString_issueFullURL() { final String owner = "trufflesuite"; final String repo = "truffle"; final String number = "501"; final Optional<GithubId> result = GithubId.fromString(String.format("https: assertThat(result).isPresent() .contains(GithubId.builder().owner(owner).repo(repo).number(number).bu... | public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.group("owner"... | GithubId { public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... | GithubId { public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... | GithubId { public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... | GithubId { public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... |
@Test public void fromString_pullrequest() { final String owner = "smartcontractkit"; final String repo = "chainlink"; final String number = "276"; final Optional<GithubId> result = GithubId.fromString(String.format("/%s/%s/pull/%s", owner, repo, number)); assertThat(result).isPresent() .contains(GithubId.builder().own... | public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.group("owner"... | GithubId { public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... | GithubId { public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... | GithubId { public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... | GithubId { public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... |
@Test public void fromString_pullrequestFullURL() { final String owner = "aragon"; final String repo = "aragonOS"; final String number = "204"; final Optional<GithubId> result = GithubId.fromString(String.format("https: assertThat(result).isPresent() .contains(GithubId.builder().owner(owner).repo(repo).number(number).b... | public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.group("owner"... | GithubId { public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... | GithubId { public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... | GithubId { public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... | GithubId { public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... |
@Test public void fromString_noMatchEmtpy() { final Optional<GithubId> result = GithubId.fromString("/hfgdjfgk"); assertThat(result).isEmpty(); } | public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.group("owner"... | GithubId { public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... | GithubId { public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... | GithubId { public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... | GithubId { public static Optional<GithubId> fromString(final String githubIdAsString) { final Pattern pattern = Pattern.compile("^.*/(?<owner>.+)/(?<repo>.+)/.+/(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(githubIdAsString); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... |
@Test void cleanRefunds() { final RefundRequest refundRequest1 = RefundRequest.builder().status(RefundRequestStatus.APPROVED).transactionHash("0x213").build(); final RefundRequest refundRequest2 = RefundRequest.builder().status(RefundRequestStatus.APPROVED).transactionHash("0x3243").build(); final RefundRequest refundR... | @Scheduled(fixedDelay = 300_000L) public void cleanRefunds() { final List<RefundRequest> refundRequests = refundRequestRepository.findAllByStatus(RefundRequestStatus.APPROVED); refundRequests.stream() .filter(refundRequest -> refundRequest.getTransactionHash() != null) .filter(refundRequest -> azraelClient.getTransacti... | RequestVacuumer { @Scheduled(fixedDelay = 300_000L) public void cleanRefunds() { final List<RefundRequest> refundRequests = refundRequestRepository.findAllByStatus(RefundRequestStatus.APPROVED); refundRequests.stream() .filter(refundRequest -> refundRequest.getTransactionHash() != null) .filter(refundRequest -> azraelC... | RequestVacuumer { @Scheduled(fixedDelay = 300_000L) public void cleanRefunds() { final List<RefundRequest> refundRequests = refundRequestRepository.findAllByStatus(RefundRequestStatus.APPROVED); refundRequests.stream() .filter(refundRequest -> refundRequest.getTransactionHash() != null) .filter(refundRequest -> azraelC... | RequestVacuumer { @Scheduled(fixedDelay = 300_000L) public void cleanRefunds() { final List<RefundRequest> refundRequests = refundRequestRepository.findAllByStatus(RefundRequestStatus.APPROVED); refundRequests.stream() .filter(refundRequest -> refundRequest.getTransactionHash() != null) .filter(refundRequest -> azraelC... | RequestVacuumer { @Scheduled(fixedDelay = 300_000L) public void cleanRefunds() { final List<RefundRequest> refundRequests = refundRequestRepository.findAllByStatus(RefundRequestStatus.APPROVED); refundRequests.stream() .filter(refundRequest -> refundRequest.getTransactionHash() != null) .filter(refundRequest -> azraelC... |
@Test public void fromPlatformId() { final String owner = "fgagsfgfas"; final String repo = "bdfdb"; final String number = "213"; final Optional<GithubId> result = GithubId.fromPlatformId(String.format("%s|FR|%s|FR|%s", owner, repo, number)); assertThat(result).isPresent() .contains(GithubId.builder().owner(owner).repo... | public static Optional<GithubId> fromPlatformId(final String platformId) { final Pattern pattern = Pattern.compile("^(?<owner>.+)\\|FR\\|(?<repo>.+)\\|FR\\|(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(platformId); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.group("owner"... | GithubId { public static Optional<GithubId> fromPlatformId(final String platformId) { final Pattern pattern = Pattern.compile("^(?<owner>.+)\\|FR\\|(?<repo>.+)\\|FR\\|(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(platformId); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... | GithubId { public static Optional<GithubId> fromPlatformId(final String platformId) { final Pattern pattern = Pattern.compile("^(?<owner>.+)\\|FR\\|(?<repo>.+)\\|FR\\|(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(platformId); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... | GithubId { public static Optional<GithubId> fromPlatformId(final String platformId) { final Pattern pattern = Pattern.compile("^(?<owner>.+)\\|FR\\|(?<repo>.+)\\|FR\\|(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(platformId); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... | GithubId { public static Optional<GithubId> fromPlatformId(final String platformId) { final Pattern pattern = Pattern.compile("^(?<owner>.+)\\|FR\\|(?<repo>.+)\\|FR\\|(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(platformId); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... |
@Test public void fromPlatformId_noMatchEmpty() { final Optional<GithubId> result = GithubId.fromPlatformId("fgagsfgfas|FR|bdfdb|FR"); assertThat(result).isEmpty(); } | public static Optional<GithubId> fromPlatformId(final String platformId) { final Pattern pattern = Pattern.compile("^(?<owner>.+)\\|FR\\|(?<repo>.+)\\|FR\\|(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(platformId); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.group("owner"... | GithubId { public static Optional<GithubId> fromPlatformId(final String platformId) { final Pattern pattern = Pattern.compile("^(?<owner>.+)\\|FR\\|(?<repo>.+)\\|FR\\|(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(platformId); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... | GithubId { public static Optional<GithubId> fromPlatformId(final String platformId) { final Pattern pattern = Pattern.compile("^(?<owner>.+)\\|FR\\|(?<repo>.+)\\|FR\\|(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(platformId); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... | GithubId { public static Optional<GithubId> fromPlatformId(final String platformId) { final Pattern pattern = Pattern.compile("^(?<owner>.+)\\|FR\\|(?<repo>.+)\\|FR\\|(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(platformId); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... | GithubId { public static Optional<GithubId> fromPlatformId(final String platformId) { final Pattern pattern = Pattern.compile("^(?<owner>.+)\\|FR\\|(?<repo>.+)\\|FR\\|(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(platformId); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.gr... |
@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 && pullRequestFix... | 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 !=... | 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 !=... | 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 !=... | 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 !=... |
@Test void getDescription() { assertThat(resource.getDescription()).isEqualTo(owner + "/" + repo + "/" + branch + "/" + location); } | @Override public String getDescription() { return String.format("%s/%s/%s/%s", owner, repo, branch, location); } | GithubTemplateResource implements ITemplateResource { @Override public String getDescription() { return String.format("%s/%s/%s/%s", owner, repo, branch, location); } } | GithubTemplateResource implements ITemplateResource { @Override public String getDescription() { return String.format("%s/%s/%s/%s", owner, repo, branch, location); } GithubTemplateResource(final String owner, final String repo, final String branch, final String location, final GithubRawClient githubRawClient); } | GithubTemplateResource implements ITemplateResource { @Override public String getDescription() { return String.format("%s/%s/%s/%s", owner, repo, branch, location); } GithubTemplateResource(final String owner, final String repo, final String branch, final String location, final GithubRawClient githubRawClient); @Overri... | GithubTemplateResource implements ITemplateResource { @Override public String getDescription() { return String.format("%s/%s/%s/%s", owner, repo, branch, location); } GithubTemplateResource(final String owner, final String repo, final String branch, final String location, final GithubRawClient githubRawClient); @Overri... |
@Test void getBaseName() { assertThat(resource.getBaseName()).isEqualTo(location); } | @Override public String getBaseName() { return location; } | GithubTemplateResource implements ITemplateResource { @Override public String getBaseName() { return location; } } | GithubTemplateResource implements ITemplateResource { @Override public String getBaseName() { return location; } GithubTemplateResource(final String owner, final String repo, final String branch, final String location, final GithubRawClient githubRawClient); } | GithubTemplateResource implements ITemplateResource { @Override public String getBaseName() { return location; } GithubTemplateResource(final String owner, final String repo, final String branch, final String location, final GithubRawClient githubRawClient); @Override String getDescription(); @Override String getBaseNa... | GithubTemplateResource implements ITemplateResource { @Override public String getBaseName() { return location; } GithubTemplateResource(final String owner, final String repo, final String branch, final String location, final GithubRawClient githubRawClient); @Override String getDescription(); @Override String getBaseNa... |
@Test void exists() { when(githubRawClient.getContentsAsRaw(owner, repo, branch, location)).thenReturn("fasgzd"); final boolean result = resource.exists(); assertThat(result).isTrue(); } | @Override public boolean exists() { return StringUtils.isNotBlank(fetchTemplateContents()); } | GithubTemplateResource implements ITemplateResource { @Override public boolean exists() { return StringUtils.isNotBlank(fetchTemplateContents()); } } | GithubTemplateResource implements ITemplateResource { @Override public boolean exists() { return StringUtils.isNotBlank(fetchTemplateContents()); } GithubTemplateResource(final String owner, final String repo, final String branch, final String location, final GithubRawClient githubRawClient); } | GithubTemplateResource implements ITemplateResource { @Override public boolean exists() { return StringUtils.isNotBlank(fetchTemplateContents()); } GithubTemplateResource(final String owner, final String repo, final String branch, final String location, final GithubRawClient githubRawClient); @Override String getDescri... | GithubTemplateResource implements ITemplateResource { @Override public boolean exists() { return StringUtils.isNotBlank(fetchTemplateContents()); } GithubTemplateResource(final String owner, final String repo, final String branch, final String location, final GithubRawClient githubRawClient); @Override String getDescri... |
@Test void exists_contentsEmpty() { when(githubRawClient.getContentsAsRaw(owner, repo, branch, location)).thenReturn(""); final boolean result = resource.exists(); assertThat(result).isFalse(); } | @Override public boolean exists() { return StringUtils.isNotBlank(fetchTemplateContents()); } | GithubTemplateResource implements ITemplateResource { @Override public boolean exists() { return StringUtils.isNotBlank(fetchTemplateContents()); } } | GithubTemplateResource implements ITemplateResource { @Override public boolean exists() { return StringUtils.isNotBlank(fetchTemplateContents()); } GithubTemplateResource(final String owner, final String repo, final String branch, final String location, final GithubRawClient githubRawClient); } | GithubTemplateResource implements ITemplateResource { @Override public boolean exists() { return StringUtils.isNotBlank(fetchTemplateContents()); } GithubTemplateResource(final String owner, final String repo, final String branch, final String location, final GithubRawClient githubRawClient); @Override String getDescri... | GithubTemplateResource implements ITemplateResource { @Override public boolean exists() { return StringUtils.isNotBlank(fetchTemplateContents()); } GithubTemplateResource(final String owner, final String repo, final String branch, final String location, final GithubRawClient githubRawClient); @Override String getDescri... |
@Test void exists_githubclientException() { doThrow(new RuntimeException()).when(githubRawClient).getContentsAsRaw(owner, repo, branch, location); final boolean result = resource.exists(); assertThat(result).isFalse(); } | @Override public boolean exists() { return StringUtils.isNotBlank(fetchTemplateContents()); } | GithubTemplateResource implements ITemplateResource { @Override public boolean exists() { return StringUtils.isNotBlank(fetchTemplateContents()); } } | GithubTemplateResource implements ITemplateResource { @Override public boolean exists() { return StringUtils.isNotBlank(fetchTemplateContents()); } GithubTemplateResource(final String owner, final String repo, final String branch, final String location, final GithubRawClient githubRawClient); } | GithubTemplateResource implements ITemplateResource { @Override public boolean exists() { return StringUtils.isNotBlank(fetchTemplateContents()); } GithubTemplateResource(final String owner, final String repo, final String branch, final String location, final GithubRawClient githubRawClient); @Override String getDescri... | GithubTemplateResource implements ITemplateResource { @Override public boolean exists() { return StringUtils.isNotBlank(fetchTemplateContents()); } GithubTemplateResource(final String owner, final String repo, final String branch, final String location, final GithubRawClient githubRawClient); @Override String getDescri... |
@Test void reader() throws IOException { final String expected = "fasgzd"; when(githubRawClient.getContentsAsRaw(owner, repo, branch, location)).thenReturn(expected); final Reader result = resource.reader(); assertThat(IOUtils.toString(result)).isEqualTo(expected); } | @Override public Reader reader() { final String templateContents = fetchTemplateContents(); return StringUtils.isNotBlank(templateContents) ? new StringReader(templateContents) : null; } | GithubTemplateResource implements ITemplateResource { @Override public Reader reader() { final String templateContents = fetchTemplateContents(); return StringUtils.isNotBlank(templateContents) ? new StringReader(templateContents) : null; } } | GithubTemplateResource implements ITemplateResource { @Override public Reader reader() { final String templateContents = fetchTemplateContents(); return StringUtils.isNotBlank(templateContents) ? new StringReader(templateContents) : null; } GithubTemplateResource(final String owner, final String repo, final String bran... | GithubTemplateResource implements ITemplateResource { @Override public Reader reader() { final String templateContents = fetchTemplateContents(); return StringUtils.isNotBlank(templateContents) ? new StringReader(templateContents) : null; } GithubTemplateResource(final String owner, final String repo, final String bran... | GithubTemplateResource implements ITemplateResource { @Override public Reader reader() { final String templateContents = fetchTemplateContents(); return StringUtils.isNotBlank(templateContents) ? new StringReader(templateContents) : null; } GithubTemplateResource(final String owner, final String repo, final String bran... |
@Test void relative() { final String relativeLocation = "cxncvx"; final GithubTemplateResource result = resource.relative(relativeLocation); assertThat(result.getOwner()).isEqualTo(owner); assertThat(result.getRepo()).isEqualTo(repo); assertThat(result.getBranch()).isEqualTo(branch); assertThat(result.getLocation()).is... | @Override public GithubTemplateResource relative(String relativeLocation) { return new GithubTemplateResource(owner, repo, branch, relativeLocation, githubRawClient); } | GithubTemplateResource implements ITemplateResource { @Override public GithubTemplateResource relative(String relativeLocation) { return new GithubTemplateResource(owner, repo, branch, relativeLocation, githubRawClient); } } | GithubTemplateResource implements ITemplateResource { @Override public GithubTemplateResource relative(String relativeLocation) { return new GithubTemplateResource(owner, repo, branch, relativeLocation, githubRawClient); } GithubTemplateResource(final String owner, final String repo, final String branch, final String l... | GithubTemplateResource implements ITemplateResource { @Override public GithubTemplateResource relative(String relativeLocation) { return new GithubTemplateResource(owner, repo, branch, relativeLocation, githubRawClient); } GithubTemplateResource(final String owner, final String repo, final String branch, final String l... | GithubTemplateResource implements ITemplateResource { @Override public GithubTemplateResource relative(String relativeLocation) { return new GithubTemplateResource(owner, repo, branch, relativeLocation, githubRawClient); } GithubTemplateResource(final String owner, final String repo, final String branch, final String l... |
@Test void showGenerateTemplateForm() throws Exception { final HashSet<String> projects = new HashSet<>(); final HashSet<String> technologies = new HashSet<>(); when(requestService.findAllProjects()).thenReturn(projects); when(requestService.findAllTechnologies()).thenReturn(technologies); this.mockMvc.perform(get("/no... | @GetMapping("/notifications/open-requests") public ModelAndView showGenerateTemplateForm(final Model model) { return modelAndView(model).withView("notifications/open-requests") .withObject("projects", requestService.findAllProjects()) .withObject("technologies", requestService.findAllTechnologies()) .withObject("target... | OpenRequestsNotificationsController extends AbstractController { @GetMapping("/notifications/open-requests") public ModelAndView showGenerateTemplateForm(final Model model) { return modelAndView(model).withView("notifications/open-requests") .withObject("projects", requestService.findAllProjects()) .withObject("technol... | OpenRequestsNotificationsController extends AbstractController { @GetMapping("/notifications/open-requests") public ModelAndView showGenerateTemplateForm(final Model model) { return modelAndView(model).withView("notifications/open-requests") .withObject("projects", requestService.findAllProjects()) .withObject("technol... | OpenRequestsNotificationsController extends AbstractController { @GetMapping("/notifications/open-requests") public ModelAndView showGenerateTemplateForm(final Model model) { return modelAndView(model).withView("notifications/open-requests") .withObject("projects", requestService.findAllProjects()) .withObject("technol... | OpenRequestsNotificationsController extends AbstractController { @GetMapping("/notifications/open-requests") public ModelAndView showGenerateTemplateForm(final Model model) { return modelAndView(model).withView("notifications/open-requests") .withObject("projects", requestService.findAllProjects()) .withObject("technol... |
@Test public void testHealth_up() { final int limit = 5000; final int remaining = 1001; final long reset = 1372700873; final ZonedDateTime verwachteReset = ZonedDateTime.ofInstant(Instant.ofEpochSecond(reset), ZoneId.systemDefault()); when(githubGateway.getRateLimit()).thenReturn(GithubRateLimits.with() .core(GithubRat... | @Override public Health health() { final GithubRateLimit rateLimit = githubGateway.getRateLimit().getCore(); if (rateLimit.getRemaining() == 0) { return addDetails(Health.down(), rateLimit).build(); } if (rateLimit.getRemaining() > calculateThreshold(rateLimit.getLimit())) { return addDetails(Health.up(), rateLimit).bu... | GithubRateHealthCheck implements HealthIndicator { @Override public Health health() { final GithubRateLimit rateLimit = githubGateway.getRateLimit().getCore(); if (rateLimit.getRemaining() == 0) { return addDetails(Health.down(), rateLimit).build(); } if (rateLimit.getRemaining() > calculateThreshold(rateLimit.getLimit... | GithubRateHealthCheck implements HealthIndicator { @Override public Health health() { final GithubRateLimit rateLimit = githubGateway.getRateLimit().getCore(); if (rateLimit.getRemaining() == 0) { return addDetails(Health.down(), rateLimit).build(); } if (rateLimit.getRemaining() > calculateThreshold(rateLimit.getLimit... | GithubRateHealthCheck implements HealthIndicator { @Override public Health health() { final GithubRateLimit rateLimit = githubGateway.getRateLimit().getCore(); if (rateLimit.getRemaining() == 0) { return addDetails(Health.down(), rateLimit).build(); } if (rateLimit.getRemaining() > calculateThreshold(rateLimit.getLimit... | GithubRateHealthCheck implements HealthIndicator { @Override public Health health() { final GithubRateLimit rateLimit = githubGateway.getRateLimit().getCore(); if (rateLimit.getRemaining() == 0) { return addDetails(Health.down(), rateLimit).build(); } if (rateLimit.getRemaining() > calculateThreshold(rateLimit.getLimit... |
@Test public void testHealth_thresholdReached() { final int limit = 5000; final int remaining = 1000; final long reset = 1372700873; final ZonedDateTime verwachteReset = ZonedDateTime.ofInstant(Instant.ofEpochSecond(reset), ZoneId.systemDefault()); when(githubGateway.getRateLimit()).thenReturn(GithubRateLimits.with() .... | @Override public Health health() { final GithubRateLimit rateLimit = githubGateway.getRateLimit().getCore(); if (rateLimit.getRemaining() == 0) { return addDetails(Health.down(), rateLimit).build(); } if (rateLimit.getRemaining() > calculateThreshold(rateLimit.getLimit())) { return addDetails(Health.up(), rateLimit).bu... | GithubRateHealthCheck implements HealthIndicator { @Override public Health health() { final GithubRateLimit rateLimit = githubGateway.getRateLimit().getCore(); if (rateLimit.getRemaining() == 0) { return addDetails(Health.down(), rateLimit).build(); } if (rateLimit.getRemaining() > calculateThreshold(rateLimit.getLimit... | GithubRateHealthCheck implements HealthIndicator { @Override public Health health() { final GithubRateLimit rateLimit = githubGateway.getRateLimit().getCore(); if (rateLimit.getRemaining() == 0) { return addDetails(Health.down(), rateLimit).build(); } if (rateLimit.getRemaining() > calculateThreshold(rateLimit.getLimit... | GithubRateHealthCheck implements HealthIndicator { @Override public Health health() { final GithubRateLimit rateLimit = githubGateway.getRateLimit().getCore(); if (rateLimit.getRemaining() == 0) { return addDetails(Health.down(), rateLimit).build(); } if (rateLimit.getRemaining() > calculateThreshold(rateLimit.getLimit... | GithubRateHealthCheck implements HealthIndicator { @Override public Health health() { final GithubRateLimit rateLimit = githubGateway.getRateLimit().getCore(); if (rateLimit.getRemaining() == 0) { return addDetails(Health.down(), rateLimit).build(); } if (rateLimit.getRemaining() > calculateThreshold(rateLimit.getLimit... |
@Test public void testHealth_down() { final int limit = 5000; final int remaining = 0; final long reset = 1372700873; final ZonedDateTime verwachteReset = ZonedDateTime.ofInstant(Instant.ofEpochSecond(reset), ZoneId.systemDefault()); when(githubGateway.getRateLimit()).thenReturn(GithubRateLimits.with() .core(GithubRate... | @Override public Health health() { final GithubRateLimit rateLimit = githubGateway.getRateLimit().getCore(); if (rateLimit.getRemaining() == 0) { return addDetails(Health.down(), rateLimit).build(); } if (rateLimit.getRemaining() > calculateThreshold(rateLimit.getLimit())) { return addDetails(Health.up(), rateLimit).bu... | GithubRateHealthCheck implements HealthIndicator { @Override public Health health() { final GithubRateLimit rateLimit = githubGateway.getRateLimit().getCore(); if (rateLimit.getRemaining() == 0) { return addDetails(Health.down(), rateLimit).build(); } if (rateLimit.getRemaining() > calculateThreshold(rateLimit.getLimit... | GithubRateHealthCheck implements HealthIndicator { @Override public Health health() { final GithubRateLimit rateLimit = githubGateway.getRateLimit().getCore(); if (rateLimit.getRemaining() == 0) { return addDetails(Health.down(), rateLimit).build(); } if (rateLimit.getRemaining() > calculateThreshold(rateLimit.getLimit... | GithubRateHealthCheck implements HealthIndicator { @Override public Health health() { final GithubRateLimit rateLimit = githubGateway.getRateLimit().getCore(); if (rateLimit.getRemaining() == 0) { return addDetails(Health.down(), rateLimit).build(); } if (rateLimit.getRemaining() > calculateThreshold(rateLimit.getLimit... | GithubRateHealthCheck implements HealthIndicator { @Override public Health health() { final GithubRateLimit rateLimit = githubGateway.getRateLimit().getCore(); if (rateLimit.getRemaining() == 0) { return addDetails(Health.down(), rateLimit).build(); } if (rateLimit.getRemaining() > calculateThreshold(rateLimit.getLimit... |
@Test public void createFundedComment() { final long requestId = 156; final String githubIssueNumber = "8765"; final String result = githubCommentFactory.createFundedComment(requestId, githubIssueNumber); assertThat(result).isEqualTo(EXPECTED_FUNDED_COMMENT); } | public String createFundedComment(final Long requestId, final String githubIssueNumber) { return String.format(FUNDED_COMMENT_TEMPLATE, platformBasePath, requestId, githubIssueNumber); } | GithubCommentFactory { public String createFundedComment(final Long requestId, final String githubIssueNumber) { return String.format(FUNDED_COMMENT_TEMPLATE, platformBasePath, requestId, githubIssueNumber); } } | GithubCommentFactory { public String createFundedComment(final Long requestId, final String githubIssueNumber) { return String.format(FUNDED_COMMENT_TEMPLATE, platformBasePath, requestId, githubIssueNumber); } GithubCommentFactory(@Value("${io.fundrequest.platform.base-path}") final String platformBasePath,
... | GithubCommentFactory { public String createFundedComment(final Long requestId, final String githubIssueNumber) { return String.format(FUNDED_COMMENT_TEMPLATE, platformBasePath, requestId, githubIssueNumber); } GithubCommentFactory(@Value("${io.fundrequest.platform.base-path}") final String platformBasePath,
... | GithubCommentFactory { public String createFundedComment(final Long requestId, final String githubIssueNumber) { return String.format(FUNDED_COMMENT_TEMPLATE, platformBasePath, requestId, githubIssueNumber); } GithubCommentFactory(@Value("${io.fundrequest.platform.base-path}") final String platformBasePath,
... |
@Test public void createResolvedComment() { final long requestId = 635; final String solver = "dfghd-ghjgfg"; final String result = githubCommentFactory.createResolvedComment(requestId, solver); assertThat(result).isEqualTo(EXPECTED_RESOLVED_COMMENT); } | public String createResolvedComment(final Long requestId, final String solver) { return String.format(RESOLVED_COMMENT_TEMPLATE, platformBasePath, requestId, solver); } | GithubCommentFactory { public String createResolvedComment(final Long requestId, final String solver) { return String.format(RESOLVED_COMMENT_TEMPLATE, platformBasePath, requestId, solver); } } | GithubCommentFactory { public String createResolvedComment(final Long requestId, final String solver) { return String.format(RESOLVED_COMMENT_TEMPLATE, platformBasePath, requestId, solver); } GithubCommentFactory(@Value("${io.fundrequest.platform.base-path}") final String platformBasePath,
... | GithubCommentFactory { public String createResolvedComment(final Long requestId, final String solver) { return String.format(RESOLVED_COMMENT_TEMPLATE, platformBasePath, requestId, solver); } GithubCommentFactory(@Value("${io.fundrequest.platform.base-path}") final String platformBasePath,
... | GithubCommentFactory { public String createResolvedComment(final Long requestId, final String solver) { return String.format(RESOLVED_COMMENT_TEMPLATE, platformBasePath, requestId, solver); } GithubCommentFactory(@Value("${io.fundrequest.platform.base-path}") final String platformBasePath,
... |
@Test public void createClosedComment() { final long requestId = 5473; final String solver = "ljn-ytd"; final String transactionHash = "ZWQ1R12QBPMI7AS6PCCQ"; final String result = githubCommentFactory.createClosedComment(requestId, solver, transactionHash); assertThat(result).isEqualTo(EXPECTED_CLOSED_COMMENT); } | public String createClosedComment(final Long requestId, final String solver, final String transactionHash) { return String.format(CLOSED_COMMENT_TEMPLATE, platformBasePath, requestId, solver, etherscanBasePath, transactionHash); } | GithubCommentFactory { public String createClosedComment(final Long requestId, final String solver, final String transactionHash) { return String.format(CLOSED_COMMENT_TEMPLATE, platformBasePath, requestId, solver, etherscanBasePath, transactionHash); } } | GithubCommentFactory { public String createClosedComment(final Long requestId, final String solver, final String transactionHash) { return String.format(CLOSED_COMMENT_TEMPLATE, platformBasePath, requestId, solver, etherscanBasePath, transactionHash); } GithubCommentFactory(@Value("${io.fundrequest.platform.base-path}"... | GithubCommentFactory { public String createClosedComment(final Long requestId, final String solver, final String transactionHash) { return String.format(CLOSED_COMMENT_TEMPLATE, platformBasePath, requestId, solver, etherscanBasePath, transactionHash); } GithubCommentFactory(@Value("${io.fundrequest.platform.base-path}"... | GithubCommentFactory { public String createClosedComment(final Long requestId, final String solver, final String transactionHash) { return String.format(CLOSED_COMMENT_TEMPLATE, platformBasePath, requestId, solver, etherscanBasePath, transactionHash); } GithubCommentFactory(@Value("${io.fundrequest.platform.base-path}"... |
@Test void findBy() { final String owner = "sfs"; final String repo = "fafsa"; final String number = "43"; final GithubIssue githubIssue = GithubIssue.builder().build(); when(githubScraper.fetchGithubIssue(owner, repo, number)).thenReturn(githubIssue); final Optional<GithubIssue> result = githubIssueService.findBy(owne... | public Optional<GithubIssue> findBy(final String platformId) { return GithubId.fromPlatformId(platformId) .map(githubId -> githubScraper.fetchGithubIssue(githubId.getOwner(), githubId.getRepo(), githubId.getNumber())); } | GithubIssueService { public Optional<GithubIssue> findBy(final String platformId) { return GithubId.fromPlatformId(platformId) .map(githubId -> githubScraper.fetchGithubIssue(githubId.getOwner(), githubId.getRepo(), githubId.getNumber())); } } | GithubIssueService { public Optional<GithubIssue> findBy(final String platformId) { return GithubId.fromPlatformId(platformId) .map(githubId -> githubScraper.fetchGithubIssue(githubId.getOwner(), githubId.getRepo(), githubId.getNumber())); } GithubIssueService(final GithubScraper githubScraper); } | GithubIssueService { public Optional<GithubIssue> findBy(final String platformId) { return GithubId.fromPlatformId(platformId) .map(githubId -> githubScraper.fetchGithubIssue(githubId.getOwner(), githubId.getRepo(), githubId.getNumber())); } GithubIssueService(final GithubScraper githubScraper); Optional<GithubIssue> f... | GithubIssueService { public Optional<GithubIssue> findBy(final String platformId) { return GithubId.fromPlatformId(platformId) .map(githubId -> githubScraper.fetchGithubIssue(githubId.getOwner(), githubId.getRepo(), githubId.getNumber())); } GithubIssueService(final GithubScraper githubScraper); Optional<GithubIssue> f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.