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 findBy_invalidPlatformId() { final String owner = "sfs"; final String repo = "fafsa"; final Optional<GithubIssue> result = githubIssueService.findBy(owner + "|FR|" + repo + "|FR|"); assertThat(result).isEmpty(); }
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...
@Test void findBy_noIssueFound() { final String owner = "sfs"; final String repo = "fafsa"; final String number = "43"; when(githubScraper.fetchGithubIssue(owner, repo, number)).thenReturn(null); final Optional<GithubIssue> result = githubIssueService.findBy(owner + "|FR|" + repo + "|FR|" + number); assertThat(result)....
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...
@Test public void map() { final String title = "ghfgjhk"; final String filePath = "iouyi"; final String contentHtml = "dsafg"; final String expectedBody = "<h1>Cdfghjhkj</h1>"; final Document contentDocument = mock(Document.class); final Elements markdownElements = mock(Elements.class); final Element markdownElement = ...
@Override public FaqItemDto map(final Faq faq) { if (faq == null) { return null; } try { final Document document = jsoup.parse(githubGateway.getContentsAsHtml(owner, repo, branch, faq.getFilePath())); final Elements markDownBody = document.select(".markdown-body"); if (!markDownBody.isEmpty()) { final String body = mar...
FaqItemDtoMapper implements BaseMapper<Faq, FaqItemDto> { @Override public FaqItemDto map(final Faq faq) { if (faq == null) { return null; } try { final Document document = jsoup.parse(githubGateway.getContentsAsHtml(owner, repo, branch, faq.getFilePath())); final Elements markDownBody = document.select(".markdown-body...
FaqItemDtoMapper implements BaseMapper<Faq, FaqItemDto> { @Override public FaqItemDto map(final Faq faq) { if (faq == null) { return null; } try { final Document document = jsoup.parse(githubGateway.getContentsAsHtml(owner, repo, branch, faq.getFilePath())); final Elements markDownBody = document.select(".markdown-body...
FaqItemDtoMapper implements BaseMapper<Faq, FaqItemDto> { @Override public FaqItemDto map(final Faq faq) { if (faq == null) { return null; } try { final Document document = jsoup.parse(githubGateway.getContentsAsHtml(owner, repo, branch, faq.getFilePath())); final Elements markDownBody = document.select(".markdown-body...
FaqItemDtoMapper implements BaseMapper<Faq, FaqItemDto> { @Override public FaqItemDto map(final Faq faq) { if (faq == null) { return null; } try { final Document document = jsoup.parse(githubGateway.getContentsAsHtml(owner, repo, branch, faq.getFilePath())); final Elements markDownBody = document.select(".markdown-body...
@Test public void map_emptyMD() { final String title = "ghfgjhk"; final String filePath = "iouyi"; final String contentHtml = "dsafg"; final String expectedBody = "<h1>Cdfghjhkj</h1>"; final Document contentDocument = mock(Document.class); final Elements markdownElements = mock(Elements.class); final Element markdownEl...
@Override public FaqItemDto map(final Faq faq) { if (faq == null) { return null; } try { final Document document = jsoup.parse(githubGateway.getContentsAsHtml(owner, repo, branch, faq.getFilePath())); final Elements markDownBody = document.select(".markdown-body"); if (!markDownBody.isEmpty()) { final String body = mar...
FaqItemDtoMapper implements BaseMapper<Faq, FaqItemDto> { @Override public FaqItemDto map(final Faq faq) { if (faq == null) { return null; } try { final Document document = jsoup.parse(githubGateway.getContentsAsHtml(owner, repo, branch, faq.getFilePath())); final Elements markDownBody = document.select(".markdown-body...
FaqItemDtoMapper implements BaseMapper<Faq, FaqItemDto> { @Override public FaqItemDto map(final Faq faq) { if (faq == null) { return null; } try { final Document document = jsoup.parse(githubGateway.getContentsAsHtml(owner, repo, branch, faq.getFilePath())); final Elements markDownBody = document.select(".markdown-body...
FaqItemDtoMapper implements BaseMapper<Faq, FaqItemDto> { @Override public FaqItemDto map(final Faq faq) { if (faq == null) { return null; } try { final Document document = jsoup.parse(githubGateway.getContentsAsHtml(owner, repo, branch, faq.getFilePath())); final Elements markDownBody = document.select(".markdown-body...
FaqItemDtoMapper implements BaseMapper<Faq, FaqItemDto> { @Override public FaqItemDto map(final Faq faq) { if (faq == null) { return null; } try { final Document document = jsoup.parse(githubGateway.getContentsAsHtml(owner, repo, branch, faq.getFilePath())); final Elements markDownBody = document.select(".markdown-body...
@Test public void map_exception() { final String title = "ghfgjhk"; final String filePath = "iouyi"; final String contentHtml = "dsafg"; final String expectedBody = "<h1>Cdfghjhkj</h1>"; final Document contentDocument = mock(Document.class); final Elements markdownElements = mock(Elements.class); final Element markdown...
@Override public FaqItemDto map(final Faq faq) { if (faq == null) { return null; } try { final Document document = jsoup.parse(githubGateway.getContentsAsHtml(owner, repo, branch, faq.getFilePath())); final Elements markDownBody = document.select(".markdown-body"); if (!markDownBody.isEmpty()) { final String body = mar...
FaqItemDtoMapper implements BaseMapper<Faq, FaqItemDto> { @Override public FaqItemDto map(final Faq faq) { if (faq == null) { return null; } try { final Document document = jsoup.parse(githubGateway.getContentsAsHtml(owner, repo, branch, faq.getFilePath())); final Elements markDownBody = document.select(".markdown-body...
FaqItemDtoMapper implements BaseMapper<Faq, FaqItemDto> { @Override public FaqItemDto map(final Faq faq) { if (faq == null) { return null; } try { final Document document = jsoup.parse(githubGateway.getContentsAsHtml(owner, repo, branch, faq.getFilePath())); final Elements markDownBody = document.select(".markdown-body...
FaqItemDtoMapper implements BaseMapper<Faq, FaqItemDto> { @Override public FaqItemDto map(final Faq faq) { if (faq == null) { return null; } try { final Document document = jsoup.parse(githubGateway.getContentsAsHtml(owner, repo, branch, faq.getFilePath())); final Elements markDownBody = document.select(".markdown-body...
FaqItemDtoMapper implements BaseMapper<Faq, FaqItemDto> { @Override public FaqItemDto map(final Faq faq) { if (faq == null) { return null; } try { final Document document = jsoup.parse(githubGateway.getContentsAsHtml(owner, repo, branch, faq.getFilePath())); final Elements markDownBody = document.select(".markdown-body...
@Test public void mapNull() { assertThat(mapper.map(null)).isNull(); }
@Override public FaqItemDto map(final Faq faq) { if (faq == null) { return null; } try { final Document document = jsoup.parse(githubGateway.getContentsAsHtml(owner, repo, branch, faq.getFilePath())); final Elements markDownBody = document.select(".markdown-body"); if (!markDownBody.isEmpty()) { final String body = mar...
FaqItemDtoMapper implements BaseMapper<Faq, FaqItemDto> { @Override public FaqItemDto map(final Faq faq) { if (faq == null) { return null; } try { final Document document = jsoup.parse(githubGateway.getContentsAsHtml(owner, repo, branch, faq.getFilePath())); final Elements markDownBody = document.select(".markdown-body...
FaqItemDtoMapper implements BaseMapper<Faq, FaqItemDto> { @Override public FaqItemDto map(final Faq faq) { if (faq == null) { return null; } try { final Document document = jsoup.parse(githubGateway.getContentsAsHtml(owner, repo, branch, faq.getFilePath())); final Elements markDownBody = document.select(".markdown-body...
FaqItemDtoMapper implements BaseMapper<Faq, FaqItemDto> { @Override public FaqItemDto map(final Faq faq) { if (faq == null) { return null; } try { final Document document = jsoup.parse(githubGateway.getContentsAsHtml(owner, repo, branch, faq.getFilePath())); final Elements markDownBody = document.select(".markdown-body...
FaqItemDtoMapper implements BaseMapper<Faq, FaqItemDto> { @Override public FaqItemDto map(final Faq faq) { if (faq == null) { return null; } try { final Document document = jsoup.parse(githubGateway.getContentsAsHtml(owner, repo, branch, faq.getFilePath())); final Elements markDownBody = document.select(".markdown-body...
@Test void getFAQsForPage() { assertThat(new EmptyFAQServiceImpl().getFAQsForPage("").getFaqItems()).isEmpty(); }
public FaqItemsDto getFAQsForPage(final String pageName) { return new FaqItemsDto(DUMMY_FAQS_SUBTITLE, DUMMY_FAQ_ITEMS); }
EmptyFAQServiceImpl implements FAQService { public FaqItemsDto getFAQsForPage(final String pageName) { return new FaqItemsDto(DUMMY_FAQS_SUBTITLE, DUMMY_FAQ_ITEMS); } }
EmptyFAQServiceImpl implements FAQService { public FaqItemsDto getFAQsForPage(final String pageName) { return new FaqItemsDto(DUMMY_FAQS_SUBTITLE, DUMMY_FAQ_ITEMS); } EmptyFAQServiceImpl(); }
EmptyFAQServiceImpl implements FAQService { public FaqItemsDto getFAQsForPage(final String pageName) { return new FaqItemsDto(DUMMY_FAQS_SUBTITLE, DUMMY_FAQ_ITEMS); } EmptyFAQServiceImpl(); FaqItemsDto getFAQsForPage(final String pageName); }
EmptyFAQServiceImpl implements FAQService { public FaqItemsDto getFAQsForPage(final String pageName) { return new FaqItemsDto(DUMMY_FAQS_SUBTITLE, DUMMY_FAQ_ITEMS); } EmptyFAQServiceImpl(); FaqItemsDto getFAQsForPage(final String pageName); }
@Test public void refreshFAQs() throws IOException { final String faqsXml = "fadgszdbg"; final List<FaqItemDto> faqItems1 = Arrays.asList(mock(FaqItemDto.class)); final List<FaqItemDto> faqItems2 = Arrays.asList(mock(FaqItemDto.class), mock(FaqItemDto.class)); final List<FaqItemDto> faqItems3 = Arrays.asList(mock(FaqIt...
@Scheduled(fixedRate = DAY_IN_MILLIS) public void refreshFAQs() { fetchFAQs().getPages() .forEach(page -> cacheManager.getCache("faqs") .put(page.getName(), processFAQs(page.getFaqs(), page.getSubtitle()))); LOGGER.info("FAQ's are fetched from GitHub and stored in cache"); }
GithubFAQServiceImpl implements FAQService { @Scheduled(fixedRate = DAY_IN_MILLIS) public void refreshFAQs() { fetchFAQs().getPages() .forEach(page -> cacheManager.getCache("faqs") .put(page.getName(), processFAQs(page.getFaqs(), page.getSubtitle()))); LOGGER.info("FAQ's are fetched from GitHub and stored in cache"); }...
GithubFAQServiceImpl implements FAQService { @Scheduled(fixedRate = DAY_IN_MILLIS) public void refreshFAQs() { fetchFAQs().getPages() .forEach(page -> cacheManager.getCache("faqs") .put(page.getName(), processFAQs(page.getFaqs(), page.getSubtitle()))); LOGGER.info("FAQ's are fetched from GitHub and stored in cache"); }...
GithubFAQServiceImpl implements FAQService { @Scheduled(fixedRate = DAY_IN_MILLIS) public void refreshFAQs() { fetchFAQs().getPages() .forEach(page -> cacheManager.getCache("faqs") .put(page.getName(), processFAQs(page.getFaqs(), page.getSubtitle()))); LOGGER.info("FAQ's are fetched from GitHub and stored in cache"); }...
GithubFAQServiceImpl implements FAQService { @Scheduled(fixedRate = DAY_IN_MILLIS) public void refreshFAQs() { fetchFAQs().getPages() .forEach(page -> cacheManager.getCache("faqs") .put(page.getName(), processFAQs(page.getFaqs(), page.getSubtitle()))); LOGGER.info("FAQ's are fetched from GitHub and stored in cache"); }...
@Test public void refreshFAQs_pageNullFaqs() throws IOException { final String faqsXml = "fadgszdbg"; final Page page1 = Page.builder().name("fgh").subtitle("jcgk").faqs(null).build(); final Page page2 = Page.builder().name("gdx").subtitle("mvnb").faqs(new ArrayList<>()).build(); final Page page3 = Page.builder().name(...
@Scheduled(fixedRate = DAY_IN_MILLIS) public void refreshFAQs() { fetchFAQs().getPages() .forEach(page -> cacheManager.getCache("faqs") .put(page.getName(), processFAQs(page.getFaqs(), page.getSubtitle()))); LOGGER.info("FAQ's are fetched from GitHub and stored in cache"); }
GithubFAQServiceImpl implements FAQService { @Scheduled(fixedRate = DAY_IN_MILLIS) public void refreshFAQs() { fetchFAQs().getPages() .forEach(page -> cacheManager.getCache("faqs") .put(page.getName(), processFAQs(page.getFaqs(), page.getSubtitle()))); LOGGER.info("FAQ's are fetched from GitHub and stored in cache"); }...
GithubFAQServiceImpl implements FAQService { @Scheduled(fixedRate = DAY_IN_MILLIS) public void refreshFAQs() { fetchFAQs().getPages() .forEach(page -> cacheManager.getCache("faqs") .put(page.getName(), processFAQs(page.getFaqs(), page.getSubtitle()))); LOGGER.info("FAQ's are fetched from GitHub and stored in cache"); }...
GithubFAQServiceImpl implements FAQService { @Scheduled(fixedRate = DAY_IN_MILLIS) public void refreshFAQs() { fetchFAQs().getPages() .forEach(page -> cacheManager.getCache("faqs") .put(page.getName(), processFAQs(page.getFaqs(), page.getSubtitle()))); LOGGER.info("FAQ's are fetched from GitHub and stored in cache"); }...
GithubFAQServiceImpl implements FAQService { @Scheduled(fixedRate = DAY_IN_MILLIS) public void refreshFAQs() { fetchFAQs().getPages() .forEach(page -> cacheManager.getCache("faqs") .put(page.getName(), processFAQs(page.getFaqs(), page.getSubtitle()))); LOGGER.info("FAQ's are fetched from GitHub and stored in cache"); }...
@Test public void getUserIdentities() { String userId = "123"; FederatedIdentityRepresentation fi = new FederatedIdentityRepresentation(); fi.setUserId(userId); fi.setUserName("davyvanroy"); fi.setIdentityProvider("GITHUB"); when(realmResource.users().get(userId).getFederatedIdentity() .stream()).thenReturn(Stream.of(f...
public Stream<UserIdentity> getUserIdentities(String userId) { return resource.users().get(userId).getFederatedIdentity() .stream() .map(fi -> UserIdentity.builder().provider(Provider.fromString(fi.getIdentityProvider())).username(fi.getUserName()).userId(fi.getUserId()).build()); }
KeycloakRepositoryImpl implements KeycloakRepository { public Stream<UserIdentity> getUserIdentities(String userId) { return resource.users().get(userId).getFederatedIdentity() .stream() .map(fi -> UserIdentity.builder().provider(Provider.fromString(fi.getIdentityProvider())).username(fi.getUserName()).userId(fi.getUse...
KeycloakRepositoryImpl implements KeycloakRepository { public Stream<UserIdentity> getUserIdentities(String userId) { return resource.users().get(userId).getFederatedIdentity() .stream() .map(fi -> UserIdentity.builder().provider(Provider.fromString(fi.getIdentityProvider())).username(fi.getUserName()).userId(fi.getUse...
KeycloakRepositoryImpl implements KeycloakRepository { public Stream<UserIdentity> getUserIdentities(String userId) { return resource.users().get(userId).getFederatedIdentity() .stream() .map(fi -> UserIdentity.builder().provider(Provider.fromString(fi.getIdentityProvider())).username(fi.getUserName()).userId(fi.getUse...
KeycloakRepositoryImpl implements KeycloakRepository { public Stream<UserIdentity> getUserIdentities(String userId) { return resource.users().get(userId).getFederatedIdentity() .stream() .map(fi -> UserIdentity.builder().provider(Provider.fromString(fi.getIdentityProvider())).username(fi.getUserName()).userId(fi.getUse...
@Test public void getFAQsForPage() throws IOException { final String faqsXml = "fadgszdbg"; final String pageName = "fghggfsshdg"; final String subtitle = "afdsgdasoif"; final List<Faq> faqs = new ArrayList<>(); final List<FaqItemDto> faqItems = Arrays.asList(mock(FaqItemDto.class), null, mock(FaqItemDto.class)); when(...
@Cacheable(cacheNames = "faqs", key = "#pageName") public FaqItemsDto getFAQsForPage(final String pageName) { return fetchFAQs().getPages() .stream() .filter(page -> page.getName().equalsIgnoreCase(pageName)) .findFirst().map(page -> processFAQs(page.getFaqs(), page.getSubtitle())) .orElse(new FaqItemsDto(StringUtils.E...
GithubFAQServiceImpl implements FAQService { @Cacheable(cacheNames = "faqs", key = "#pageName") public FaqItemsDto getFAQsForPage(final String pageName) { return fetchFAQs().getPages() .stream() .filter(page -> page.getName().equalsIgnoreCase(pageName)) .findFirst().map(page -> processFAQs(page.getFaqs(), page.getSubti...
GithubFAQServiceImpl implements FAQService { @Cacheable(cacheNames = "faqs", key = "#pageName") public FaqItemsDto getFAQsForPage(final String pageName) { return fetchFAQs().getPages() .stream() .filter(page -> page.getName().equalsIgnoreCase(pageName)) .findFirst().map(page -> processFAQs(page.getFaqs(), page.getSubti...
GithubFAQServiceImpl implements FAQService { @Cacheable(cacheNames = "faqs", key = "#pageName") public FaqItemsDto getFAQsForPage(final String pageName) { return fetchFAQs().getPages() .stream() .filter(page -> page.getName().equalsIgnoreCase(pageName)) .findFirst().map(page -> processFAQs(page.getFaqs(), page.getSubti...
GithubFAQServiceImpl implements FAQService { @Cacheable(cacheNames = "faqs", key = "#pageName") public FaqItemsDto getFAQsForPage(final String pageName) { return fetchFAQs().getPages() .stream() .filter(page -> page.getName().equalsIgnoreCase(pageName)) .findFirst().map(page -> processFAQs(page.getFaqs(), page.getSubti...
@Test public void getFAQsForPage_FAQsNull() throws IOException { final String faqsXml = "fadgszdbg"; final String pageName = "fghggfsshdg"; when(githubGateway.getContentsAsRaw(OWNER, REPO, MASTER, FILE_PATH)).thenReturn(faqsXml); when(xmlMapper.readValue(faqsXml, Faqs.class)).thenReturn(buildFaqsObjectWithPage(pageName...
@Cacheable(cacheNames = "faqs", key = "#pageName") public FaqItemsDto getFAQsForPage(final String pageName) { return fetchFAQs().getPages() .stream() .filter(page -> page.getName().equalsIgnoreCase(pageName)) .findFirst().map(page -> processFAQs(page.getFaqs(), page.getSubtitle())) .orElse(new FaqItemsDto(StringUtils.E...
GithubFAQServiceImpl implements FAQService { @Cacheable(cacheNames = "faqs", key = "#pageName") public FaqItemsDto getFAQsForPage(final String pageName) { return fetchFAQs().getPages() .stream() .filter(page -> page.getName().equalsIgnoreCase(pageName)) .findFirst().map(page -> processFAQs(page.getFaqs(), page.getSubti...
GithubFAQServiceImpl implements FAQService { @Cacheable(cacheNames = "faqs", key = "#pageName") public FaqItemsDto getFAQsForPage(final String pageName) { return fetchFAQs().getPages() .stream() .filter(page -> page.getName().equalsIgnoreCase(pageName)) .findFirst().map(page -> processFAQs(page.getFaqs(), page.getSubti...
GithubFAQServiceImpl implements FAQService { @Cacheable(cacheNames = "faqs", key = "#pageName") public FaqItemsDto getFAQsForPage(final String pageName) { return fetchFAQs().getPages() .stream() .filter(page -> page.getName().equalsIgnoreCase(pageName)) .findFirst().map(page -> processFAQs(page.getFaqs(), page.getSubti...
GithubFAQServiceImpl implements FAQService { @Cacheable(cacheNames = "faqs", key = "#pageName") public FaqItemsDto getFAQsForPage(final String pageName) { return fetchFAQs().getPages() .stream() .filter(page -> page.getName().equalsIgnoreCase(pageName)) .findFirst().map(page -> processFAQs(page.getFaqs(), page.getSubti...
@Test public void getFAQsForPage_xmlMapperThrowsException() throws IOException { final String faqsXml = "vgjk"; final String pageName = "nbn"; final IOException ioException = new IOException(); when(githubGateway.getContentsAsRaw(OWNER, REPO, MASTER, FILE_PATH)).thenReturn(faqsXml); doThrow(ioException).when(xmlMapper)...
@Cacheable(cacheNames = "faqs", key = "#pageName") public FaqItemsDto getFAQsForPage(final String pageName) { return fetchFAQs().getPages() .stream() .filter(page -> page.getName().equalsIgnoreCase(pageName)) .findFirst().map(page -> processFAQs(page.getFaqs(), page.getSubtitle())) .orElse(new FaqItemsDto(StringUtils.E...
GithubFAQServiceImpl implements FAQService { @Cacheable(cacheNames = "faqs", key = "#pageName") public FaqItemsDto getFAQsForPage(final String pageName) { return fetchFAQs().getPages() .stream() .filter(page -> page.getName().equalsIgnoreCase(pageName)) .findFirst().map(page -> processFAQs(page.getFaqs(), page.getSubti...
GithubFAQServiceImpl implements FAQService { @Cacheable(cacheNames = "faqs", key = "#pageName") public FaqItemsDto getFAQsForPage(final String pageName) { return fetchFAQs().getPages() .stream() .filter(page -> page.getName().equalsIgnoreCase(pageName)) .findFirst().map(page -> processFAQs(page.getFaqs(), page.getSubti...
GithubFAQServiceImpl implements FAQService { @Cacheable(cacheNames = "faqs", key = "#pageName") public FaqItemsDto getFAQsForPage(final String pageName) { return fetchFAQs().getPages() .stream() .filter(page -> page.getName().equalsIgnoreCase(pageName)) .findFirst().map(page -> processFAQs(page.getFaqs(), page.getSubti...
GithubFAQServiceImpl implements FAQService { @Cacheable(cacheNames = "faqs", key = "#pageName") public FaqItemsDto getFAQsForPage(final String pageName) { return fetchFAQs().getPages() .stream() .filter(page -> page.getName().equalsIgnoreCase(pageName)) .findFirst().map(page -> processFAQs(page.getFaqs(), page.getSubti...
@Test public void getFAQsForPage_noFAQsFound() throws IOException { final String faqsXml = "fadgszdbg"; final List<Faq> faqs = new ArrayList<>(); final List<FaqItemDto> faqItems = new ArrayList<>(); when(githubGateway.getContentsAsRaw(OWNER, REPO, MASTER, FILE_PATH)).thenReturn(faqsXml); when(xmlMapper.readValue(faqsXm...
@Cacheable(cacheNames = "faqs", key = "#pageName") public FaqItemsDto getFAQsForPage(final String pageName) { return fetchFAQs().getPages() .stream() .filter(page -> page.getName().equalsIgnoreCase(pageName)) .findFirst().map(page -> processFAQs(page.getFaqs(), page.getSubtitle())) .orElse(new FaqItemsDto(StringUtils.E...
GithubFAQServiceImpl implements FAQService { @Cacheable(cacheNames = "faqs", key = "#pageName") public FaqItemsDto getFAQsForPage(final String pageName) { return fetchFAQs().getPages() .stream() .filter(page -> page.getName().equalsIgnoreCase(pageName)) .findFirst().map(page -> processFAQs(page.getFaqs(), page.getSubti...
GithubFAQServiceImpl implements FAQService { @Cacheable(cacheNames = "faqs", key = "#pageName") public FaqItemsDto getFAQsForPage(final String pageName) { return fetchFAQs().getPages() .stream() .filter(page -> page.getName().equalsIgnoreCase(pageName)) .findFirst().map(page -> processFAQs(page.getFaqs(), page.getSubti...
GithubFAQServiceImpl implements FAQService { @Cacheable(cacheNames = "faqs", key = "#pageName") public FaqItemsDto getFAQsForPage(final String pageName) { return fetchFAQs().getPages() .stream() .filter(page -> page.getName().equalsIgnoreCase(pageName)) .findFirst().map(page -> processFAQs(page.getFaqs(), page.getSubti...
GithubFAQServiceImpl implements FAQService { @Cacheable(cacheNames = "faqs", key = "#pageName") public FaqItemsDto getFAQsForPage(final String pageName) { return fetchFAQs().getPages() .stream() .filter(page -> page.getName().equalsIgnoreCase(pageName)) .findFirst().map(page -> processFAQs(page.getFaqs(), page.getSubti...
@Test void savesReferralAndCreatesBounty() { Principal referee = () -> "davyvanroy"; CreateRefCommand command = CreateRefCommand.builder().principal(referee).ref("referrer").build(); when(keycloakRepository.userExists(referee.getName())).thenReturn(true); when(keycloakRepository.userExists(command.getRef())).thenReturn...
@Override @Transactional public void createNewRef(CreateRefCommand command) { String referrer = command.getRef(); String referee = command.getPrincipal().getName(); validReferral(referrer, referee); if (!repository.existsByReferee(referee)) { Referral referral = Referral.builder() .referrer(referrer) .referee(referee) ...
ReferralServiceImpl implements ReferralService { @Override @Transactional public void createNewRef(CreateRefCommand command) { String referrer = command.getRef(); String referee = command.getPrincipal().getName(); validReferral(referrer, referee); if (!repository.existsByReferee(referee)) { Referral referral = Referral...
ReferralServiceImpl implements ReferralService { @Override @Transactional public void createNewRef(CreateRefCommand command) { String referrer = command.getRef(); String referee = command.getPrincipal().getName(); validReferral(referrer, referee); if (!repository.existsByReferee(referee)) { Referral referral = Referral...
ReferralServiceImpl implements ReferralService { @Override @Transactional public void createNewRef(CreateRefCommand command) { String referrer = command.getRef(); String referee = command.getPrincipal().getName(); validReferral(referrer, referee); if (!repository.existsByReferee(referee)) { Referral referral = Referral...
ReferralServiceImpl implements ReferralService { @Override @Transactional public void createNewRef(CreateRefCommand command) { String referrer = command.getRef(); String referee = command.getPrincipal().getName(); validReferral(referrer, referee); if (!repository.existsByReferee(referee)) { Referral referral = Referral...
@Test void userOwnsAddress() { Wallet wallet = WalletMother.aWallet(); UserProfile userProfile = UserProfile.builder() .etherAddresses(Collections.singletonList(wallet.getAddress())) .linkedin(null) .github(null) .arkane(null) .google(null) .wallets(Collections.singletonList(wallet)).build(); assertThat(userProfile.use...
public boolean userOwnsAddress(String address) { return getEtherAddresses().stream().anyMatch(x -> x.equalsIgnoreCase(address)); }
UserProfile { public boolean userOwnsAddress(String address) { return getEtherAddresses().stream().anyMatch(x -> x.equalsIgnoreCase(address)); } }
UserProfile { public boolean userOwnsAddress(String address) { return getEtherAddresses().stream().anyMatch(x -> x.equalsIgnoreCase(address)); } }
UserProfile { public boolean userOwnsAddress(String address) { return getEtherAddresses().stream().anyMatch(x -> x.equalsIgnoreCase(address)); } boolean userOwnsAddress(String address); boolean hasEtherAddress(); }
UserProfile { public boolean userOwnsAddress(String address) { return getEtherAddresses().stream().anyMatch(x -> x.equalsIgnoreCase(address)); } boolean userOwnsAddress(String address); boolean hasEtherAddress(); }
@Test public void getUserProfileReturnsCreationDate() { UserRepresentation userRepresentation = new UserRepresentation(); Date creationDate = DateUtil.parse("2018-01-31"); userRepresentation.setCreatedTimestamp(creationDate.getTime()); userRepresentation.setEmail("davy.van.roy@gmail.com"); when(keycloakRepository.getUs...
@Override @Cacheable(value = "user_profile", key = "#principal.name") public UserProfile getUserProfile(Principal principal) { final Map<Provider, UserProfileProvider> providers = keycloakRepository.getUserIdentities(principal.getName()) .collect(Collectors.toMap(UserIdentity::getProvider, x -> UserProfileProvider.buil...
ProfileServiceImpl implements ProfileService { @Override @Cacheable(value = "user_profile", key = "#principal.name") public UserProfile getUserProfile(Principal principal) { final Map<Provider, UserProfileProvider> providers = keycloakRepository.getUserIdentities(principal.getName()) .collect(Collectors.toMap(UserIdent...
ProfileServiceImpl implements ProfileService { @Override @Cacheable(value = "user_profile", key = "#principal.name") public UserProfile getUserProfile(Principal principal) { final Map<Provider, UserProfileProvider> providers = keycloakRepository.getUserIdentities(principal.getName()) .collect(Collectors.toMap(UserIdent...
ProfileServiceImpl implements ProfileService { @Override @Cacheable(value = "user_profile", key = "#principal.name") public UserProfile getUserProfile(Principal principal) { final Map<Provider, UserProfileProvider> providers = keycloakRepository.getUserIdentities(principal.getName()) .collect(Collectors.toMap(UserIdent...
ProfileServiceImpl implements ProfileService { @Override @Cacheable(value = "user_profile", key = "#principal.name") public UserProfile getUserProfile(Principal principal) { final Map<Provider, UserProfileProvider> providers = keycloakRepository.getUserIdentities(principal.getName()) .collect(Collectors.toMap(UserIdent...
@Test void getPaidBounties() { Principal principal = () -> "davyvanroy"; Bounty bounty = Bounty.builder().type(BountyType.LINK_GITHUB).build(); ReflectionTestUtils.setField(bounty, "transactionHash", "0x0"); when(bountyRepository.findByUserId(principal.getName())).thenReturn(Collections.singletonList(bounty)); List<Pai...
@Override @Transactional(readOnly = true) public List<PaidBountyDto> getPaidBounties(Principal principal) { return bountyRepository.findByUserId(principal.getName()) .stream() .filter(f -> StringUtils.isNotBlank(f.getTransactionHash())) .sorted(Comparator.comparing(AbstractEntity::getCreationDate).reversed()) .map(b ->...
BountyServiceImpl implements BountyService { @Override @Transactional(readOnly = true) public List<PaidBountyDto> getPaidBounties(Principal principal) { return bountyRepository.findByUserId(principal.getName()) .stream() .filter(f -> StringUtils.isNotBlank(f.getTransactionHash())) .sorted(Comparator.comparing(AbstractE...
BountyServiceImpl implements BountyService { @Override @Transactional(readOnly = true) public List<PaidBountyDto> getPaidBounties(Principal principal) { return bountyRepository.findByUserId(principal.getName()) .stream() .filter(f -> StringUtils.isNotBlank(f.getTransactionHash())) .sorted(Comparator.comparing(AbstractE...
BountyServiceImpl implements BountyService { @Override @Transactional(readOnly = true) public List<PaidBountyDto> getPaidBounties(Principal principal) { return bountyRepository.findByUserId(principal.getName()) .stream() .filter(f -> StringUtils.isNotBlank(f.getTransactionHash())) .sorted(Comparator.comparing(AbstractE...
BountyServiceImpl implements BountyService { @Override @Transactional(readOnly = true) public List<PaidBountyDto> getPaidBounties(Principal principal) { return bountyRepository.findByUserId(principal.getName()) .stream() .filter(f -> StringUtils.isNotBlank(f.getTransactionHash())) .sorted(Comparator.comparing(AbstractE...
@Test public void onAuthenticationChecksGithubSignup() { Authentication authentication = mock(Authentication.class, RETURNS_DEEP_STUBS); when(authentication.getName()).thenReturn("davy"); when(profileService.getUserProfile(authentication)) .thenReturn(UserProfile.builder().github(UserProfileProvider.builder().userId("i...
@Override @Transactional public void onApplicationEvent(AuthenticationSuccessEvent event) { Authentication principal = event.getAuthentication(); UserProfile userProfile = profileService.getUserProfile(principal); if (userProfile.getGithub() != null && StringUtils.isNotBlank(userProfile.getGithub().getUserId())) { crea...
GithubBountyServiceImpl implements GithubBountyService, ApplicationListener<AuthenticationSuccessEvent> { @Override @Transactional public void onApplicationEvent(AuthenticationSuccessEvent event) { Authentication principal = event.getAuthentication(); UserProfile userProfile = profileService.getUserProfile(principal); ...
GithubBountyServiceImpl implements GithubBountyService, ApplicationListener<AuthenticationSuccessEvent> { @Override @Transactional public void onApplicationEvent(AuthenticationSuccessEvent event) { Authentication principal = event.getAuthentication(); UserProfile userProfile = profileService.getUserProfile(principal); ...
GithubBountyServiceImpl implements GithubBountyService, ApplicationListener<AuthenticationSuccessEvent> { @Override @Transactional public void onApplicationEvent(AuthenticationSuccessEvent event) { Authentication principal = event.getAuthentication(); UserProfile userProfile = profileService.getUserProfile(principal); ...
GithubBountyServiceImpl implements GithubBountyService, ApplicationListener<AuthenticationSuccessEvent> { @Override @Transactional public void onApplicationEvent(AuthenticationSuccessEvent event) { Authentication principal = event.getAuthentication(); UserProfile userProfile = profileService.getUserProfile(principal); ...
@Test public void onProviderLinked() { Authentication authentication = mock(Authentication.class, RETURNS_DEEP_STUBS); when(authentication.getName()).thenReturn("davy"); when(profileService.getUserProfile(authentication)) .thenReturn(UserProfile.builder().github(UserProfileProvider.builder().userId("id").username("davy...
@EventListener @Transactional public void onProviderLinked(UserLinkedProviderEvent event) { if (event.getProvider() == Provider.GITHUB && event.getPrincipal() != null) { UserProfile userProfile = profileService.getUserProfile(event.getPrincipal()); createBountyWhenNecessary(event.getPrincipal(), userProfile); } }
GithubBountyServiceImpl implements GithubBountyService, ApplicationListener<AuthenticationSuccessEvent> { @EventListener @Transactional public void onProviderLinked(UserLinkedProviderEvent event) { if (event.getProvider() == Provider.GITHUB && event.getPrincipal() != null) { UserProfile userProfile = profileService.get...
GithubBountyServiceImpl implements GithubBountyService, ApplicationListener<AuthenticationSuccessEvent> { @EventListener @Transactional public void onProviderLinked(UserLinkedProviderEvent event) { if (event.getProvider() == Provider.GITHUB && event.getPrincipal() != null) { UserProfile userProfile = profileService.get...
GithubBountyServiceImpl implements GithubBountyService, ApplicationListener<AuthenticationSuccessEvent> { @EventListener @Transactional public void onProviderLinked(UserLinkedProviderEvent event) { if (event.getProvider() == Provider.GITHUB && event.getPrincipal() != null) { UserProfile userProfile = profileService.get...
GithubBountyServiceImpl implements GithubBountyService, ApplicationListener<AuthenticationSuccessEvent> { @EventListener @Transactional public void onProviderLinked(UserLinkedProviderEvent event) { if (event.getProvider() == Provider.GITHUB && event.getPrincipal() != null) { UserProfile userProfile = profileService.get...
@Test void updateEtherAddress() { final String userId = "agd"; final UserResource userResource = mock(UserResource.class); final UserRepresentation userRepresentation = mock(UserRepresentation.class); final Map<String, List<String>> userAttributes = new HashMap<>(); userAttributes.put(ETHER_ADDRESS_KEY, Collections.sin...
public void updateEtherAddress(String userId, String newAddress) { final UserResource userResource = resource.users().get(userId); final UserRepresentation userRepresentation = userResource.toRepresentation(); if (userRepresentation.getAttributes() == null) { userRepresentation.setAttributes(new HashMap<>()); } if (!is...
KeycloakRepositoryImpl implements KeycloakRepository { public void updateEtherAddress(String userId, String newAddress) { final UserResource userResource = resource.users().get(userId); final UserRepresentation userRepresentation = userResource.toRepresentation(); if (userRepresentation.getAttributes() == null) { userR...
KeycloakRepositoryImpl implements KeycloakRepository { public void updateEtherAddress(String userId, String newAddress) { final UserResource userResource = resource.users().get(userId); final UserRepresentation userRepresentation = userResource.toRepresentation(); if (userRepresentation.getAttributes() == null) { userR...
KeycloakRepositoryImpl implements KeycloakRepository { public void updateEtherAddress(String userId, String newAddress) { final UserResource userResource = resource.users().get(userId); final UserRepresentation userRepresentation = userResource.toRepresentation(); if (userRepresentation.getAttributes() == null) { userR...
KeycloakRepositoryImpl implements KeycloakRepository { public void updateEtherAddress(String userId, String newAddress) { final UserResource userResource = resource.users().get(userId); final UserRepresentation userRepresentation = userResource.toRepresentation(); if (userRepresentation.getAttributes() == null) { userR...
@Test void map() { assertThat(mapper.map(TestEnum.BLABLABLA)).isEqualTo("Blablabla"); assertThat(mapper.map(TestEnum.BLIBLIBLI)).isEqualTo("Bliblibli"); assertThat(mapper.map(SomeOtherTestEnum.BLOBLOBLO)).isEqualTo("Blobloblo"); }
@Override public String map(final Enum anEnum) { if (anEnum == null) { return null; } return WordUtils.capitalizeFully(anEnum.name().replace('_', ' ')); }
EnumToCapitalizedStringMapper implements BaseMapper<Enum, String> { @Override public String map(final Enum anEnum) { if (anEnum == null) { return null; } return WordUtils.capitalizeFully(anEnum.name().replace('_', ' ')); } }
EnumToCapitalizedStringMapper implements BaseMapper<Enum, String> { @Override public String map(final Enum anEnum) { if (anEnum == null) { return null; } return WordUtils.capitalizeFully(anEnum.name().replace('_', ' ')); } }
EnumToCapitalizedStringMapper implements BaseMapper<Enum, String> { @Override public String map(final Enum anEnum) { if (anEnum == null) { return null; } return WordUtils.capitalizeFully(anEnum.name().replace('_', ' ')); } @Override String map(final Enum anEnum); }
EnumToCapitalizedStringMapper implements BaseMapper<Enum, String> { @Override public String map(final Enum anEnum) { if (anEnum == null) { return null; } return WordUtils.capitalizeFully(anEnum.name().replace('_', ' ')); } @Override String map(final Enum anEnum); }
@Test void map_null() { assertThat(mapper.map(null)).isNull(); }
@Override public String map(final Enum anEnum) { if (anEnum == null) { return null; } return WordUtils.capitalizeFully(anEnum.name().replace('_', ' ')); }
EnumToCapitalizedStringMapper implements BaseMapper<Enum, String> { @Override public String map(final Enum anEnum) { if (anEnum == null) { return null; } return WordUtils.capitalizeFully(anEnum.name().replace('_', ' ')); } }
EnumToCapitalizedStringMapper implements BaseMapper<Enum, String> { @Override public String map(final Enum anEnum) { if (anEnum == null) { return null; } return WordUtils.capitalizeFully(anEnum.name().replace('_', ' ')); } }
EnumToCapitalizedStringMapper implements BaseMapper<Enum, String> { @Override public String map(final Enum anEnum) { if (anEnum == null) { return null; } return WordUtils.capitalizeFully(anEnum.name().replace('_', ' ')); } @Override String map(final Enum anEnum); }
EnumToCapitalizedStringMapper implements BaseMapper<Enum, String> { @Override public String map(final Enum anEnum) { if (anEnum == null) { return null; } return WordUtils.capitalizeFully(anEnum.name().replace('_', ' ')); } @Override String map(final Enum anEnum); }
@Test public void getUser() throws Exception { User user = UserMother.davy(); UserDto userDto = UserDtoMother.davy(); when(userRepository.findOne(user.getEmail())).thenReturn(Optional.of(user)); when(userDtoMapper.map(user)).thenReturn(userDto); UserDto result = userService.getUser(user.getEmail()); assertThat(result)....
@Override @Transactional(readOnly = true) public UserDto getUser(String email) { return userDtoMapper.map( userRepository.findOne(email).orElse(null) ); }
UserServiceImpl implements UserService { @Override @Transactional(readOnly = true) public UserDto getUser(String email) { return userDtoMapper.map( userRepository.findOne(email).orElse(null) ); } }
UserServiceImpl implements UserService { @Override @Transactional(readOnly = true) public UserDto getUser(String email) { return userDtoMapper.map( userRepository.findOne(email).orElse(null) ); } UserServiceImpl(UserRepository userRepository, UserDtoMapper userDtoMapper); }
UserServiceImpl implements UserService { @Override @Transactional(readOnly = true) public UserDto getUser(String email) { return userDtoMapper.map( userRepository.findOne(email).orElse(null) ); } UserServiceImpl(UserRepository userRepository, UserDtoMapper userDtoMapper); @Override @Transactional(readOnly = true) UserD...
UserServiceImpl implements UserService { @Override @Transactional(readOnly = true) public UserDto getUser(String email) { return userDtoMapper.map( userRepository.findOne(email).orElse(null) ); } UserServiceImpl(UserRepository userRepository, UserDtoMapper userDtoMapper); @Override @Transactional(readOnly = true) UserD...
@Test void findBy() { final String platformId = "dfsfd|FR|wfgwar|FR|243"; final GithubIssue githubIssue = GithubIssue.builder().build(); final PlatformIssueDto platformIssueDto = PlatformIssueDto.builder().build(); when(githubIssueService.findBy(platformId)).thenReturn(Optional.of(githubIssue)); when(mappers.map(Github...
@Override public Optional<PlatformIssueDto> findBy(final Platform platform, final String platformId) { if (Platform.GITHUB == platform) { return githubIssueService.findBy(platformId) .map(githubIssue -> mappers.map(GithubIssue.class, PlatformIssueDto.class, githubIssue)); } return Optional.empty(); }
PlatformIssueServiceImpl implements PlatformIssueService { @Override public Optional<PlatformIssueDto> findBy(final Platform platform, final String platformId) { if (Platform.GITHUB == platform) { return githubIssueService.findBy(platformId) .map(githubIssue -> mappers.map(GithubIssue.class, PlatformIssueDto.class, git...
PlatformIssueServiceImpl implements PlatformIssueService { @Override public Optional<PlatformIssueDto> findBy(final Platform platform, final String platformId) { if (Platform.GITHUB == platform) { return githubIssueService.findBy(platformId) .map(githubIssue -> mappers.map(GithubIssue.class, PlatformIssueDto.class, git...
PlatformIssueServiceImpl implements PlatformIssueService { @Override public Optional<PlatformIssueDto> findBy(final Platform platform, final String platformId) { if (Platform.GITHUB == platform) { return githubIssueService.findBy(platformId) .map(githubIssue -> mappers.map(GithubIssue.class, PlatformIssueDto.class, git...
PlatformIssueServiceImpl implements PlatformIssueService { @Override public Optional<PlatformIssueDto> findBy(final Platform platform, final String platformId) { if (Platform.GITHUB == platform) { return githubIssueService.findBy(platformId) .map(githubIssue -> mappers.map(GithubIssue.class, PlatformIssueDto.class, git...
@Test void findBy_noGithubIssueFound() { final String platformId = "dfsfd|FR|wfgwar|FR|243"; when(githubIssueService.findBy(platformId)).thenReturn(Optional.empty()); final Optional<PlatformIssueDto> result = platformIssueService.findBy(Platform.GITHUB, platformId); assertThat(result).isEmpty(); }
@Override public Optional<PlatformIssueDto> findBy(final Platform platform, final String platformId) { if (Platform.GITHUB == platform) { return githubIssueService.findBy(platformId) .map(githubIssue -> mappers.map(GithubIssue.class, PlatformIssueDto.class, githubIssue)); } return Optional.empty(); }
PlatformIssueServiceImpl implements PlatformIssueService { @Override public Optional<PlatformIssueDto> findBy(final Platform platform, final String platformId) { if (Platform.GITHUB == platform) { return githubIssueService.findBy(platformId) .map(githubIssue -> mappers.map(GithubIssue.class, PlatformIssueDto.class, git...
PlatformIssueServiceImpl implements PlatformIssueService { @Override public Optional<PlatformIssueDto> findBy(final Platform platform, final String platformId) { if (Platform.GITHUB == platform) { return githubIssueService.findBy(platformId) .map(githubIssue -> mappers.map(GithubIssue.class, PlatformIssueDto.class, git...
PlatformIssueServiceImpl implements PlatformIssueService { @Override public Optional<PlatformIssueDto> findBy(final Platform platform, final String platformId) { if (Platform.GITHUB == platform) { return githubIssueService.findBy(platformId) .map(githubIssue -> mappers.map(GithubIssue.class, PlatformIssueDto.class, git...
PlatformIssueServiceImpl implements PlatformIssueService { @Override public Optional<PlatformIssueDto> findBy(final Platform platform, final String platformId) { if (Platform.GITHUB == platform) { return githubIssueService.findBy(platformId) .map(githubIssue -> mappers.map(GithubIssue.class, PlatformIssueDto.class, git...
@Test void findBy_platformNotGithub() { final String platformId = "dfsfd|FR|wfgwar|FR|243"; final GithubIssue githubIssue = GithubIssue.builder().build(); final PlatformIssueDto platformIssueDto = PlatformIssueDto.builder().build(); when(githubIssueService.findBy(platformId)).thenReturn(Optional.of(githubIssue)); when(...
@Override public Optional<PlatformIssueDto> findBy(final Platform platform, final String platformId) { if (Platform.GITHUB == platform) { return githubIssueService.findBy(platformId) .map(githubIssue -> mappers.map(GithubIssue.class, PlatformIssueDto.class, githubIssue)); } return Optional.empty(); }
PlatformIssueServiceImpl implements PlatformIssueService { @Override public Optional<PlatformIssueDto> findBy(final Platform platform, final String platformId) { if (Platform.GITHUB == platform) { return githubIssueService.findBy(platformId) .map(githubIssue -> mappers.map(GithubIssue.class, PlatformIssueDto.class, git...
PlatformIssueServiceImpl implements PlatformIssueService { @Override public Optional<PlatformIssueDto> findBy(final Platform platform, final String platformId) { if (Platform.GITHUB == platform) { return githubIssueService.findBy(platformId) .map(githubIssue -> mappers.map(GithubIssue.class, PlatformIssueDto.class, git...
PlatformIssueServiceImpl implements PlatformIssueService { @Override public Optional<PlatformIssueDto> findBy(final Platform platform, final String platformId) { if (Platform.GITHUB == platform) { return githubIssueService.findBy(platformId) .map(githubIssue -> mappers.map(GithubIssue.class, PlatformIssueDto.class, git...
PlatformIssueServiceImpl implements PlatformIssueService { @Override public Optional<PlatformIssueDto> findBy(final Platform platform, final String platformId) { if (Platform.GITHUB == platform) { return githubIssueService.findBy(platformId) .map(githubIssue -> mappers.map(GithubIssue.class, PlatformIssueDto.class, git...
@Test void map_statusOpen() { final String owner = "dbfv"; final String repo = "sgs"; final String number = "435"; final PlatformIssueDto result = mapper.map(GithubIssue.builder().solver("svdzdv").owner(owner).repo(repo).number(number).status("Open").build()); assertThat(result.getPlatform()).isEqualTo(GITHUB); assertT...
@Override public PlatformIssueDto map(final GithubIssue githubIssue) { return PlatformIssueDto.builder() .platform(GITHUB) .platformId(buildPlatformId(githubIssue)) .status(isClosed(githubIssue) ? CLOSED : OPEN) .build(); }
GithubIssueToPlatformIssueDtoMapper implements BaseMapper<GithubIssue, PlatformIssueDto> { @Override public PlatformIssueDto map(final GithubIssue githubIssue) { return PlatformIssueDto.builder() .platform(GITHUB) .platformId(buildPlatformId(githubIssue)) .status(isClosed(githubIssue) ? CLOSED : OPEN) .build(); } }
GithubIssueToPlatformIssueDtoMapper implements BaseMapper<GithubIssue, PlatformIssueDto> { @Override public PlatformIssueDto map(final GithubIssue githubIssue) { return PlatformIssueDto.builder() .platform(GITHUB) .platformId(buildPlatformId(githubIssue)) .status(isClosed(githubIssue) ? CLOSED : OPEN) .build(); } }
GithubIssueToPlatformIssueDtoMapper implements BaseMapper<GithubIssue, PlatformIssueDto> { @Override public PlatformIssueDto map(final GithubIssue githubIssue) { return PlatformIssueDto.builder() .platform(GITHUB) .platformId(buildPlatformId(githubIssue)) .status(isClosed(githubIssue) ? CLOSED : OPEN) .build(); } @Ove...
GithubIssueToPlatformIssueDtoMapper implements BaseMapper<GithubIssue, PlatformIssueDto> { @Override public PlatformIssueDto map(final GithubIssue githubIssue) { return PlatformIssueDto.builder() .platform(GITHUB) .platformId(buildPlatformId(githubIssue)) .status(isClosed(githubIssue) ? CLOSED : OPEN) .build(); } @Ove...
@Test void map_statusClosed() { final String owner = "gsb"; final String repo = "gukf"; final String number = "3278"; final PlatformIssueDto result = mapper.map(GithubIssue.builder().solver("svdzdv").owner(owner).repo(repo).number(number).status("Closed").build()); assertThat(result.getPlatform()).isEqualTo(GITHUB); as...
@Override public PlatformIssueDto map(final GithubIssue githubIssue) { return PlatformIssueDto.builder() .platform(GITHUB) .platformId(buildPlatformId(githubIssue)) .status(isClosed(githubIssue) ? CLOSED : OPEN) .build(); }
GithubIssueToPlatformIssueDtoMapper implements BaseMapper<GithubIssue, PlatformIssueDto> { @Override public PlatformIssueDto map(final GithubIssue githubIssue) { return PlatformIssueDto.builder() .platform(GITHUB) .platformId(buildPlatformId(githubIssue)) .status(isClosed(githubIssue) ? CLOSED : OPEN) .build(); } }
GithubIssueToPlatformIssueDtoMapper implements BaseMapper<GithubIssue, PlatformIssueDto> { @Override public PlatformIssueDto map(final GithubIssue githubIssue) { return PlatformIssueDto.builder() .platform(GITHUB) .platformId(buildPlatformId(githubIssue)) .status(isClosed(githubIssue) ? CLOSED : OPEN) .build(); } }
GithubIssueToPlatformIssueDtoMapper implements BaseMapper<GithubIssue, PlatformIssueDto> { @Override public PlatformIssueDto map(final GithubIssue githubIssue) { return PlatformIssueDto.builder() .platform(GITHUB) .platformId(buildPlatformId(githubIssue)) .status(isClosed(githubIssue) ? CLOSED : OPEN) .build(); } @Ove...
GithubIssueToPlatformIssueDtoMapper implements BaseMapper<GithubIssue, PlatformIssueDto> { @Override public PlatformIssueDto map(final GithubIssue githubIssue) { return PlatformIssueDto.builder() .platform(GITHUB) .platformId(buildPlatformId(githubIssue)) .status(isClosed(githubIssue) ? CLOSED : OPEN) .build(); } @Ove...
@Test void getMessagesByType() { Message message2 = mock(Message.class); Message message3 = mock(Message.class); MessageDto messageDto2 = mock(MessageDto.class); MessageDto messageDto3 = mock(MessageDto.class); when(objectMapper.convertValue(same(message2), eq(MessageDto.class))).thenReturn(messageDto2); when(objectMap...
@Transactional(readOnly = true) @Override public List<MessageDto> getMessagesByType(MessageType type) { return repository.findByType(type, new Sort(Sort.Direction.DESC, "name")) .stream() .parallel() .map(m -> objectMapper.convertValue(m, MessageDto.class)) .collect(Collectors.toList()); }
MessageServiceImpl implements MessageService { @Transactional(readOnly = true) @Override public List<MessageDto> getMessagesByType(MessageType type) { return repository.findByType(type, new Sort(Sort.Direction.DESC, "name")) .stream() .parallel() .map(m -> objectMapper.convertValue(m, MessageDto.class)) .collect(Collec...
MessageServiceImpl implements MessageService { @Transactional(readOnly = true) @Override public List<MessageDto> getMessagesByType(MessageType type) { return repository.findByType(type, new Sort(Sort.Direction.DESC, "name")) .stream() .parallel() .map(m -> objectMapper.convertValue(m, MessageDto.class)) .collect(Collec...
MessageServiceImpl implements MessageService { @Transactional(readOnly = true) @Override public List<MessageDto> getMessagesByType(MessageType type) { return repository.findByType(type, new Sort(Sort.Direction.DESC, "name")) .stream() .parallel() .map(m -> objectMapper.convertValue(m, MessageDto.class)) .collect(Collec...
MessageServiceImpl implements MessageService { @Transactional(readOnly = true) @Override public List<MessageDto> getMessagesByType(MessageType type) { return repository.findByType(type, new Sort(Sort.Direction.DESC, "name")) .stream() .parallel() .map(m -> objectMapper.convertValue(m, MessageDto.class)) .collect(Collec...
@Test void getMessageByKey() { MessageDto result = messageService.getMessageByKey("REFERRAL_SHARE.message1"); assertThat(result).isEqualTo(messageDto1); }
@Override public MessageDto getMessageByKey(String key) { int indexSeperator = key.indexOf('.'); if (indexSeperator > 0) { String type = key.substring(0, indexSeperator); String name = key.substring(indexSeperator + 1); return getMessageByTypeAndName(MessageType.valueOf(type.toUpperCase()), name); } else { return null;...
MessageServiceImpl implements MessageService { @Override public MessageDto getMessageByKey(String key) { int indexSeperator = key.indexOf('.'); if (indexSeperator > 0) { String type = key.substring(0, indexSeperator); String name = key.substring(indexSeperator + 1); return getMessageByTypeAndName(MessageType.valueOf(ty...
MessageServiceImpl implements MessageService { @Override public MessageDto getMessageByKey(String key) { int indexSeperator = key.indexOf('.'); if (indexSeperator > 0) { String type = key.substring(0, indexSeperator); String name = key.substring(indexSeperator + 1); return getMessageByTypeAndName(MessageType.valueOf(ty...
MessageServiceImpl implements MessageService { @Override public MessageDto getMessageByKey(String key) { int indexSeperator = key.indexOf('.'); if (indexSeperator > 0) { String type = key.substring(0, indexSeperator); String name = key.substring(indexSeperator + 1); return getMessageByTypeAndName(MessageType.valueOf(ty...
MessageServiceImpl implements MessageService { @Override public MessageDto getMessageByKey(String key) { int indexSeperator = key.indexOf('.'); if (indexSeperator > 0) { String type = key.substring(0, indexSeperator); String name = key.substring(indexSeperator + 1); return getMessageByTypeAndName(MessageType.valueOf(ty...
@Test void updateEtherAddress_doNotUpdateWhenSameAddress() { final String userId = "agd"; final UserResource userResource = mock(UserResource.class); final UserRepresentation userRepresentation = mock(UserRepresentation.class); final Map<String, List<String>> userAttributes = new HashMap<>(); final String address = "0x...
public void updateEtherAddress(String userId, String newAddress) { final UserResource userResource = resource.users().get(userId); final UserRepresentation userRepresentation = userResource.toRepresentation(); if (userRepresentation.getAttributes() == null) { userRepresentation.setAttributes(new HashMap<>()); } if (!is...
KeycloakRepositoryImpl implements KeycloakRepository { public void updateEtherAddress(String userId, String newAddress) { final UserResource userResource = resource.users().get(userId); final UserRepresentation userRepresentation = userResource.toRepresentation(); if (userRepresentation.getAttributes() == null) { userR...
KeycloakRepositoryImpl implements KeycloakRepository { public void updateEtherAddress(String userId, String newAddress) { final UserResource userResource = resource.users().get(userId); final UserRepresentation userRepresentation = userResource.toRepresentation(); if (userRepresentation.getAttributes() == null) { userR...
KeycloakRepositoryImpl implements KeycloakRepository { public void updateEtherAddress(String userId, String newAddress) { final UserResource userResource = resource.users().get(userId); final UserRepresentation userRepresentation = userResource.toRepresentation(); if (userRepresentation.getAttributes() == null) { userR...
KeycloakRepositoryImpl implements KeycloakRepository { public void updateEtherAddress(String userId, String newAddress) { final UserResource userResource = resource.users().get(userId); final UserRepresentation userRepresentation = userResource.toRepresentation(); if (userRepresentation.getAttributes() == null) { userR...
@Test void getMessageByKey_invalidKey() { MessageDto result = messageService.getMessageByKey("INVALIDKEY"); assertThat(result).isNull(); }
@Override public MessageDto getMessageByKey(String key) { int indexSeperator = key.indexOf('.'); if (indexSeperator > 0) { String type = key.substring(0, indexSeperator); String name = key.substring(indexSeperator + 1); return getMessageByTypeAndName(MessageType.valueOf(type.toUpperCase()), name); } else { return null;...
MessageServiceImpl implements MessageService { @Override public MessageDto getMessageByKey(String key) { int indexSeperator = key.indexOf('.'); if (indexSeperator > 0) { String type = key.substring(0, indexSeperator); String name = key.substring(indexSeperator + 1); return getMessageByTypeAndName(MessageType.valueOf(ty...
MessageServiceImpl implements MessageService { @Override public MessageDto getMessageByKey(String key) { int indexSeperator = key.indexOf('.'); if (indexSeperator > 0) { String type = key.substring(0, indexSeperator); String name = key.substring(indexSeperator + 1); return getMessageByTypeAndName(MessageType.valueOf(ty...
MessageServiceImpl implements MessageService { @Override public MessageDto getMessageByKey(String key) { int indexSeperator = key.indexOf('.'); if (indexSeperator > 0) { String type = key.substring(0, indexSeperator); String name = key.substring(indexSeperator + 1); return getMessageByTypeAndName(MessageType.valueOf(ty...
MessageServiceImpl implements MessageService { @Override public MessageDto getMessageByKey(String key) { int indexSeperator = key.indexOf('.'); if (indexSeperator > 0) { String type = key.substring(0, indexSeperator); String name = key.substring(indexSeperator + 1); return getMessageByTypeAndName(MessageType.valueOf(ty...
@Test void getMessageByTypeAndName() { MessageDto result = messageService.getMessageByTypeAndName(MessageType.REFERRAL_SHARE, "message1"); assertThat(result).isEqualTo(messageDto1); }
@Override public MessageDto getMessageByTypeAndName(MessageType type, String name) { Message m = repository.findByTypeAndName(type, name).orElseThrow(() -> new RuntimeException("Message not found")); return objectMapper.convertValue(m, MessageDto.class); }
MessageServiceImpl implements MessageService { @Override public MessageDto getMessageByTypeAndName(MessageType type, String name) { Message m = repository.findByTypeAndName(type, name).orElseThrow(() -> new RuntimeException("Message not found")); return objectMapper.convertValue(m, MessageDto.class); } }
MessageServiceImpl implements MessageService { @Override public MessageDto getMessageByTypeAndName(MessageType type, String name) { Message m = repository.findByTypeAndName(type, name).orElseThrow(() -> new RuntimeException("Message not found")); return objectMapper.convertValue(m, MessageDto.class); } MessageServiceIm...
MessageServiceImpl implements MessageService { @Override public MessageDto getMessageByTypeAndName(MessageType type, String name) { Message m = repository.findByTypeAndName(type, name).orElseThrow(() -> new RuntimeException("Message not found")); return objectMapper.convertValue(m, MessageDto.class); } MessageServiceIm...
MessageServiceImpl implements MessageService { @Override public MessageDto getMessageByTypeAndName(MessageType type, String name) { Message m = repository.findByTypeAndName(type, name).orElseThrow(() -> new RuntimeException("Message not found")); return objectMapper.convertValue(m, MessageDto.class); } MessageServiceIm...
@Test void getMessageByTypeAndName_throwsExceptionWhenNotFound() { when(messageRepository.findByTypeAndName(MessageType.REFERRAL_SHARE, "doesnotexist")) .thenReturn(Optional.empty()); try { messageService.getMessageByTypeAndName(MessageType.REFERRAL_SHARE, "doesnotexist"); failBecauseExceptionWasNotThrown(RuntimeExcept...
@Override public MessageDto getMessageByTypeAndName(MessageType type, String name) { Message m = repository.findByTypeAndName(type, name).orElseThrow(() -> new RuntimeException("Message not found")); return objectMapper.convertValue(m, MessageDto.class); }
MessageServiceImpl implements MessageService { @Override public MessageDto getMessageByTypeAndName(MessageType type, String name) { Message m = repository.findByTypeAndName(type, name).orElseThrow(() -> new RuntimeException("Message not found")); return objectMapper.convertValue(m, MessageDto.class); } }
MessageServiceImpl implements MessageService { @Override public MessageDto getMessageByTypeAndName(MessageType type, String name) { Message m = repository.findByTypeAndName(type, name).orElseThrow(() -> new RuntimeException("Message not found")); return objectMapper.convertValue(m, MessageDto.class); } MessageServiceIm...
MessageServiceImpl implements MessageService { @Override public MessageDto getMessageByTypeAndName(MessageType type, String name) { Message m = repository.findByTypeAndName(type, name).orElseThrow(() -> new RuntimeException("Message not found")); return objectMapper.convertValue(m, MessageDto.class); } MessageServiceIm...
MessageServiceImpl implements MessageService { @Override public MessageDto getMessageByTypeAndName(MessageType type, String name) { Message m = repository.findByTypeAndName(type, name).orElseThrow(() -> new RuntimeException("Message not found")); return objectMapper.convertValue(m, MessageDto.class); } MessageServiceIm...
@Test void update() { when(objectMapper.convertValue(messageDto1, Message.class)).thenReturn(message1); when(messageRepository.save(message1)).thenReturn(message1); assertThat(messageService.update(messageDto1)).isEqualTo(message1); }
@Transactional @Override public Message update(MessageDto messageDto) { Message m = repository.findByTypeAndName(messageDto.getType(), messageDto.getName()).orElseThrow(() -> new RuntimeException("Message not found")); messageDto.setId(m.getId()); Message newM = objectMapper.convertValue(messageDto, Message.class); ret...
MessageServiceImpl implements MessageService { @Transactional @Override public Message update(MessageDto messageDto) { Message m = repository.findByTypeAndName(messageDto.getType(), messageDto.getName()).orElseThrow(() -> new RuntimeException("Message not found")); messageDto.setId(m.getId()); Message newM = objectMapp...
MessageServiceImpl implements MessageService { @Transactional @Override public Message update(MessageDto messageDto) { Message m = repository.findByTypeAndName(messageDto.getType(), messageDto.getName()).orElseThrow(() -> new RuntimeException("Message not found")); messageDto.setId(m.getId()); Message newM = objectMapp...
MessageServiceImpl implements MessageService { @Transactional @Override public Message update(MessageDto messageDto) { Message m = repository.findByTypeAndName(messageDto.getType(), messageDto.getName()).orElseThrow(() -> new RuntimeException("Message not found")); messageDto.setId(m.getId()); Message newM = objectMapp...
MessageServiceImpl implements MessageService { @Transactional @Override public Message update(MessageDto messageDto) { Message m = repository.findByTypeAndName(messageDto.getType(), messageDto.getName()).orElseThrow(() -> new RuntimeException("Message not found")); messageDto.setId(m.getId()); Message newM = objectMapp...
@Test void update_throwsExceptionWhenNotExists() { MessageDto messageDto = mock(MessageDto.class); try { messageService.update(messageDto); failBecauseExceptionWasNotThrown(RuntimeException.class); } catch (RuntimeException e) { assertThat(e.getMessage()).isEqualTo("Message not found"); } }
@Transactional @Override public Message update(MessageDto messageDto) { Message m = repository.findByTypeAndName(messageDto.getType(), messageDto.getName()).orElseThrow(() -> new RuntimeException("Message not found")); messageDto.setId(m.getId()); Message newM = objectMapper.convertValue(messageDto, Message.class); ret...
MessageServiceImpl implements MessageService { @Transactional @Override public Message update(MessageDto messageDto) { Message m = repository.findByTypeAndName(messageDto.getType(), messageDto.getName()).orElseThrow(() -> new RuntimeException("Message not found")); messageDto.setId(m.getId()); Message newM = objectMapp...
MessageServiceImpl implements MessageService { @Transactional @Override public Message update(MessageDto messageDto) { Message m = repository.findByTypeAndName(messageDto.getType(), messageDto.getName()).orElseThrow(() -> new RuntimeException("Message not found")); messageDto.setId(m.getId()); Message newM = objectMapp...
MessageServiceImpl implements MessageService { @Transactional @Override public Message update(MessageDto messageDto) { Message m = repository.findByTypeAndName(messageDto.getType(), messageDto.getName()).orElseThrow(() -> new RuntimeException("Message not found")); messageDto.setId(m.getId()); Message newM = objectMapp...
MessageServiceImpl implements MessageService { @Transactional @Override public Message update(MessageDto messageDto) { Message m = repository.findByTypeAndName(messageDto.getType(), messageDto.getName()).orElseThrow(() -> new RuntimeException("Message not found")); messageDto.setId(m.getId()); Message newM = objectMapp...
@Test void add() { Message message = Message.builder().type(MessageType.REFERRAL_SHARE).name("myNewItem").build(); MessageDto messageDto = MessageDto.builder().type(MessageType.REFERRAL_SHARE).name("myNewItem").build(); when(objectMapper.convertValue(messageDto, Message.class)).thenReturn(message); when(messageReposito...
@Transactional @Override public Message add(MessageDto messageDto) { int minlength = 3; if (messageDto.getName().length() < 3) { throw new RuntimeException(String.format("Message name should be at least %s characters long", minlength)); } if (repository.findByTypeAndName(messageDto.getType(), messageDto.getName()).isPr...
MessageServiceImpl implements MessageService { @Transactional @Override public Message add(MessageDto messageDto) { int minlength = 3; if (messageDto.getName().length() < 3) { throw new RuntimeException(String.format("Message name should be at least %s characters long", minlength)); } if (repository.findByTypeAndName(m...
MessageServiceImpl implements MessageService { @Transactional @Override public Message add(MessageDto messageDto) { int minlength = 3; if (messageDto.getName().length() < 3) { throw new RuntimeException(String.format("Message name should be at least %s characters long", minlength)); } if (repository.findByTypeAndName(m...
MessageServiceImpl implements MessageService { @Transactional @Override public Message add(MessageDto messageDto) { int minlength = 3; if (messageDto.getName().length() < 3) { throw new RuntimeException(String.format("Message name should be at least %s characters long", minlength)); } if (repository.findByTypeAndName(m...
MessageServiceImpl implements MessageService { @Transactional @Override public Message add(MessageDto messageDto) { int minlength = 3; if (messageDto.getName().length() < 3) { throw new RuntimeException(String.format("Message name should be at least %s characters long", minlength)); } if (repository.findByTypeAndName(m...
@Test void add_throwsExceptionWhenExists() { try { messageService.add(messageDto1); failBecauseExceptionWasNotThrown(RuntimeException.class); } catch (RuntimeException e) { assertThat(e.getMessage()).isEqualTo(String.format("Message with type %s and name %s already exists", messageDto1.getType().toString(), messageDto1...
@Transactional @Override public Message add(MessageDto messageDto) { int minlength = 3; if (messageDto.getName().length() < 3) { throw new RuntimeException(String.format("Message name should be at least %s characters long", minlength)); } if (repository.findByTypeAndName(messageDto.getType(), messageDto.getName()).isPr...
MessageServiceImpl implements MessageService { @Transactional @Override public Message add(MessageDto messageDto) { int minlength = 3; if (messageDto.getName().length() < 3) { throw new RuntimeException(String.format("Message name should be at least %s characters long", minlength)); } if (repository.findByTypeAndName(m...
MessageServiceImpl implements MessageService { @Transactional @Override public Message add(MessageDto messageDto) { int minlength = 3; if (messageDto.getName().length() < 3) { throw new RuntimeException(String.format("Message name should be at least %s characters long", minlength)); } if (repository.findByTypeAndName(m...
MessageServiceImpl implements MessageService { @Transactional @Override public Message add(MessageDto messageDto) { int minlength = 3; if (messageDto.getName().length() < 3) { throw new RuntimeException(String.format("Message name should be at least %s characters long", minlength)); } if (repository.findByTypeAndName(m...
MessageServiceImpl implements MessageService { @Transactional @Override public Message add(MessageDto messageDto) { int minlength = 3; if (messageDto.getName().length() < 3) { throw new RuntimeException(String.format("Message name should be at least %s characters long", minlength)); } if (repository.findByTypeAndName(m...
@Test void add_throwsExceptionWhenNameIsToShort() { MessageDto messageDto = MessageDto.builder().type(MessageType.REFERRAL_SHARE).name("m1").build(); try { messageService.add(messageDto); failBecauseExceptionWasNotThrown(RuntimeException.class); } catch (RuntimeException e) { assertThat(e.getMessage()).isEqualTo("Messa...
@Transactional @Override public Message add(MessageDto messageDto) { int minlength = 3; if (messageDto.getName().length() < 3) { throw new RuntimeException(String.format("Message name should be at least %s characters long", minlength)); } if (repository.findByTypeAndName(messageDto.getType(), messageDto.getName()).isPr...
MessageServiceImpl implements MessageService { @Transactional @Override public Message add(MessageDto messageDto) { int minlength = 3; if (messageDto.getName().length() < 3) { throw new RuntimeException(String.format("Message name should be at least %s characters long", minlength)); } if (repository.findByTypeAndName(m...
MessageServiceImpl implements MessageService { @Transactional @Override public Message add(MessageDto messageDto) { int minlength = 3; if (messageDto.getName().length() < 3) { throw new RuntimeException(String.format("Message name should be at least %s characters long", minlength)); } if (repository.findByTypeAndName(m...
MessageServiceImpl implements MessageService { @Transactional @Override public Message add(MessageDto messageDto) { int minlength = 3; if (messageDto.getName().length() < 3) { throw new RuntimeException(String.format("Message name should be at least %s characters long", minlength)); } if (repository.findByTypeAndName(m...
MessageServiceImpl implements MessageService { @Transactional @Override public Message add(MessageDto messageDto) { int minlength = 3; if (messageDto.getName().length() < 3) { throw new RuntimeException(String.format("Message name should be at least %s characters long", minlength)); } if (repository.findByTypeAndName(m...
@Test void delete() { messageService.delete(message1.getType(), message1.getName()); verify(messageRepository).deleteByTypeAndName(message1.getType(), message1.getName()); }
@Transactional @Override public void delete(MessageType type, String name) { repository.deleteByTypeAndName(type, name); }
MessageServiceImpl implements MessageService { @Transactional @Override public void delete(MessageType type, String name) { repository.deleteByTypeAndName(type, name); } }
MessageServiceImpl implements MessageService { @Transactional @Override public void delete(MessageType type, String name) { repository.deleteByTypeAndName(type, name); } MessageServiceImpl(MessageRepository repository, ObjectMapper objectMapper); }
MessageServiceImpl implements MessageService { @Transactional @Override public void delete(MessageType type, String name) { repository.deleteByTypeAndName(type, name); } MessageServiceImpl(MessageRepository repository, ObjectMapper objectMapper); @Transactional(readOnly = true) @Override List<MessageDto> getMessagesByT...
MessageServiceImpl implements MessageService { @Transactional @Override public void delete(MessageType type, String name) { repository.deleteByTypeAndName(type, name); } MessageServiceImpl(MessageRepository repository, ObjectMapper objectMapper); @Transactional(readOnly = true) @Override List<MessageDto> getMessagesByT...
@Test void map() { final String tokenAddress = "dafsd"; final String symbol = "ZRX"; final BigDecimal rawBalance = new BigDecimal("1000000000000000000"); final int decimals = 18; final TokenInfoDto tokenInfoDto = TokenInfoDto.builder().address(tokenAddress).symbol(symbol).decimals(decimals).build(); when(tokenInfoServi...
public TokenValueDto map(final String tokenAddress, final BigDecimal rawBalance) { final TokenInfoDto tokenInfo = tokenInfoService.getTokenInfo(tokenAddress); return tokenInfo == null ? null : TokenValueDto.builder() .tokenAddress(tokenInfo.getAddress()) .tokenSymbol(tokenInfo.getSymbol()) .totalAmount(fromWei(rawBalan...
TokenValueMapper { public TokenValueDto map(final String tokenAddress, final BigDecimal rawBalance) { final TokenInfoDto tokenInfo = tokenInfoService.getTokenInfo(tokenAddress); return tokenInfo == null ? null : TokenValueDto.builder() .tokenAddress(tokenInfo.getAddress()) .tokenSymbol(tokenInfo.getSymbol()) .totalAmou...
TokenValueMapper { public TokenValueDto map(final String tokenAddress, final BigDecimal rawBalance) { final TokenInfoDto tokenInfo = tokenInfoService.getTokenInfo(tokenAddress); return tokenInfo == null ? null : TokenValueDto.builder() .tokenAddress(tokenInfo.getAddress()) .tokenSymbol(tokenInfo.getSymbol()) .totalAmou...
TokenValueMapper { public TokenValueDto map(final String tokenAddress, final BigDecimal rawBalance) { final TokenInfoDto tokenInfo = tokenInfoService.getTokenInfo(tokenAddress); return tokenInfo == null ? null : TokenValueDto.builder() .tokenAddress(tokenInfo.getAddress()) .tokenSymbol(tokenInfo.getSymbol()) .totalAmou...
TokenValueMapper { public TokenValueDto map(final String tokenAddress, final BigDecimal rawBalance) { final TokenInfoDto tokenInfo = tokenInfoService.getTokenInfo(tokenAddress); return tokenInfo == null ? null : TokenValueDto.builder() .tokenAddress(tokenInfo.getAddress()) .tokenSymbol(tokenInfo.getSymbol()) .totalAmou...
@Test public void isVerifiedEtherAddress_attribute_not_present() { final UserRepresentation userRepresentation = mock(UserRepresentation.class); final Map<String, List<String>> userAttributes = new HashMap<>(); userAttributes.put("djghfh", new ArrayList<>()); when(userRepresentation.getAttributes()).thenReturn(userAttr...
@Override public boolean isEtherAddressVerified(final UserRepresentation userRepresentation) { return "true".equalsIgnoreCase(getAttribute(userRepresentation, ETHER_ADDRESS_VERIFIED_KEY)); }
KeycloakRepositoryImpl implements KeycloakRepository { @Override public boolean isEtherAddressVerified(final UserRepresentation userRepresentation) { return "true".equalsIgnoreCase(getAttribute(userRepresentation, ETHER_ADDRESS_VERIFIED_KEY)); } }
KeycloakRepositoryImpl implements KeycloakRepository { @Override public boolean isEtherAddressVerified(final UserRepresentation userRepresentation) { return "true".equalsIgnoreCase(getAttribute(userRepresentation, ETHER_ADDRESS_VERIFIED_KEY)); } KeycloakRepositoryImpl(RealmResource resource, @Value("${keycloak.auth-ser...
KeycloakRepositoryImpl implements KeycloakRepository { @Override public boolean isEtherAddressVerified(final UserRepresentation userRepresentation) { return "true".equalsIgnoreCase(getAttribute(userRepresentation, ETHER_ADDRESS_VERIFIED_KEY)); } KeycloakRepositoryImpl(RealmResource resource, @Value("${keycloak.auth-ser...
KeycloakRepositoryImpl implements KeycloakRepository { @Override public boolean isEtherAddressVerified(final UserRepresentation userRepresentation) { return "true".equalsIgnoreCase(getAttribute(userRepresentation, ETHER_ADDRESS_VERIFIED_KEY)); } KeycloakRepositoryImpl(RealmResource resource, @Value("${keycloak.auth-ser...
@Test void map_tokenInfoNull() { final String tokenAddress = "dafsd"; when(tokenInfoService.getTokenInfo(tokenAddress)).thenReturn(null); final TokenValueDto result = mapper.map(tokenAddress, new BigDecimal("1000000000000000000")); assertThat(result).isNull(); }
public TokenValueDto map(final String tokenAddress, final BigDecimal rawBalance) { final TokenInfoDto tokenInfo = tokenInfoService.getTokenInfo(tokenAddress); return tokenInfo == null ? null : TokenValueDto.builder() .tokenAddress(tokenInfo.getAddress()) .tokenSymbol(tokenInfo.getSymbol()) .totalAmount(fromWei(rawBalan...
TokenValueMapper { public TokenValueDto map(final String tokenAddress, final BigDecimal rawBalance) { final TokenInfoDto tokenInfo = tokenInfoService.getTokenInfo(tokenAddress); return tokenInfo == null ? null : TokenValueDto.builder() .tokenAddress(tokenInfo.getAddress()) .tokenSymbol(tokenInfo.getSymbol()) .totalAmou...
TokenValueMapper { public TokenValueDto map(final String tokenAddress, final BigDecimal rawBalance) { final TokenInfoDto tokenInfo = tokenInfoService.getTokenInfo(tokenAddress); return tokenInfo == null ? null : TokenValueDto.builder() .tokenAddress(tokenInfo.getAddress()) .tokenSymbol(tokenInfo.getSymbol()) .totalAmou...
TokenValueMapper { public TokenValueDto map(final String tokenAddress, final BigDecimal rawBalance) { final TokenInfoDto tokenInfo = tokenInfoService.getTokenInfo(tokenAddress); return tokenInfo == null ? null : TokenValueDto.builder() .tokenAddress(tokenInfo.getAddress()) .tokenSymbol(tokenInfo.getSymbol()) .totalAmou...
TokenValueMapper { public TokenValueDto map(final String tokenAddress, final BigDecimal rawBalance) { final TokenInfoDto tokenInfo = tokenInfoService.getTokenInfo(tokenAddress); return tokenInfo == null ? null : TokenValueDto.builder() .tokenAddress(tokenInfo.getAddress()) .tokenSymbol(tokenInfo.getSymbol()) .totalAmou...
@Test public void getLoggedInUser_present() { final Authentication expected = mock(Authentication.class); when(securityContextHolder.getContext().getAuthentication()).thenReturn(expected); final Optional<Authentication> loggedInUser = securityContextService.getLoggedInUser(); assertThat(loggedInUser).containsSame(expec...
@Override public Optional<Authentication> getLoggedInUser() { return Optional.ofNullable(securityContextHolder.getContext().getAuthentication()); }
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<Authentication> getLoggedInUser() { return Optional.ofNullable(securityContextHolder.getContext().getAuthentication()); } }
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<Authentication> getLoggedInUser() { return Optional.ofNullable(securityContextHolder.getContext().getAuthentication()); } SecurityContextServiceImpl(final SecurityContextHolderSpringDelegate securityContextHolder, final ProfileServ...
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<Authentication> getLoggedInUser() { return Optional.ofNullable(securityContextHolder.getContext().getAuthentication()); } SecurityContextServiceImpl(final SecurityContextHolderSpringDelegate securityContextHolder, final ProfileServ...
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<Authentication> getLoggedInUser() { return Optional.ofNullable(securityContextHolder.getContext().getAuthentication()); } SecurityContextServiceImpl(final SecurityContextHolderSpringDelegate securityContextHolder, final ProfileServ...
@Test public void getLoggedInUser_notPresent() { when(securityContextHolder.getContext().getAuthentication()).thenReturn(null); final Optional<Authentication> loggedInUser = securityContextService.getLoggedInUser(); assertThat(loggedInUser).isEmpty(); }
@Override public Optional<Authentication> getLoggedInUser() { return Optional.ofNullable(securityContextHolder.getContext().getAuthentication()); }
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<Authentication> getLoggedInUser() { return Optional.ofNullable(securityContextHolder.getContext().getAuthentication()); } }
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<Authentication> getLoggedInUser() { return Optional.ofNullable(securityContextHolder.getContext().getAuthentication()); } SecurityContextServiceImpl(final SecurityContextHolderSpringDelegate securityContextHolder, final ProfileServ...
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<Authentication> getLoggedInUser() { return Optional.ofNullable(securityContextHolder.getContext().getAuthentication()); } SecurityContextServiceImpl(final SecurityContextHolderSpringDelegate securityContextHolder, final ProfileServ...
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<Authentication> getLoggedInUser() { return Optional.ofNullable(securityContextHolder.getContext().getAuthentication()); } SecurityContextServiceImpl(final SecurityContextHolderSpringDelegate securityContextHolder, final ProfileServ...
@Test public void isUserFullyAuthenticated() { final Authentication authentication = mock(Authentication.class); when(authentication.isAuthenticated()).thenReturn(true); when(securityContextHolder.getContext().getAuthentication()).thenReturn(authentication); final boolean result = securityContextService.isUserFullyAuth...
@Override public boolean isUserFullyAuthenticated() { return isUserFullyAuthenticated(securityContextHolder.getContext().getAuthentication()); }
SecurityContextServiceImpl implements SecurityContextService { @Override public boolean isUserFullyAuthenticated() { return isUserFullyAuthenticated(securityContextHolder.getContext().getAuthentication()); } }
SecurityContextServiceImpl implements SecurityContextService { @Override public boolean isUserFullyAuthenticated() { return isUserFullyAuthenticated(securityContextHolder.getContext().getAuthentication()); } SecurityContextServiceImpl(final SecurityContextHolderSpringDelegate securityContextHolder, final ProfileService...
SecurityContextServiceImpl implements SecurityContextService { @Override public boolean isUserFullyAuthenticated() { return isUserFullyAuthenticated(securityContextHolder.getContext().getAuthentication()); } SecurityContextServiceImpl(final SecurityContextHolderSpringDelegate securityContextHolder, final ProfileService...
SecurityContextServiceImpl implements SecurityContextService { @Override public boolean isUserFullyAuthenticated() { return isUserFullyAuthenticated(securityContextHolder.getContext().getAuthentication()); } SecurityContextServiceImpl(final SecurityContextHolderSpringDelegate securityContextHolder, final ProfileService...
@Test public void isUserFullyAuthenticated_noAuthentication() { when(securityContextHolder.getContext().getAuthentication()).thenReturn(null); final boolean result = securityContextService.isUserFullyAuthenticated(); assertThat(result).isFalse(); }
@Override public boolean isUserFullyAuthenticated() { return isUserFullyAuthenticated(securityContextHolder.getContext().getAuthentication()); }
SecurityContextServiceImpl implements SecurityContextService { @Override public boolean isUserFullyAuthenticated() { return isUserFullyAuthenticated(securityContextHolder.getContext().getAuthentication()); } }
SecurityContextServiceImpl implements SecurityContextService { @Override public boolean isUserFullyAuthenticated() { return isUserFullyAuthenticated(securityContextHolder.getContext().getAuthentication()); } SecurityContextServiceImpl(final SecurityContextHolderSpringDelegate securityContextHolder, final ProfileService...
SecurityContextServiceImpl implements SecurityContextService { @Override public boolean isUserFullyAuthenticated() { return isUserFullyAuthenticated(securityContextHolder.getContext().getAuthentication()); } SecurityContextServiceImpl(final SecurityContextHolderSpringDelegate securityContextHolder, final ProfileService...
SecurityContextServiceImpl implements SecurityContextService { @Override public boolean isUserFullyAuthenticated() { return isUserFullyAuthenticated(securityContextHolder.getContext().getAuthentication()); } SecurityContextServiceImpl(final SecurityContextHolderSpringDelegate securityContextHolder, final ProfileService...
@Test public void isUserFullyAuthenticated_notAuthentciated() { final Authentication authentication = mock(Authentication.class); when(authentication.isAuthenticated()).thenReturn(false); when(securityContextHolder.getContext().getAuthentication()).thenReturn(authentication); final boolean result = securityContextServi...
@Override public boolean isUserFullyAuthenticated() { return isUserFullyAuthenticated(securityContextHolder.getContext().getAuthentication()); }
SecurityContextServiceImpl implements SecurityContextService { @Override public boolean isUserFullyAuthenticated() { return isUserFullyAuthenticated(securityContextHolder.getContext().getAuthentication()); } }
SecurityContextServiceImpl implements SecurityContextService { @Override public boolean isUserFullyAuthenticated() { return isUserFullyAuthenticated(securityContextHolder.getContext().getAuthentication()); } SecurityContextServiceImpl(final SecurityContextHolderSpringDelegate securityContextHolder, final ProfileService...
SecurityContextServiceImpl implements SecurityContextService { @Override public boolean isUserFullyAuthenticated() { return isUserFullyAuthenticated(securityContextHolder.getContext().getAuthentication()); } SecurityContextServiceImpl(final SecurityContextHolderSpringDelegate securityContextHolder, final ProfileService...
SecurityContextServiceImpl implements SecurityContextService { @Override public boolean isUserFullyAuthenticated() { return isUserFullyAuthenticated(securityContextHolder.getContext().getAuthentication()); } SecurityContextServiceImpl(final SecurityContextHolderSpringDelegate securityContextHolder, final ProfileService...
@Test public void isUserFullyAuthenticated_AnonymousAuthenticationToken() { final Authentication authentication = spy(new AnonymousAuthenticationToken("dssg", "htesn", Arrays.asList((GrantedAuthority) () -> "dhfgj", (GrantedAuthority) () -> "dhfc"))); when(authentication.isAuthenticated()).thenReturn(true); when(securi...
@Override public boolean isUserFullyAuthenticated() { return isUserFullyAuthenticated(securityContextHolder.getContext().getAuthentication()); }
SecurityContextServiceImpl implements SecurityContextService { @Override public boolean isUserFullyAuthenticated() { return isUserFullyAuthenticated(securityContextHolder.getContext().getAuthentication()); } }
SecurityContextServiceImpl implements SecurityContextService { @Override public boolean isUserFullyAuthenticated() { return isUserFullyAuthenticated(securityContextHolder.getContext().getAuthentication()); } SecurityContextServiceImpl(final SecurityContextHolderSpringDelegate securityContextHolder, final ProfileService...
SecurityContextServiceImpl implements SecurityContextService { @Override public boolean isUserFullyAuthenticated() { return isUserFullyAuthenticated(securityContextHolder.getContext().getAuthentication()); } SecurityContextServiceImpl(final SecurityContextHolderSpringDelegate securityContextHolder, final ProfileService...
SecurityContextServiceImpl implements SecurityContextService { @Override public boolean isUserFullyAuthenticated() { return isUserFullyAuthenticated(securityContextHolder.getContext().getAuthentication()); } SecurityContextServiceImpl(final SecurityContextHolderSpringDelegate securityContextHolder, final ProfileService...
@Test public void getLoggedInUserProfile() { final Authentication authentication = mock(Authentication.class); final String userId = "fdsgzdg"; final Principal principal = mock(Principal.class); final UserProfile userProfile = mock(UserProfile.class); when(authentication.isAuthenticated()).thenReturn(true); when(authen...
@Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); }
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } }
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } SecurityContextServic...
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } SecurityContextServic...
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } SecurityContextServic...
@Test public void getLoggedInUserProfile_noPrincipal() { final Authentication authentication = mock(Authentication.class); final String userId = "fdsgzdg"; when(authentication.isAuthenticated()).thenReturn(true); when(authentication.getPrincipal()).thenReturn(null); when(securityContextHolder.getContext().getAuthentica...
@Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); }
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } }
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } SecurityContextServic...
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } SecurityContextServic...
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } SecurityContextServic...
@Test public void getLoggedInUserProfile_noUserProfile() { final Authentication authentication = mock(Authentication.class); final String userId = "fdsgzdg"; final Principal principal = mock(Principal.class); when(authentication.isAuthenticated()).thenReturn(true); when(authentication.getPrincipal()).thenReturn(princip...
@Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); }
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } }
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } SecurityContextServic...
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } SecurityContextServic...
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } SecurityContextServic...
@Test public void isVerifiedEtherAddress_attributes_empty() { final UserRepresentation userRepresentation = mock(UserRepresentation.class); final Map<String, List<String>> userAttributes = new HashMap<>(); when(userRepresentation.getAttributes()).thenReturn(userAttributes); final boolean result = keycloakRepository.isE...
@Override public boolean isEtherAddressVerified(final UserRepresentation userRepresentation) { return "true".equalsIgnoreCase(getAttribute(userRepresentation, ETHER_ADDRESS_VERIFIED_KEY)); }
KeycloakRepositoryImpl implements KeycloakRepository { @Override public boolean isEtherAddressVerified(final UserRepresentation userRepresentation) { return "true".equalsIgnoreCase(getAttribute(userRepresentation, ETHER_ADDRESS_VERIFIED_KEY)); } }
KeycloakRepositoryImpl implements KeycloakRepository { @Override public boolean isEtherAddressVerified(final UserRepresentation userRepresentation) { return "true".equalsIgnoreCase(getAttribute(userRepresentation, ETHER_ADDRESS_VERIFIED_KEY)); } KeycloakRepositoryImpl(RealmResource resource, @Value("${keycloak.auth-ser...
KeycloakRepositoryImpl implements KeycloakRepository { @Override public boolean isEtherAddressVerified(final UserRepresentation userRepresentation) { return "true".equalsIgnoreCase(getAttribute(userRepresentation, ETHER_ADDRESS_VERIFIED_KEY)); } KeycloakRepositoryImpl(RealmResource resource, @Value("${keycloak.auth-ser...
KeycloakRepositoryImpl implements KeycloakRepository { @Override public boolean isEtherAddressVerified(final UserRepresentation userRepresentation) { return "true".equalsIgnoreCase(getAttribute(userRepresentation, ETHER_ADDRESS_VERIFIED_KEY)); } KeycloakRepositoryImpl(RealmResource resource, @Value("${keycloak.auth-ser...
@Test public void getLoggedInUserProfile_noAuthentication() { when(securityContextHolder.getContext().getAuthentication()).thenReturn(null); final Optional<UserProfile> result = securityContextService.getLoggedInUserProfile(); assertThat(result).isEmpty(); }
@Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); }
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } }
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } SecurityContextServic...
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } SecurityContextServic...
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } SecurityContextServic...
@Test public void getLoggedInUserProfile_notAuthentciated() { final Authentication authentication = mock(Authentication.class); when(authentication.isAuthenticated()).thenReturn(false); when(securityContextHolder.getContext().getAuthentication()).thenReturn(authentication); final Optional<UserProfile> result = security...
@Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); }
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } }
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } SecurityContextServic...
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } SecurityContextServic...
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } SecurityContextServic...
@Test public void getLoggedInUserProfile_AnonymousAuthenticationToken() { final Authentication authentication = spy(new AnonymousAuthenticationToken("dssg", "htesn", Arrays.asList((GrantedAuthority) () -> "dhfgj", (GrantedAuthority) () -> "dhfc"))); when(authentication.isAuthenticated()).thenReturn(true); when(security...
@Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); }
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } }
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } SecurityContextServic...
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } SecurityContextServic...
SecurityContextServiceImpl implements SecurityContextService { @Override public Optional<UserProfile> getLoggedInUserProfile() { return getLoggedInUser().filter(this::isUserFullyAuthenticated) .map(authentication -> (Principal) authentication.getPrincipal()) .map(profileService::getUserProfile); } SecurityContextServic...
@Test public void illegalNotGithub() throws Exception { assertThat( validator.isValid("https: ).isFalse(); }
public boolean isValid(String link, ConstraintValidatorContext context) { return StringUtils.isEmpty(link) || link.matches(regex); }
GithubLinkValidator implements ConstraintValidator<GithubLink, String> { public boolean isValid(String link, ConstraintValidatorContext context) { return StringUtils.isEmpty(link) || link.matches(regex); } }
GithubLinkValidator implements ConstraintValidator<GithubLink, String> { public boolean isValid(String link, ConstraintValidatorContext context) { return StringUtils.isEmpty(link) || link.matches(regex); } GithubLinkValidator(); }
GithubLinkValidator implements ConstraintValidator<GithubLink, String> { public boolean isValid(String link, ConstraintValidatorContext context) { return StringUtils.isEmpty(link) || link.matches(regex); } GithubLinkValidator(); void initialize(GithubLink constraint); boolean isValid(String link, ConstraintValidatorCon...
GithubLinkValidator implements ConstraintValidator<GithubLink, String> { public boolean isValid(String link, ConstraintValidatorContext context) { return StringUtils.isEmpty(link) || link.matches(regex); } GithubLinkValidator(); void initialize(GithubLink constraint); boolean isValid(String link, ConstraintValidatorCon...
@Test public void illegalInvalidGithub() throws Exception { assertThat( validator.isValid("https: ).isFalse(); }
public boolean isValid(String link, ConstraintValidatorContext context) { return StringUtils.isEmpty(link) || link.matches(regex); }
GithubLinkValidator implements ConstraintValidator<GithubLink, String> { public boolean isValid(String link, ConstraintValidatorContext context) { return StringUtils.isEmpty(link) || link.matches(regex); } }
GithubLinkValidator implements ConstraintValidator<GithubLink, String> { public boolean isValid(String link, ConstraintValidatorContext context) { return StringUtils.isEmpty(link) || link.matches(regex); } GithubLinkValidator(); }
GithubLinkValidator implements ConstraintValidator<GithubLink, String> { public boolean isValid(String link, ConstraintValidatorContext context) { return StringUtils.isEmpty(link) || link.matches(regex); } GithubLinkValidator(); void initialize(GithubLink constraint); boolean isValid(String link, ConstraintValidatorCon...
GithubLinkValidator implements ConstraintValidator<GithubLink, String> { public boolean isValid(String link, ConstraintValidatorContext context) { return StringUtils.isEmpty(link) || link.matches(regex); } GithubLinkValidator(); void initialize(GithubLink constraint); boolean isValid(String link, ConstraintValidatorCon...
@Test public void validGithubLink() throws Exception { assertThat( validator.isValid("https: ).isTrue(); }
public boolean isValid(String link, ConstraintValidatorContext context) { return StringUtils.isEmpty(link) || link.matches(regex); }
GithubLinkValidator implements ConstraintValidator<GithubLink, String> { public boolean isValid(String link, ConstraintValidatorContext context) { return StringUtils.isEmpty(link) || link.matches(regex); } }
GithubLinkValidator implements ConstraintValidator<GithubLink, String> { public boolean isValid(String link, ConstraintValidatorContext context) { return StringUtils.isEmpty(link) || link.matches(regex); } GithubLinkValidator(); }
GithubLinkValidator implements ConstraintValidator<GithubLink, String> { public boolean isValid(String link, ConstraintValidatorContext context) { return StringUtils.isEmpty(link) || link.matches(regex); } GithubLinkValidator(); void initialize(GithubLink constraint); boolean isValid(String link, ConstraintValidatorCon...
GithubLinkValidator implements ConstraintValidator<GithubLink, String> { public boolean isValid(String link, ConstraintValidatorContext context) { return StringUtils.isEmpty(link) || link.matches(regex); } GithubLinkValidator(); void initialize(GithubLink constraint); boolean isValid(String link, ConstraintValidatorCon...
@Test public void statisticsReturnsTotalAvailableFunding() { TokenAmountDto tokenAmount = new TokenAmountDto(fnd.getAddress(), EthUtil.toWei(BigDecimal.TEN, fnd.getDecimals())); TokenAmountDto tokenAmount2 = new TokenAmountDto(zrx.getAddress(), EthUtil.toWei(BigDecimal.ONE, zrx.getDecimals())); when(fundRepository.getA...
@Transactional(readOnly = true) @Override @Cacheable(value = "statistics", key = "'all'") public StatisticsDto getStatistics() { double totalAvailableFunding = fundRepository.getAmountPerTokenWhereRequestHasStatusFunded() .stream() .mapToDouble(this::mapToUsd) .sum(); String mostFundedProject = getMostFunded(fundReposi...
StatisticsServiceImpl implements StatisticsService { @Transactional(readOnly = true) @Override @Cacheable(value = "statistics", key = "'all'") public StatisticsDto getStatistics() { double totalAvailableFunding = fundRepository.getAmountPerTokenWhereRequestHasStatusFunded() .stream() .mapToDouble(this::mapToUsd) .sum()...
StatisticsServiceImpl implements StatisticsService { @Transactional(readOnly = true) @Override @Cacheable(value = "statistics", key = "'all'") public StatisticsDto getStatistics() { double totalAvailableFunding = fundRepository.getAmountPerTokenWhereRequestHasStatusFunded() .stream() .mapToDouble(this::mapToUsd) .sum()...
StatisticsServiceImpl implements StatisticsService { @Transactional(readOnly = true) @Override @Cacheable(value = "statistics", key = "'all'") public StatisticsDto getStatistics() { double totalAvailableFunding = fundRepository.getAmountPerTokenWhereRequestHasStatusFunded() .stream() .mapToDouble(this::mapToUsd) .sum()...
StatisticsServiceImpl implements StatisticsService { @Transactional(readOnly = true) @Override @Cacheable(value = "statistics", key = "'all'") public StatisticsDto getStatistics() { double totalAvailableFunding = fundRepository.getAmountPerTokenWhereRequestHasStatusFunded() .stream() .mapToDouble(this::mapToUsd) .sum()...
@Test public void statisticsReturnsMostFundedProject() { TokenAmountDto tokenAmount = new TokenAmountDto(fnd.getAddress(), EthUtil.toWei(BigDecimal.TEN, fnd.getDecimals())); TokenAmountDto tokenAmount2 = new TokenAmountDto(zrx.getAddress(), EthUtil.toWei(BigDecimal.ONE, zrx.getDecimals())); List<Object[]> requests = Ar...
@Transactional(readOnly = true) @Override @Cacheable(value = "statistics", key = "'all'") public StatisticsDto getStatistics() { double totalAvailableFunding = fundRepository.getAmountPerTokenWhereRequestHasStatusFunded() .stream() .mapToDouble(this::mapToUsd) .sum(); String mostFundedProject = getMostFunded(fundReposi...
StatisticsServiceImpl implements StatisticsService { @Transactional(readOnly = true) @Override @Cacheable(value = "statistics", key = "'all'") public StatisticsDto getStatistics() { double totalAvailableFunding = fundRepository.getAmountPerTokenWhereRequestHasStatusFunded() .stream() .mapToDouble(this::mapToUsd) .sum()...
StatisticsServiceImpl implements StatisticsService { @Transactional(readOnly = true) @Override @Cacheable(value = "statistics", key = "'all'") public StatisticsDto getStatistics() { double totalAvailableFunding = fundRepository.getAmountPerTokenWhereRequestHasStatusFunded() .stream() .mapToDouble(this::mapToUsd) .sum()...
StatisticsServiceImpl implements StatisticsService { @Transactional(readOnly = true) @Override @Cacheable(value = "statistics", key = "'all'") public StatisticsDto getStatistics() { double totalAvailableFunding = fundRepository.getAmountPerTokenWhereRequestHasStatusFunded() .stream() .mapToDouble(this::mapToUsd) .sum()...
StatisticsServiceImpl implements StatisticsService { @Transactional(readOnly = true) @Override @Cacheable(value = "statistics", key = "'all'") public StatisticsDto getStatistics() { double totalAvailableFunding = fundRepository.getAmountPerTokenWhereRequestHasStatusFunded() .stream() .mapToDouble(this::mapToUsd) .sum()...
@Test public void statisticsReturnsMostFundedTechnology() { TokenAmountDto tokenAmount = new TokenAmountDto(fnd.getAddress(), EthUtil.toWei(BigDecimal.TEN, fnd.getDecimals())); TokenAmountDto tokenAmount2 = new TokenAmountDto(zrx.getAddress(), EthUtil.toWei(BigDecimal.ONE, zrx.getDecimals())); List<Object[]> requests =...
@Transactional(readOnly = true) @Override @Cacheable(value = "statistics", key = "'all'") public StatisticsDto getStatistics() { double totalAvailableFunding = fundRepository.getAmountPerTokenWhereRequestHasStatusFunded() .stream() .mapToDouble(this::mapToUsd) .sum(); String mostFundedProject = getMostFunded(fundReposi...
StatisticsServiceImpl implements StatisticsService { @Transactional(readOnly = true) @Override @Cacheable(value = "statistics", key = "'all'") public StatisticsDto getStatistics() { double totalAvailableFunding = fundRepository.getAmountPerTokenWhereRequestHasStatusFunded() .stream() .mapToDouble(this::mapToUsd) .sum()...
StatisticsServiceImpl implements StatisticsService { @Transactional(readOnly = true) @Override @Cacheable(value = "statistics", key = "'all'") public StatisticsDto getStatistics() { double totalAvailableFunding = fundRepository.getAmountPerTokenWhereRequestHasStatusFunded() .stream() .mapToDouble(this::mapToUsd) .sum()...
StatisticsServiceImpl implements StatisticsService { @Transactional(readOnly = true) @Override @Cacheable(value = "statistics", key = "'all'") public StatisticsDto getStatistics() { double totalAvailableFunding = fundRepository.getAmountPerTokenWhereRequestHasStatusFunded() .stream() .mapToDouble(this::mapToUsd) .sum()...
StatisticsServiceImpl implements StatisticsService { @Transactional(readOnly = true) @Override @Cacheable(value = "statistics", key = "'all'") public StatisticsDto getStatistics() { double totalAvailableFunding = fundRepository.getAmountPerTokenWhereRequestHasStatusFunded() .stream() .mapToDouble(this::mapToUsd) .sum()...
@Test public void map() { final RequestClaim requestClaim = RequestClaim.builder() .id(657L) .address("0xE51551D3B11eF7559164D051D9714E59A1c4E486") .status(ClaimRequestStatus.PENDING) .flagged(false) .requestId(9L) .solver("ghjgfhg") .build(); final RequestClaimDto requestClaimDto = new RequestClaimDto(); final Request...
@Override public RequestClaimDto map(RequestClaim r) { RequestClaimDto dto = delegate.map(r); if (dto != null) { RequestDto request = requestService.findRequest(r.getRequestId()); dto.setUrl(createLink(request.getIssueInformation())); dto.setTitle(request.getIssueInformation().getTitle()); dto.setFundRequestUrl(createF...
RequestClaimDtoDecorator implements RequestClaimDtoMapper { @Override public RequestClaimDto map(RequestClaim r) { RequestClaimDto dto = delegate.map(r); if (dto != null) { RequestDto request = requestService.findRequest(r.getRequestId()); dto.setUrl(createLink(request.getIssueInformation())); dto.setTitle(request.getI...
RequestClaimDtoDecorator implements RequestClaimDtoMapper { @Override public RequestClaimDto map(RequestClaim r) { RequestClaimDto dto = delegate.map(r); if (dto != null) { RequestDto request = requestService.findRequest(r.getRequestId()); dto.setUrl(createLink(request.getIssueInformation())); dto.setTitle(request.getI...
RequestClaimDtoDecorator implements RequestClaimDtoMapper { @Override public RequestClaimDto map(RequestClaim r) { RequestClaimDto dto = delegate.map(r); if (dto != null) { RequestDto request = requestService.findRequest(r.getRequestId()); dto.setUrl(createLink(request.getIssueInformation())); dto.setTitle(request.getI...
RequestClaimDtoDecorator implements RequestClaimDtoMapper { @Override public RequestClaimDto map(RequestClaim r) { RequestClaimDto dto = delegate.map(r); if (dto != null) { RequestDto request = requestService.findRequest(r.getRequestId()); dto.setUrl(createLink(request.getIssueInformation())); dto.setTitle(request.getI...
@Test public void isVerifiedEtherAddress_attributes_null() { final UserRepresentation userRepresentation = mock(UserRepresentation.class); final Map<String, List<String>> userAttributes = null; when(userRepresentation.getAttributes()).thenReturn(userAttributes); final boolean result = keycloakRepository.isEtherAddressV...
@Override public boolean isEtherAddressVerified(final UserRepresentation userRepresentation) { return "true".equalsIgnoreCase(getAttribute(userRepresentation, ETHER_ADDRESS_VERIFIED_KEY)); }
KeycloakRepositoryImpl implements KeycloakRepository { @Override public boolean isEtherAddressVerified(final UserRepresentation userRepresentation) { return "true".equalsIgnoreCase(getAttribute(userRepresentation, ETHER_ADDRESS_VERIFIED_KEY)); } }
KeycloakRepositoryImpl implements KeycloakRepository { @Override public boolean isEtherAddressVerified(final UserRepresentation userRepresentation) { return "true".equalsIgnoreCase(getAttribute(userRepresentation, ETHER_ADDRESS_VERIFIED_KEY)); } KeycloakRepositoryImpl(RealmResource resource, @Value("${keycloak.auth-ser...
KeycloakRepositoryImpl implements KeycloakRepository { @Override public boolean isEtherAddressVerified(final UserRepresentation userRepresentation) { return "true".equalsIgnoreCase(getAttribute(userRepresentation, ETHER_ADDRESS_VERIFIED_KEY)); } KeycloakRepositoryImpl(RealmResource resource, @Value("${keycloak.auth-ser...
KeycloakRepositoryImpl implements KeycloakRepository { @Override public boolean isEtherAddressVerified(final UserRepresentation userRepresentation) { return "true".equalsIgnoreCase(getAttribute(userRepresentation, ETHER_ADDRESS_VERIFIED_KEY)); } KeycloakRepositoryImpl(RealmResource resource, @Value("${keycloak.auth-ser...
@Test public void map_null() { final RequestClaim requestClaim = RequestClaim.builder() .id(657L) .address("0xE51551D3B11eF7559164D051D9714E59A1c4E486") .status(ClaimRequestStatus.PENDING) .flagged(false) .requestId(9L) .solver("ghjgfhg") .build(); when(delegate.map(requestClaim)).thenReturn(null); final RequestClaimDt...
@Override public RequestClaimDto map(RequestClaim r) { RequestClaimDto dto = delegate.map(r); if (dto != null) { RequestDto request = requestService.findRequest(r.getRequestId()); dto.setUrl(createLink(request.getIssueInformation())); dto.setTitle(request.getIssueInformation().getTitle()); dto.setFundRequestUrl(createF...
RequestClaimDtoDecorator implements RequestClaimDtoMapper { @Override public RequestClaimDto map(RequestClaim r) { RequestClaimDto dto = delegate.map(r); if (dto != null) { RequestDto request = requestService.findRequest(r.getRequestId()); dto.setUrl(createLink(request.getIssueInformation())); dto.setTitle(request.getI...
RequestClaimDtoDecorator implements RequestClaimDtoMapper { @Override public RequestClaimDto map(RequestClaim r) { RequestClaimDto dto = delegate.map(r); if (dto != null) { RequestDto request = requestService.findRequest(r.getRequestId()); dto.setUrl(createLink(request.getIssueInformation())); dto.setTitle(request.getI...
RequestClaimDtoDecorator implements RequestClaimDtoMapper { @Override public RequestClaimDto map(RequestClaim r) { RequestClaimDto dto = delegate.map(r); if (dto != null) { RequestDto request = requestService.findRequest(r.getRequestId()); dto.setUrl(createLink(request.getIssueInformation())); dto.setTitle(request.getI...
RequestClaimDtoDecorator implements RequestClaimDtoMapper { @Override public RequestClaimDto map(RequestClaim r) { RequestClaimDto dto = delegate.map(r); if (dto != null) { RequestDto request = requestService.findRequest(r.getRequestId()); dto.setUrl(createLink(request.getIssueInformation())); dto.setTitle(request.getI...
@Test void map() { final long blockchainEventId = 465L; final Claim claim = Claim.builder().blockchainEventId(blockchainEventId).build(); final String transactionHash = "rqwerwet"; when(delegate.map(claim)).thenReturn(new ClaimDto()); when(blockchainEventService.findOne(blockchainEventId)).thenReturn(Optional.of(Blockc...
@Override public ClaimDto map(Claim r) { final ClaimDto dto = delegate.map(r); if (dto != null) { dto.setTransactionHash(blockchainEventService.findOne(r.getBlockchainEventId()) .map(BlockchainEventDto::getTransactionHash) .orElse("")); } return dto; }
ClaimDtoMapperDecorator implements ClaimDtoMapper { @Override public ClaimDto map(Claim r) { final ClaimDto dto = delegate.map(r); if (dto != null) { dto.setTransactionHash(blockchainEventService.findOne(r.getBlockchainEventId()) .map(BlockchainEventDto::getTransactionHash) .orElse("")); } return dto; } }
ClaimDtoMapperDecorator implements ClaimDtoMapper { @Override public ClaimDto map(Claim r) { final ClaimDto dto = delegate.map(r); if (dto != null) { dto.setTransactionHash(blockchainEventService.findOne(r.getBlockchainEventId()) .map(BlockchainEventDto::getTransactionHash) .orElse("")); } return dto; } }
ClaimDtoMapperDecorator implements ClaimDtoMapper { @Override public ClaimDto map(Claim r) { final ClaimDto dto = delegate.map(r); if (dto != null) { dto.setTransactionHash(blockchainEventService.findOne(r.getBlockchainEventId()) .map(BlockchainEventDto::getTransactionHash) .orElse("")); } return dto; } @Override Clai...
ClaimDtoMapperDecorator implements ClaimDtoMapper { @Override public ClaimDto map(Claim r) { final ClaimDto dto = delegate.map(r); if (dto != null) { dto.setTransactionHash(blockchainEventService.findOne(r.getBlockchainEventId()) .map(BlockchainEventDto::getTransactionHash) .orElse("")); } return dto; } @Override Clai...
@Test void map_null() { when(delegate.map(null)).thenReturn(null); final ClaimDto result = decorator.map(null); assertThat(result).isNull(); }
@Override public ClaimDto map(Claim r) { final ClaimDto dto = delegate.map(r); if (dto != null) { dto.setTransactionHash(blockchainEventService.findOne(r.getBlockchainEventId()) .map(BlockchainEventDto::getTransactionHash) .orElse("")); } return dto; }
ClaimDtoMapperDecorator implements ClaimDtoMapper { @Override public ClaimDto map(Claim r) { final ClaimDto dto = delegate.map(r); if (dto != null) { dto.setTransactionHash(blockchainEventService.findOne(r.getBlockchainEventId()) .map(BlockchainEventDto::getTransactionHash) .orElse("")); } return dto; } }
ClaimDtoMapperDecorator implements ClaimDtoMapper { @Override public ClaimDto map(Claim r) { final ClaimDto dto = delegate.map(r); if (dto != null) { dto.setTransactionHash(blockchainEventService.findOne(r.getBlockchainEventId()) .map(BlockchainEventDto::getTransactionHash) .orElse("")); } return dto; } }
ClaimDtoMapperDecorator implements ClaimDtoMapper { @Override public ClaimDto map(Claim r) { final ClaimDto dto = delegate.map(r); if (dto != null) { dto.setTransactionHash(blockchainEventService.findOne(r.getBlockchainEventId()) .map(BlockchainEventDto::getTransactionHash) .orElse("")); } return dto; } @Override Clai...
ClaimDtoMapperDecorator implements ClaimDtoMapper { @Override public ClaimDto map(Claim r) { final ClaimDto dto = delegate.map(r); if (dto != null) { dto.setTransactionHash(blockchainEventService.findOne(r.getBlockchainEventId()) .map(BlockchainEventDto::getTransactionHash) .orElse("")); } return dto; } @Override Clai...
@Test void map_blockchainEventEmpty() { final long blockchainEventId = 465L; final Claim claim = Claim.builder().blockchainEventId(blockchainEventId).build(); when(delegate.map(claim)).thenReturn(new ClaimDto()); when(blockchainEventService.findOne(blockchainEventId)).thenReturn(Optional.empty()); final ClaimDto result...
@Override public ClaimDto map(Claim r) { final ClaimDto dto = delegate.map(r); if (dto != null) { dto.setTransactionHash(blockchainEventService.findOne(r.getBlockchainEventId()) .map(BlockchainEventDto::getTransactionHash) .orElse("")); } return dto; }
ClaimDtoMapperDecorator implements ClaimDtoMapper { @Override public ClaimDto map(Claim r) { final ClaimDto dto = delegate.map(r); if (dto != null) { dto.setTransactionHash(blockchainEventService.findOne(r.getBlockchainEventId()) .map(BlockchainEventDto::getTransactionHash) .orElse("")); } return dto; } }
ClaimDtoMapperDecorator implements ClaimDtoMapper { @Override public ClaimDto map(Claim r) { final ClaimDto dto = delegate.map(r); if (dto != null) { dto.setTransactionHash(blockchainEventService.findOne(r.getBlockchainEventId()) .map(BlockchainEventDto::getTransactionHash) .orElse("")); } return dto; } }
ClaimDtoMapperDecorator implements ClaimDtoMapper { @Override public ClaimDto map(Claim r) { final ClaimDto dto = delegate.map(r); if (dto != null) { dto.setTransactionHash(blockchainEventService.findOne(r.getBlockchainEventId()) .map(BlockchainEventDto::getTransactionHash) .orElse("")); } return dto; } @Override Clai...
ClaimDtoMapperDecorator implements ClaimDtoMapper { @Override public ClaimDto map(Claim r) { final ClaimDto dto = delegate.map(r); if (dto != null) { dto.setTransactionHash(blockchainEventService.findOne(r.getBlockchainEventId()) .map(BlockchainEventDto::getTransactionHash) .orElse("")); } return dto; } @Override Clai...
@Test public void findClaim() { final long claimId = 697L; final Claim claim = Claim.builder().build(); final ClaimDto expected = ClaimDtoMother.aClaimDto().build(); when(claimRepository.findOne(claimId)).thenReturn(Optional.of(claim)); when(mappers.map(eq(Claim.class), eq(ClaimDto.class), same(claim))).thenReturn(expe...
@Override @Transactional(readOnly = true) public Optional<ClaimDto> findOne(final Long id) { return claimRepository.findOne(id).map(claim -> mappers.map(Claim.class, ClaimDto.class, claim)); }
ClaimServiceImpl implements ClaimService { @Override @Transactional(readOnly = true) public Optional<ClaimDto> findOne(final Long id) { return claimRepository.findOne(id).map(claim -> mappers.map(Claim.class, ClaimDto.class, claim)); } }
ClaimServiceImpl implements ClaimService { @Override @Transactional(readOnly = true) public Optional<ClaimDto> findOne(final Long id) { return claimRepository.findOne(id).map(claim -> mappers.map(Claim.class, ClaimDto.class, claim)); } ClaimServiceImpl(final RequestRepository requestRepository, ...
ClaimServiceImpl implements ClaimService { @Override @Transactional(readOnly = true) public Optional<ClaimDto> findOne(final Long id) { return claimRepository.findOne(id).map(claim -> mappers.map(Claim.class, ClaimDto.class, claim)); } ClaimServiceImpl(final RequestRepository requestRepository, ...
ClaimServiceImpl implements ClaimService { @Override @Transactional(readOnly = true) public Optional<ClaimDto> findOne(final Long id) { return claimRepository.findOne(id).map(claim -> mappers.map(Claim.class, ClaimDto.class, claim)); } ClaimServiceImpl(final RequestRepository requestRepository, ...
@Test public void findClaim_notFound() { final long claimId = 697L; when(claimRepository.findOne(claimId)).thenReturn(Optional.empty()); final Optional<ClaimDto> result = claimService.findOne(claimId); assertThat(result).isEmpty(); }
@Override @Transactional(readOnly = true) public Optional<ClaimDto> findOne(final Long id) { return claimRepository.findOne(id).map(claim -> mappers.map(Claim.class, ClaimDto.class, claim)); }
ClaimServiceImpl implements ClaimService { @Override @Transactional(readOnly = true) public Optional<ClaimDto> findOne(final Long id) { return claimRepository.findOne(id).map(claim -> mappers.map(Claim.class, ClaimDto.class, claim)); } }
ClaimServiceImpl implements ClaimService { @Override @Transactional(readOnly = true) public Optional<ClaimDto> findOne(final Long id) { return claimRepository.findOne(id).map(claim -> mappers.map(Claim.class, ClaimDto.class, claim)); } ClaimServiceImpl(final RequestRepository requestRepository, ...
ClaimServiceImpl implements ClaimService { @Override @Transactional(readOnly = true) public Optional<ClaimDto> findOne(final Long id) { return claimRepository.findOne(id).map(claim -> mappers.map(Claim.class, ClaimDto.class, claim)); } ClaimServiceImpl(final RequestRepository requestRepository, ...
ClaimServiceImpl implements ClaimService { @Override @Transactional(readOnly = true) public Optional<ClaimDto> findOne(final Long id) { return claimRepository.findOne(id).map(claim -> mappers.map(Claim.class, ClaimDto.class, claim)); } ClaimServiceImpl(final RequestRepository requestRepository, ...
@Test public void claim() { Principal solver = PrincipalMother.davyvanroy(); UserClaimRequest userClaimRequest = UserClaimRequestMother.kazuki43zooApiStub().build(); Request request = RequestMother.freeCodeCampNoUserStories().build(); when(requestRepository.findByPlatformAndPlatformId(userClaimRequest.getPlatform(), us...
@Transactional @Override public void claim(Principal user, UserClaimRequest userClaimRequest) { Request request = requestRepository.findByPlatformAndPlatformId(userClaimRequest.getPlatform(), userClaimRequest.getPlatformId()) .orElseThrow(() -> new RuntimeException("Request not found")); RequestDto requestDto = mappers...
ClaimServiceImpl implements ClaimService { @Transactional @Override public void claim(Principal user, UserClaimRequest userClaimRequest) { Request request = requestRepository.findByPlatformAndPlatformId(userClaimRequest.getPlatform(), userClaimRequest.getPlatformId()) .orElseThrow(() -> new RuntimeException("Request no...
ClaimServiceImpl implements ClaimService { @Transactional @Override public void claim(Principal user, UserClaimRequest userClaimRequest) { Request request = requestRepository.findByPlatformAndPlatformId(userClaimRequest.getPlatform(), userClaimRequest.getPlatformId()) .orElseThrow(() -> new RuntimeException("Request no...
ClaimServiceImpl implements ClaimService { @Transactional @Override public void claim(Principal user, UserClaimRequest userClaimRequest) { Request request = requestRepository.findByPlatformAndPlatformId(userClaimRequest.getPlatform(), userClaimRequest.getPlatformId()) .orElseThrow(() -> new RuntimeException("Request no...
ClaimServiceImpl implements ClaimService { @Transactional @Override public void claim(Principal user, UserClaimRequest userClaimRequest) { Request request = requestRepository.findByPlatformAndPlatformId(userClaimRequest.getPlatform(), userClaimRequest.getPlatformId()) .orElseThrow(() -> new RuntimeException("Request no...
@Test public void getClaimedBy() { final long requestId = 567L; final List<Claim> claims = new ArrayList<>(); final List<ClaimDto> claimDtos = new ArrayList<>(); final Principal principal = mock(Principal.class); final ClaimsByTransactionAggregate claimsByTransactionAggregate = mock(ClaimsByTransactionAggregate.class);...
@Override @Transactional(readOnly = true) public ClaimsByTransactionAggregate getAggregatedClaimsForRequest(final long requestId) { return claimDtoAggregator.aggregateClaims(mappers.mapList(Claim.class, ClaimDto.class, claimRepository.findByRequestId(requestId))); }
ClaimServiceImpl implements ClaimService { @Override @Transactional(readOnly = true) public ClaimsByTransactionAggregate getAggregatedClaimsForRequest(final long requestId) { return claimDtoAggregator.aggregateClaims(mappers.mapList(Claim.class, ClaimDto.class, claimRepository.findByRequestId(requestId))); } }
ClaimServiceImpl implements ClaimService { @Override @Transactional(readOnly = true) public ClaimsByTransactionAggregate getAggregatedClaimsForRequest(final long requestId) { return claimDtoAggregator.aggregateClaims(mappers.mapList(Claim.class, ClaimDto.class, claimRepository.findByRequestId(requestId))); } ClaimServi...
ClaimServiceImpl implements ClaimService { @Override @Transactional(readOnly = true) public ClaimsByTransactionAggregate getAggregatedClaimsForRequest(final long requestId) { return claimDtoAggregator.aggregateClaims(mappers.mapList(Claim.class, ClaimDto.class, claimRepository.findByRequestId(requestId))); } ClaimServi...
ClaimServiceImpl implements ClaimService { @Override @Transactional(readOnly = true) public ClaimsByTransactionAggregate getAggregatedClaimsForRequest(final long requestId) { return claimDtoAggregator.aggregateClaims(mappers.mapList(Claim.class, ClaimDto.class, claimRepository.findByRequestId(requestId))); } ClaimServi...
@Test public void onClaimed() { long requestId = 3124L; final RequestDto requestDto = RequestDtoMother.fundRequestArea51(); requestDto.setId(requestId); final RequestClaim requestClaim1 = RequestClaim.builder().status(ClaimRequestStatus.PENDING).build(); final RequestClaim requestClaim2 = RequestClaim.builder().status(...
@EventListener public void onClaimed(final RequestClaimedEvent claimedEvent) { requestClaimRepository.findByRequestId(claimedEvent.getRequestDto().getId()) .forEach(requestClaim -> { requestClaim.setStatus(ClaimRequestStatus.PROCESSED); requestClaimRepository.save(requestClaim); }); }
ClaimServiceImpl implements ClaimService { @EventListener public void onClaimed(final RequestClaimedEvent claimedEvent) { requestClaimRepository.findByRequestId(claimedEvent.getRequestDto().getId()) .forEach(requestClaim -> { requestClaim.setStatus(ClaimRequestStatus.PROCESSED); requestClaimRepository.save(requestClaim...
ClaimServiceImpl implements ClaimService { @EventListener public void onClaimed(final RequestClaimedEvent claimedEvent) { requestClaimRepository.findByRequestId(claimedEvent.getRequestDto().getId()) .forEach(requestClaim -> { requestClaim.setStatus(ClaimRequestStatus.PROCESSED); requestClaimRepository.save(requestClaim...
ClaimServiceImpl implements ClaimService { @EventListener public void onClaimed(final RequestClaimedEvent claimedEvent) { requestClaimRepository.findByRequestId(claimedEvent.getRequestDto().getId()) .forEach(requestClaim -> { requestClaim.setStatus(ClaimRequestStatus.PROCESSED); requestClaimRepository.save(requestClaim...
ClaimServiceImpl implements ClaimService { @EventListener public void onClaimed(final RequestClaimedEvent claimedEvent) { requestClaimRepository.findByRequestId(claimedEvent.getRequestDto().getId()) .forEach(requestClaim -> { requestClaim.setStatus(ClaimRequestStatus.PROCESSED); requestClaimRepository.save(requestClaim...
@Test void aggregateClaims() { final String solver1 = "dgh"; final String solver2 = "hdxhg"; final TokenValueDto fndValue1 = FND().totalAmount(new BigDecimal("50")).build(); final TokenValueDto fndValue2 = FND().totalAmount(new BigDecimal("4.26")).build(); final TokenValueDto zrxValue1 = ZRX().totalAmount(new BigDecima...
ClaimsByTransactionAggregate aggregateClaims(final List<ClaimDto> claims) { TokenValueDto totalFndValue = null; TokenValueDto totalOtherValue = null; final Map<String, ClaimByTransactionAggregate.Builder> claimsPerTransaction = new HashMap<>(); for (final ClaimDto claim : claims) { final ClaimByTransactionAggregate.Bui...
ClaimDtoAggregator { ClaimsByTransactionAggregate aggregateClaims(final List<ClaimDto> claims) { TokenValueDto totalFndValue = null; TokenValueDto totalOtherValue = null; final Map<String, ClaimByTransactionAggregate.Builder> claimsPerTransaction = new HashMap<>(); for (final ClaimDto claim : claims) { final ClaimByTra...
ClaimDtoAggregator { ClaimsByTransactionAggregate aggregateClaims(final List<ClaimDto> claims) { TokenValueDto totalFndValue = null; TokenValueDto totalOtherValue = null; final Map<String, ClaimByTransactionAggregate.Builder> claimsPerTransaction = new HashMap<>(); for (final ClaimDto claim : claims) { final ClaimByTra...
ClaimDtoAggregator { ClaimsByTransactionAggregate aggregateClaims(final List<ClaimDto> claims) { TokenValueDto totalFndValue = null; TokenValueDto totalOtherValue = null; final Map<String, ClaimByTransactionAggregate.Builder> claimsPerTransaction = new HashMap<>(); for (final ClaimDto claim : claims) { final ClaimByTra...
ClaimDtoAggregator { ClaimsByTransactionAggregate aggregateClaims(final List<ClaimDto> claims) { TokenValueDto totalFndValue = null; TokenValueDto totalOtherValue = null; final Map<String, ClaimByTransactionAggregate.Builder> claimsPerTransaction = new HashMap<>(); for (final ClaimDto claim : claims) { final ClaimByTra...
@Test void setNewEtherAddress() { final String userId = "agd"; final UserResource userResource = mock(UserResource.class); final UserRepresentation userRepresentation = mock(UserRepresentation.class); final Map<String, List<String>> userAttributes = new HashMap<>(); when(realmResource.users().get(userId)).thenReturn(us...
public void updateEtherAddress(String userId, String newAddress) { final UserResource userResource = resource.users().get(userId); final UserRepresentation userRepresentation = userResource.toRepresentation(); if (userRepresentation.getAttributes() == null) { userRepresentation.setAttributes(new HashMap<>()); } if (!is...
KeycloakRepositoryImpl implements KeycloakRepository { public void updateEtherAddress(String userId, String newAddress) { final UserResource userResource = resource.users().get(userId); final UserRepresentation userRepresentation = userResource.toRepresentation(); if (userRepresentation.getAttributes() == null) { userR...
KeycloakRepositoryImpl implements KeycloakRepository { public void updateEtherAddress(String userId, String newAddress) { final UserResource userResource = resource.users().get(userId); final UserRepresentation userRepresentation = userResource.toRepresentation(); if (userRepresentation.getAttributes() == null) { userR...
KeycloakRepositoryImpl implements KeycloakRepository { public void updateEtherAddress(String userId, String newAddress) { final UserResource userResource = resource.users().get(userId); final UserRepresentation userRepresentation = userResource.toRepresentation(); if (userRepresentation.getAttributes() == null) { userR...
KeycloakRepositoryImpl implements KeycloakRepository { public void updateEtherAddress(String userId, String newAddress) { final UserResource userResource = resource.users().get(userId); final UserRepresentation userRepresentation = userResource.toRepresentation(); if (userRepresentation.getAttributes() == null) { userR...
@Test public void ignoresGithubComment() { handler = new CreateGithubCommentOnResolvedHandler(githubGateway, githubScraper, githubCommentFactory, false); handler.createGithubCommentOnRequestClaimable(mock((RequestClaimableEvent.class))); verifyZeroInteractions(githubGateway); }
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimable(final RequestClaimableEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInformation(); if (issueInformation.g...
CreateGithubCommentOnResolvedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimable(final RequestClaimableEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIss...
CreateGithubCommentOnResolvedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimable(final RequestClaimableEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIss...
CreateGithubCommentOnResolvedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimable(final RequestClaimableEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIss...
CreateGithubCommentOnResolvedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimable(final RequestClaimableEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIss...
@Test public void postsGithubComment() { final RequestClaimableEvent event = new RequestClaimableEvent(RequestDtoMother.freeCodeCampNoUserStories(), LocalDateTime.now()); final String expectedMessage = "ytufg"; final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIss...
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimable(final RequestClaimableEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInformation(); if (issueInformation.g...
CreateGithubCommentOnResolvedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimable(final RequestClaimableEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIss...
CreateGithubCommentOnResolvedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimable(final RequestClaimableEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIss...
CreateGithubCommentOnResolvedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimable(final RequestClaimableEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIss...
CreateGithubCommentOnResolvedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimable(final RequestClaimableEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIss...
@Test public void postsGithubComment_noSolverFound() { final RequestClaimableEvent event = new RequestClaimableEvent(RequestDtoMother.freeCodeCampNoUserStories(), LocalDateTime.now()); final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInformation(); when(gith...
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimable(final RequestClaimableEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInformation(); if (issueInformation.g...
CreateGithubCommentOnResolvedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimable(final RequestClaimableEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIss...
CreateGithubCommentOnResolvedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimable(final RequestClaimableEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIss...
CreateGithubCommentOnResolvedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimable(final RequestClaimableEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIss...
CreateGithubCommentOnResolvedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimable(final RequestClaimableEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIss...
@Test public void ignoresGithubComment() { handler = new CreateGithubCommentOnClosedHandler(githubGateway, githubScraper, githubCommentFactory, false, githubUser); handler.createGithubCommentOnRequestClaimed(mock((RequestClaimedEvent.class))); verifyZeroInteractions(githubGateway); }
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInformation(); final ClaimDto claim = eve...
CreateGithubCommentOnClosedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInfo...
CreateGithubCommentOnClosedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInfo...
CreateGithubCommentOnClosedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInfo...
CreateGithubCommentOnClosedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInfo...
@Test public void postsGithubComment_lessThan2CommentsPresent() { final RequestClaimedEvent event = RequestClaimedEvent.builder() .blockchainEventId(1324354L) .requestDto(RequestDtoMother.freeCodeCampNoUserStories()) .claimDto(mock(ClaimDto.class)) .solver(SOLVER) .timestamp(LocalDateTime.now()) .build(); final Request...
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInformation(); final ClaimDto claim = eve...
CreateGithubCommentOnClosedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInfo...
CreateGithubCommentOnClosedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInfo...
CreateGithubCommentOnClosedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInfo...
CreateGithubCommentOnClosedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInfo...
@Test public void postsGithubComment_2CommentsPresent() { final RequestClaimedEvent event = RequestClaimedEvent.builder() .blockchainEventId(1324354L) .requestDto(RequestDtoMother.freeCodeCampNoUserStories()) .claimDto(mock(ClaimDto.class)) .solver(SOLVER) .timestamp(LocalDateTime.now()) .build(); final RequestDto requ...
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInformation(); final ClaimDto claim = eve...
CreateGithubCommentOnClosedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInfo...
CreateGithubCommentOnClosedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInfo...
CreateGithubCommentOnClosedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInfo...
CreateGithubCommentOnClosedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInfo...
@Test public void postsGithubComment_moreThan2CommentsPresent() { final RequestClaimedEvent event = RequestClaimedEvent.builder() .blockchainEventId(1324354L) .requestDto(RequestDtoMother.freeCodeCampNoUserStories()) .claimDto(mock(ClaimDto.class)) .solver(SOLVER) .timestamp(LocalDateTime.now()) .build(); final Request...
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInformation(); final ClaimDto claim = eve...
CreateGithubCommentOnClosedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInfo...
CreateGithubCommentOnClosedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInfo...
CreateGithubCommentOnClosedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInfo...
CreateGithubCommentOnClosedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInfo...
@Test public void postsGithubComment_noSolverFound() { final RequestClaimedEvent event = RequestClaimedEvent.builder() .blockchainEventId(1324354L) .requestDto(RequestDtoMother.freeCodeCampNoUserStories()) .claimDto(mock(ClaimDto.class)) .solver(SOLVER) .timestamp(LocalDateTime.now()) .build(); final RequestDto request...
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInformation(); final ClaimDto claim = eve...
CreateGithubCommentOnClosedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInfo...
CreateGithubCommentOnClosedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInfo...
CreateGithubCommentOnClosedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInfo...
CreateGithubCommentOnClosedHandler { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event) { if (addComment) { final RequestDto request = event.getRequestDto(); final IssueInformationDto issueInformation = request.getIssueInfo...
@Test public void claimableResult_githubIssueNotClosed() { final String owner = "FundRequest"; final String repo = "area51"; final String number = "983"; final String solver = "davyvanroy"; when(githubScraper.fetchGithubIssue(owner, repo, number)).thenReturn(GithubIssue.builder() .status("Open") .solver(solver) .build(...
public ClaimableResultDto claimableResult(final String owner, final String repo, final String number, final RequestStatus requestStatus) { final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); if (isIssueClosed(githubIssue) && githubIssue.getSolver() != null && (requestStatus == FUNDED ||...
GithubClaimResolver { public ClaimableResultDto claimableResult(final String owner, final String repo, final String number, final RequestStatus requestStatus) { final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); if (isIssueClosed(githubIssue) && githubIssue.getSolver() != null && (requ...
GithubClaimResolver { public ClaimableResultDto claimableResult(final String owner, final String repo, final String number, final RequestStatus requestStatus) { final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); if (isIssueClosed(githubIssue) && githubIssue.getSolver() != null && (requ...
GithubClaimResolver { public ClaimableResultDto claimableResult(final String owner, final String repo, final String number, final RequestStatus requestStatus) { final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); if (isIssueClosed(githubIssue) && githubIssue.getSolver() != null && (requ...
GithubClaimResolver { public ClaimableResultDto claimableResult(final String owner, final String repo, final String number, final RequestStatus requestStatus) { final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); if (isIssueClosed(githubIssue) && githubIssue.getSolver() != null && (requ...
@Test public void claimableResult_githubIssueNoSolver() { final String owner = "FundRequest"; final String repo = "area51"; final String number = "983"; when(githubScraper.fetchGithubIssue(owner, repo, number)).thenReturn(GithubIssue.builder() .status("Closed") .build()); final ClaimableResultDto result = claimResolver...
public ClaimableResultDto claimableResult(final String owner, final String repo, final String number, final RequestStatus requestStatus) { final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); if (isIssueClosed(githubIssue) && githubIssue.getSolver() != null && (requestStatus == FUNDED ||...
GithubClaimResolver { public ClaimableResultDto claimableResult(final String owner, final String repo, final String number, final RequestStatus requestStatus) { final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); if (isIssueClosed(githubIssue) && githubIssue.getSolver() != null && (requ...
GithubClaimResolver { public ClaimableResultDto claimableResult(final String owner, final String repo, final String number, final RequestStatus requestStatus) { final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); if (isIssueClosed(githubIssue) && githubIssue.getSolver() != null && (requ...
GithubClaimResolver { public ClaimableResultDto claimableResult(final String owner, final String repo, final String number, final RequestStatus requestStatus) { final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); if (isIssueClosed(githubIssue) && githubIssue.getSolver() != null && (requ...
GithubClaimResolver { public ClaimableResultDto claimableResult(final String owner, final String repo, final String number, final RequestStatus requestStatus) { final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); if (isIssueClosed(githubIssue) && githubIssue.getSolver() != null && (requ...
@Test void listFundedNotificationChannels() throws IOException { final String json = "json"; final List<String> expectedChannels = Arrays.asList("FundRequest/funded-requests-test", "FundRequest/funded-requests", "FundRequest/funded-requests-blablabla"); final GitterRooms gitterRooms = new GitterRooms(); gitterRooms.set...
@Cacheable("gitter_fund_notification_rooms") public List<String> listFundedNotificationRooms() { try { final String roomsRaw = githubRawClient.getContentsAsRaw("FundRequest", "content-management", branch, filePath); final GitterRooms gitterRooms = objectMapper.readValue(roomsRaw, GitterRooms.class); return gitterRooms....
GitterService { @Cacheable("gitter_fund_notification_rooms") public List<String> listFundedNotificationRooms() { try { final String roomsRaw = githubRawClient.getContentsAsRaw("FundRequest", "content-management", branch, filePath); final GitterRooms gitterRooms = objectMapper.readValue(roomsRaw, GitterRooms.class); ret...
GitterService { @Cacheable("gitter_fund_notification_rooms") public List<String> listFundedNotificationRooms() { try { final String roomsRaw = githubRawClient.getContentsAsRaw("FundRequest", "content-management", branch, filePath); final GitterRooms gitterRooms = objectMapper.readValue(roomsRaw, GitterRooms.class); ret...
GitterService { @Cacheable("gitter_fund_notification_rooms") public List<String> listFundedNotificationRooms() { try { final String roomsRaw = githubRawClient.getContentsAsRaw("FundRequest", "content-management", branch, filePath); final GitterRooms gitterRooms = objectMapper.readValue(roomsRaw, GitterRooms.class); ret...
GitterService { @Cacheable("gitter_fund_notification_rooms") public List<String> listFundedNotificationRooms() { try { final String roomsRaw = githubRawClient.getContentsAsRaw("FundRequest", "content-management", branch, filePath); final GitterRooms gitterRooms = objectMapper.readValue(roomsRaw, GitterRooms.class); ret...
@Test public void connectionToKafkaTopicsIsSuccess() { KafkaMetricsSet kafkaMetricsSet = initKafkaMetricSet(); assertTrue(kafkaMetricsSet.connectionToKafkaTopicsIsSuccess()); }
public Boolean connectionToKafkaTopicsIsSuccess() { if (nonNull(metricTopics) && nonNull(connectionTimeoutTopic)) { StopWatch executionTime = StopWatch.createStarted(); DescribeTopicsOptions describeTopicsOptions = new DescribeTopicsOptions().timeoutMs( connectionTimeoutTopic); try (AdminClient adminClient = AdminClien...
KafkaMetricsSet implements MetricSet { public Boolean connectionToKafkaTopicsIsSuccess() { if (nonNull(metricTopics) && nonNull(connectionTimeoutTopic)) { StopWatch executionTime = StopWatch.createStarted(); DescribeTopicsOptions describeTopicsOptions = new DescribeTopicsOptions().timeoutMs( connectionTimeoutTopic); tr...
KafkaMetricsSet implements MetricSet { public Boolean connectionToKafkaTopicsIsSuccess() { if (nonNull(metricTopics) && nonNull(connectionTimeoutTopic)) { StopWatch executionTime = StopWatch.createStarted(); DescribeTopicsOptions describeTopicsOptions = new DescribeTopicsOptions().timeoutMs( connectionTimeoutTopic); tr...
KafkaMetricsSet implements MetricSet { public Boolean connectionToKafkaTopicsIsSuccess() { if (nonNull(metricTopics) && nonNull(connectionTimeoutTopic)) { StopWatch executionTime = StopWatch.createStarted(); DescribeTopicsOptions describeTopicsOptions = new DescribeTopicsOptions().timeoutMs( connectionTimeoutTopic); tr...
KafkaMetricsSet implements MetricSet { public Boolean connectionToKafkaTopicsIsSuccess() { if (nonNull(metricTopics) && nonNull(connectionTimeoutTopic)) { StopWatch executionTime = StopWatch.createStarted(); DescribeTopicsOptions describeTopicsOptions = new DescribeTopicsOptions().timeoutMs( connectionTimeoutTopic); tr...
@Test @SneakyThrows public void connectionToKafkaTopicsIsNotSuccess() { KafkaMetricsSet kafkaMetricsSet = initKafkaMetricSet(); kafkaEmbedded.destroy(); assertFalse(kafkaMetricsSet.connectionToKafkaTopicsIsSuccess()); }
public Boolean connectionToKafkaTopicsIsSuccess() { if (nonNull(metricTopics) && nonNull(connectionTimeoutTopic)) { StopWatch executionTime = StopWatch.createStarted(); DescribeTopicsOptions describeTopicsOptions = new DescribeTopicsOptions().timeoutMs( connectionTimeoutTopic); try (AdminClient adminClient = AdminClien...
KafkaMetricsSet implements MetricSet { public Boolean connectionToKafkaTopicsIsSuccess() { if (nonNull(metricTopics) && nonNull(connectionTimeoutTopic)) { StopWatch executionTime = StopWatch.createStarted(); DescribeTopicsOptions describeTopicsOptions = new DescribeTopicsOptions().timeoutMs( connectionTimeoutTopic); tr...
KafkaMetricsSet implements MetricSet { public Boolean connectionToKafkaTopicsIsSuccess() { if (nonNull(metricTopics) && nonNull(connectionTimeoutTopic)) { StopWatch executionTime = StopWatch.createStarted(); DescribeTopicsOptions describeTopicsOptions = new DescribeTopicsOptions().timeoutMs( connectionTimeoutTopic); tr...
KafkaMetricsSet implements MetricSet { public Boolean connectionToKafkaTopicsIsSuccess() { if (nonNull(metricTopics) && nonNull(connectionTimeoutTopic)) { StopWatch executionTime = StopWatch.createStarted(); DescribeTopicsOptions describeTopicsOptions = new DescribeTopicsOptions().timeoutMs( connectionTimeoutTopic); tr...
KafkaMetricsSet implements MetricSet { public Boolean connectionToKafkaTopicsIsSuccess() { if (nonNull(metricTopics) && nonNull(connectionTimeoutTopic)) { StopWatch executionTime = StopWatch.createStarted(); DescribeTopicsOptions describeTopicsOptions = new DescribeTopicsOptions().timeoutMs( connectionTimeoutTopic); tr...
@Test public void connectionToKafkaIsNotSuccessWithWrongTopic() { KafkaMetricsSet kafkaMetricsSet = initNotExistTopic(); assertFalse(kafkaMetricsSet.connectionToKafkaTopicsIsSuccess()); }
public Boolean connectionToKafkaTopicsIsSuccess() { if (nonNull(metricTopics) && nonNull(connectionTimeoutTopic)) { StopWatch executionTime = StopWatch.createStarted(); DescribeTopicsOptions describeTopicsOptions = new DescribeTopicsOptions().timeoutMs( connectionTimeoutTopic); try (AdminClient adminClient = AdminClien...
KafkaMetricsSet implements MetricSet { public Boolean connectionToKafkaTopicsIsSuccess() { if (nonNull(metricTopics) && nonNull(connectionTimeoutTopic)) { StopWatch executionTime = StopWatch.createStarted(); DescribeTopicsOptions describeTopicsOptions = new DescribeTopicsOptions().timeoutMs( connectionTimeoutTopic); tr...
KafkaMetricsSet implements MetricSet { public Boolean connectionToKafkaTopicsIsSuccess() { if (nonNull(metricTopics) && nonNull(connectionTimeoutTopic)) { StopWatch executionTime = StopWatch.createStarted(); DescribeTopicsOptions describeTopicsOptions = new DescribeTopicsOptions().timeoutMs( connectionTimeoutTopic); tr...
KafkaMetricsSet implements MetricSet { public Boolean connectionToKafkaTopicsIsSuccess() { if (nonNull(metricTopics) && nonNull(connectionTimeoutTopic)) { StopWatch executionTime = StopWatch.createStarted(); DescribeTopicsOptions describeTopicsOptions = new DescribeTopicsOptions().timeoutMs( connectionTimeoutTopic); tr...
KafkaMetricsSet implements MetricSet { public Boolean connectionToKafkaTopicsIsSuccess() { if (nonNull(metricTopics) && nonNull(connectionTimeoutTopic)) { StopWatch executionTime = StopWatch.createStarted(); DescribeTopicsOptions describeTopicsOptions = new DescribeTopicsOptions().timeoutMs( connectionTimeoutTopic); tr...
@Test public void testGetConfigValue() throws IOException { assertNotNull(tenantConfigService.getConfig()); assertEquals("value1", getConfig().get("testProperty")); }
@IgnoreLogginAspect public Map<String, Object> getConfig() { return getTenantConfig(); }
TenantConfigService implements RefreshableConfiguration { @IgnoreLogginAspect public Map<String, Object> getConfig() { return getTenantConfig(); } }
TenantConfigService implements RefreshableConfiguration { @IgnoreLogginAspect public Map<String, Object> getConfig() { return getTenantConfig(); } TenantConfigService(XmConfigProperties xmConfigProperties, TenantContextHolder tenantContextHolder); }
TenantConfigService implements RefreshableConfiguration { @IgnoreLogginAspect public Map<String, Object> getConfig() { return getTenantConfig(); } TenantConfigService(XmConfigProperties xmConfigProperties, TenantContextHolder tenantContextHolder); @IgnoreLogginAspect Map<String, Object> g...
TenantConfigService implements RefreshableConfiguration { @IgnoreLogginAspect public Map<String, Object> getConfig() { return getTenantConfig(); } TenantConfigService(XmConfigProperties xmConfigProperties, TenantContextHolder tenantContextHolder); @IgnoreLogginAspect Map<String, Object> g...
@Test public void testCanNotChangeConfigMapOutside() throws IOException { assertEquals("value1", getConfig().get("testProperty")); assertEquals(1, tenantConfigService.getConfig().size()); try { tenantConfigService.getConfig().put("newProperty", "You've been hacked!"); fail("should not be success!!!"); } catch (Unsuppor...
@IgnoreLogginAspect public Map<String, Object> getConfig() { return getTenantConfig(); }
TenantConfigService implements RefreshableConfiguration { @IgnoreLogginAspect public Map<String, Object> getConfig() { return getTenantConfig(); } }
TenantConfigService implements RefreshableConfiguration { @IgnoreLogginAspect public Map<String, Object> getConfig() { return getTenantConfig(); } TenantConfigService(XmConfigProperties xmConfigProperties, TenantContextHolder tenantContextHolder); }
TenantConfigService implements RefreshableConfiguration { @IgnoreLogginAspect public Map<String, Object> getConfig() { return getTenantConfig(); } TenantConfigService(XmConfigProperties xmConfigProperties, TenantContextHolder tenantContextHolder); @IgnoreLogginAspect Map<String, Object> g...
TenantConfigService implements RefreshableConfiguration { @IgnoreLogginAspect public Map<String, Object> getConfig() { return getTenantConfig(); } TenantConfigService(XmConfigProperties xmConfigProperties, TenantContextHolder tenantContextHolder); @IgnoreLogginAspect Map<String, Object> g...
@Test public final void assertThatEnsureNoConflictingAnnotationsPresentOnCorrectlyRecognizesNoConflict() { AnnotatedFieldProcessor .ensureNoConflictingAnnotationsPresentOn(BeanHavingEndpointInjectAnnotatedField.class); }
static <X> void ensureNoConflictingAnnotationsPresentOn(final Class<X> type) throws ResolutionException { final Set<Field> fieldsHavingConflictingAnnotations = new HashSet<Field>(); for (final Field fieldToInspect : allFieldsAndSuperclassFieldsIn(type)) { if (isAnnotatedWithOneOf(fieldToInspect, CAMEL) && isAnnotatedWi...
AnnotatedFieldProcessor { static <X> void ensureNoConflictingAnnotationsPresentOn(final Class<X> type) throws ResolutionException { final Set<Field> fieldsHavingConflictingAnnotations = new HashSet<Field>(); for (final Field fieldToInspect : allFieldsAndSuperclassFieldsIn(type)) { if (isAnnotatedWithOneOf(fieldToInspec...
AnnotatedFieldProcessor { static <X> void ensureNoConflictingAnnotationsPresentOn(final Class<X> type) throws ResolutionException { final Set<Field> fieldsHavingConflictingAnnotations = new HashSet<Field>(); for (final Field fieldToInspect : allFieldsAndSuperclassFieldsIn(type)) { if (isAnnotatedWithOneOf(fieldToInspec...
AnnotatedFieldProcessor { static <X> void ensureNoConflictingAnnotationsPresentOn(final Class<X> type) throws ResolutionException { final Set<Field> fieldsHavingConflictingAnnotations = new HashSet<Field>(); for (final Field fieldToInspect : allFieldsAndSuperclassFieldsIn(type)) { if (isAnnotatedWithOneOf(fieldToInspec...
AnnotatedFieldProcessor { static <X> void ensureNoConflictingAnnotationsPresentOn(final Class<X> type) throws ResolutionException { final Set<Field> fieldsHavingConflictingAnnotations = new HashSet<Field>(); for (final Field fieldToInspect : allFieldsAndSuperclassFieldsIn(type)) { if (isAnnotatedWithOneOf(fieldToInspec...
@Test(expected = ResolutionException.class) public final void assertThatEnsureNoConflictingAnnotationsPresentOnCorrectlyRecognizesAConflict() { AnnotatedFieldProcessor .ensureNoConflictingAnnotationsPresentOn(BeanHavingEndpointInjectAndInjectAnnotatedField.class); }
static <X> void ensureNoConflictingAnnotationsPresentOn(final Class<X> type) throws ResolutionException { final Set<Field> fieldsHavingConflictingAnnotations = new HashSet<Field>(); for (final Field fieldToInspect : allFieldsAndSuperclassFieldsIn(type)) { if (isAnnotatedWithOneOf(fieldToInspect, CAMEL) && isAnnotatedWi...
AnnotatedFieldProcessor { static <X> void ensureNoConflictingAnnotationsPresentOn(final Class<X> type) throws ResolutionException { final Set<Field> fieldsHavingConflictingAnnotations = new HashSet<Field>(); for (final Field fieldToInspect : allFieldsAndSuperclassFieldsIn(type)) { if (isAnnotatedWithOneOf(fieldToInspec...
AnnotatedFieldProcessor { static <X> void ensureNoConflictingAnnotationsPresentOn(final Class<X> type) throws ResolutionException { final Set<Field> fieldsHavingConflictingAnnotations = new HashSet<Field>(); for (final Field fieldToInspect : allFieldsAndSuperclassFieldsIn(type)) { if (isAnnotatedWithOneOf(fieldToInspec...
AnnotatedFieldProcessor { static <X> void ensureNoConflictingAnnotationsPresentOn(final Class<X> type) throws ResolutionException { final Set<Field> fieldsHavingConflictingAnnotations = new HashSet<Field>(); for (final Field fieldToInspect : allFieldsAndSuperclassFieldsIn(type)) { if (isAnnotatedWithOneOf(fieldToInspec...
AnnotatedFieldProcessor { static <X> void ensureNoConflictingAnnotationsPresentOn(final Class<X> type) throws ResolutionException { final Set<Field> fieldsHavingConflictingAnnotations = new HashSet<Field>(); for (final Field fieldToInspect : allFieldsAndSuperclassFieldsIn(type)) { if (isAnnotatedWithOneOf(fieldToInspec...
@Test public final void assertThatHasCamelInjectAnnotatedFieldsRecognizesThatNoCamelInjectAnnotationIsPresentOnAnyField() { final boolean answer = AnnotatedFieldProcessor .hasCamelInjectAnnotatedFields(BeanHavingNoEndpointInjectAnnotatedField.class); assertFalse("AnnotatedFieldProcessor.hasCamelInjectAnnotatedFields(" ...
static <X> boolean hasCamelInjectAnnotatedFields(final Class<X> type) { return !camelInjectAnnotatedFieldsIn(type).isEmpty(); }
AnnotatedFieldProcessor { static <X> boolean hasCamelInjectAnnotatedFields(final Class<X> type) { return !camelInjectAnnotatedFieldsIn(type).isEmpty(); } }
AnnotatedFieldProcessor { static <X> boolean hasCamelInjectAnnotatedFields(final Class<X> type) { return !camelInjectAnnotatedFieldsIn(type).isEmpty(); } }
AnnotatedFieldProcessor { static <X> boolean hasCamelInjectAnnotatedFields(final Class<X> type) { return !camelInjectAnnotatedFieldsIn(type).isEmpty(); } }
AnnotatedFieldProcessor { static <X> boolean hasCamelInjectAnnotatedFields(final Class<X> type) { return !camelInjectAnnotatedFieldsIn(type).isEmpty(); } }
@Test public final void assertThatHasCamelInjectAnnotatedFieldsRecognizesEndpointInjectAnnotationOnField() { final boolean answer = AnnotatedFieldProcessor .hasCamelInjectAnnotatedFields(BeanHavingEndpointInjectAnnotatedField.class); assertTrue("AnnotatedFieldProcessor.hasCamelInjectAnnotatedFields(" + BeanHavingEndpoi...
static <X> boolean hasCamelInjectAnnotatedFields(final Class<X> type) { return !camelInjectAnnotatedFieldsIn(type).isEmpty(); }
AnnotatedFieldProcessor { static <X> boolean hasCamelInjectAnnotatedFields(final Class<X> type) { return !camelInjectAnnotatedFieldsIn(type).isEmpty(); } }
AnnotatedFieldProcessor { static <X> boolean hasCamelInjectAnnotatedFields(final Class<X> type) { return !camelInjectAnnotatedFieldsIn(type).isEmpty(); } }
AnnotatedFieldProcessor { static <X> boolean hasCamelInjectAnnotatedFields(final Class<X> type) { return !camelInjectAnnotatedFieldsIn(type).isEmpty(); } }
AnnotatedFieldProcessor { static <X> boolean hasCamelInjectAnnotatedFields(final Class<X> type) { return !camelInjectAnnotatedFieldsIn(type).isEmpty(); } }
@Test public final void assertThatCamelInjectAnnotatedFieldsInReturnsEnpointInjectAnnotatedField() { final Set<Field> camelInjectAnnotatedFields = AnnotatedFieldProcessor .camelInjectAnnotatedFieldsIn(BeanHavingEndpointInjectAnnotatedField.class); assertEquals("AnnotatedFieldProcessor.hasCamelInjectAnnotatedFields(" + ...
static <X> Set<Field> camelInjectAnnotatedFieldsIn(final Class<X> type) { final Set<Field> camelInjectAnnotatedFields = new HashSet<Field>(); for (final Field fieldToInspect : allFieldsAndSuperclassFieldsIn(type)) { if (isAnnotatedWithOneOf(fieldToInspect, CAMEL)) { camelInjectAnnotatedFields.add(fieldToInspect); } } r...
AnnotatedFieldProcessor { static <X> Set<Field> camelInjectAnnotatedFieldsIn(final Class<X> type) { final Set<Field> camelInjectAnnotatedFields = new HashSet<Field>(); for (final Field fieldToInspect : allFieldsAndSuperclassFieldsIn(type)) { if (isAnnotatedWithOneOf(fieldToInspect, CAMEL)) { camelInjectAnnotatedFields....
AnnotatedFieldProcessor { static <X> Set<Field> camelInjectAnnotatedFieldsIn(final Class<X> type) { final Set<Field> camelInjectAnnotatedFields = new HashSet<Field>(); for (final Field fieldToInspect : allFieldsAndSuperclassFieldsIn(type)) { if (isAnnotatedWithOneOf(fieldToInspect, CAMEL)) { camelInjectAnnotatedFields....
AnnotatedFieldProcessor { static <X> Set<Field> camelInjectAnnotatedFieldsIn(final Class<X> type) { final Set<Field> camelInjectAnnotatedFields = new HashSet<Field>(); for (final Field fieldToInspect : allFieldsAndSuperclassFieldsIn(type)) { if (isAnnotatedWithOneOf(fieldToInspect, CAMEL)) { camelInjectAnnotatedFields....
AnnotatedFieldProcessor { static <X> Set<Field> camelInjectAnnotatedFieldsIn(final Class<X> type) { final Set<Field> camelInjectAnnotatedFields = new HashSet<Field>(); for (final Field fieldToInspect : allFieldsAndSuperclassFieldsIn(type)) { if (isAnnotatedWithOneOf(fieldToInspect, CAMEL)) { camelInjectAnnotatedFields....
@Test public void testThatInstallSucceedsForDexModule() throws IOException { Mockito.when(mModulePathsNo1Mock.containsDexFile()).thenReturn(true); Mockito.when(mModulePathsNo1Mock.getDexFile()).thenReturn(mDexFileNo1Mock); Mockito.when(mModulePathsNo1Mock.getOptimizedDexFile()).thenReturn(mOptDexFileNo1Mock); mObjectUn...
public synchronized void installModule(String moduleName) throws IOException { mLoaderAlgorithm.installModule(moduleName); }
LazyModuleLoader { public synchronized void installModule(String moduleName) throws IOException { mLoaderAlgorithm.installModule(moduleName); } }
LazyModuleLoader { public synchronized void installModule(String moduleName) throws IOException { mLoaderAlgorithm.installModule(moduleName); } LazyModuleLoader(Context context, LoaderAlgorithm loaderAlgorithm); }
LazyModuleLoader { public synchronized void installModule(String moduleName) throws IOException { mLoaderAlgorithm.installModule(moduleName); } LazyModuleLoader(Context context, LoaderAlgorithm loaderAlgorithm); synchronized ServiceLike loadServiceModule(String moduleName, String className); synchronized SupportFragmen...
LazyModuleLoader { public synchronized void installModule(String moduleName) throws IOException { mLoaderAlgorithm.installModule(moduleName); } LazyModuleLoader(Context context, LoaderAlgorithm loaderAlgorithm); synchronized ServiceLike loadServiceModule(String moduleName, String className); synchronized SupportFragmen...
@Test public void testThatLoadSucceedsForSupportFragmentModule() throws IOException, LazyLoadingException, ClassNotFoundException { Mockito.when(mModulePathsNo1Mock.containsDexFile()).thenReturn(true); Mockito.when(mModulePathsNo1Mock.getDexFile()).thenReturn(mDexFileNo1Mock); Mockito.when(mModulePathsNo1Mock.getOptimi...
public synchronized SupportFragmentLike loadSupportFragmentModule( Fragment hostingFragment, String moduleName, String className) throws LazyLoadingException { try { Class lazyLoadedClass = mLoaderAlgorithm.loadModule(moduleName, className); Constructor c = lazyLoadedClass.getConstructor(Fragment.class); SupportFragmen...
LazyModuleLoader { public synchronized SupportFragmentLike loadSupportFragmentModule( Fragment hostingFragment, String moduleName, String className) throws LazyLoadingException { try { Class lazyLoadedClass = mLoaderAlgorithm.loadModule(moduleName, className); Constructor c = lazyLoadedClass.getConstructor(Fragment.cla...
LazyModuleLoader { public synchronized SupportFragmentLike loadSupportFragmentModule( Fragment hostingFragment, String moduleName, String className) throws LazyLoadingException { try { Class lazyLoadedClass = mLoaderAlgorithm.loadModule(moduleName, className); Constructor c = lazyLoadedClass.getConstructor(Fragment.cla...
LazyModuleLoader { public synchronized SupportFragmentLike loadSupportFragmentModule( Fragment hostingFragment, String moduleName, String className) throws LazyLoadingException { try { Class lazyLoadedClass = mLoaderAlgorithm.loadModule(moduleName, className); Constructor c = lazyLoadedClass.getConstructor(Fragment.cla...
LazyModuleLoader { public synchronized SupportFragmentLike loadSupportFragmentModule( Fragment hostingFragment, String moduleName, String className) throws LazyLoadingException { try { Class lazyLoadedClass = mLoaderAlgorithm.loadModule(moduleName, className); Constructor c = lazyLoadedClass.getConstructor(Fragment.cla...
@Test public void testThatLoadSucceedsForFragmentModule() throws IOException, LazyLoadingException, ClassNotFoundException { Mockito.when(mModulePathsNo1Mock.containsDexFile()).thenReturn(true); Mockito.when(mModulePathsNo1Mock.getDexFile()).thenReturn(mDexFileNo1Mock); Mockito.when(mModulePathsNo1Mock.getOptimizedDexF...
public synchronized FragmentLike loadFragmentModule( android.app.Fragment hostingFragment, String moduleName, String className) throws LazyLoadingException { try { Class lazyLoadedClass = mLoaderAlgorithm.loadModule(moduleName, className); Constructor c = lazyLoadedClass.getConstructor(android.app.Fragment.class); Frag...
LazyModuleLoader { public synchronized FragmentLike loadFragmentModule( android.app.Fragment hostingFragment, String moduleName, String className) throws LazyLoadingException { try { Class lazyLoadedClass = mLoaderAlgorithm.loadModule(moduleName, className); Constructor c = lazyLoadedClass.getConstructor(android.app.Fr...
LazyModuleLoader { public synchronized FragmentLike loadFragmentModule( android.app.Fragment hostingFragment, String moduleName, String className) throws LazyLoadingException { try { Class lazyLoadedClass = mLoaderAlgorithm.loadModule(moduleName, className); Constructor c = lazyLoadedClass.getConstructor(android.app.Fr...
LazyModuleLoader { public synchronized FragmentLike loadFragmentModule( android.app.Fragment hostingFragment, String moduleName, String className) throws LazyLoadingException { try { Class lazyLoadedClass = mLoaderAlgorithm.loadModule(moduleName, className); Constructor c = lazyLoadedClass.getConstructor(android.app.Fr...
LazyModuleLoader { public synchronized FragmentLike loadFragmentModule( android.app.Fragment hostingFragment, String moduleName, String className) throws LazyLoadingException { try { Class lazyLoadedClass = mLoaderAlgorithm.loadModule(moduleName, className); Constructor c = lazyLoadedClass.getConstructor(android.app.Fr...