@Test @Ignore public void renameProjectBranch() { }
@Subscribe public void renameProjectBranch(ProjectBranchRenamedEvent event) { final String projectName = event.getProjectName(); final String branchName = event.getBranchName(); final String newBranchName = event.getNewBranchName(); Function<Page, Page> function = new Function<Page, Page>() { @Override public Page apply(Page page) { return page.getProjectName().equals(projectName) && page.getBranchName().equals(branchName) ? new Page(projectName, newBranchName, page.getPath()) : page; } }; try { transformAllSubscriptions(function, "rename branch " + projectName + "/" + branchName + " to " + projectName + "/" + newBranchName, event.getCurrentUser()); } catch (IOException e) { log.error(StringUtils.EMPTY, e); } catch (GitAPIException e) { log.error(StringUtils.EMPTY, e); } }
SubscriptionStore { @Subscribe public void renameProjectBranch(ProjectBranchRenamedEvent event) { final String projectName = event.getProjectName(); final String branchName = event.getBranchName(); final String newBranchName = event.getNewBranchName(); Function<Page, Page> function = new Function<Page, Page>() { @Override public Page apply(Page page) { return page.getProjectName().equals(projectName) && page.getBranchName().equals(branchName) ? new Page(projectName, newBranchName, page.getPath()) : page; } }; try { transformAllSubscriptions(function, "rename branch " + projectName + "/" + branchName + " to " + projectName + "/" + newBranchName, event.getCurrentUser()); } catch (IOException e) { log.error(StringUtils.EMPTY, e); } catch (GitAPIException e) { log.error(StringUtils.EMPTY, e); } } }
SubscriptionStore { @Subscribe public void renameProjectBranch(ProjectBranchRenamedEvent event) { final String projectName = event.getProjectName(); final String branchName = event.getBranchName(); final String newBranchName = event.getNewBranchName(); Function<Page, Page> function = new Function<Page, Page>() { @Override public Page apply(Page page) { return page.getProjectName().equals(projectName) && page.getBranchName().equals(branchName) ? new Page(projectName, newBranchName, page.getPath()) : page; } }; try { transformAllSubscriptions(function, "rename branch " + projectName + "/" + branchName + " to " + projectName + "/" + newBranchName, event.getCurrentUser()); } catch (IOException e) { log.error(StringUtils.EMPTY, e); } catch (GitAPIException e) { log.error(StringUtils.EMPTY, e); } }  }
SubscriptionStore { @Subscribe public void renameProjectBranch(ProjectBranchRenamedEvent event) { final String projectName = event.getProjectName(); final String branchName = event.getBranchName(); final String newBranchName = event.getNewBranchName(); Function<Page, Page> function = new Function<Page, Page>() { @Override public Page apply(Page page) { return page.getProjectName().equals(projectName) && page.getBranchName().equals(branchName) ? new Page(projectName, newBranchName, page.getPath()) : page; } }; try { transformAllSubscriptions(function, "rename branch " + projectName + "/" + branchName + " to " + projectName + "/" + newBranchName, event.getCurrentUser()); } catch (IOException e) { log.error(StringUtils.EMPTY, e); } catch (GitAPIException e) { log.error(StringUtils.EMPTY, e); } }  void subscribe(String projectName, String branchName, String path, User user); void unsubscribe(String projectName, String branchName, String path, User user); boolean isSubscribed(String projectName, String branchName, String path, User user); Set<String> getSubscriberEmails(String projectName, String branchName, String path); @Subscribe void renameProject(ProjectRenamedEvent event); @Subscribe void deleteProject(ProjectDeletedEvent event); @Subscribe void deleteProjectBranch(ProjectBranchDeletedEvent event); @Subscribe void renameProjectBranch(ProjectBranchRenamedEvent event); }
SubscriptionStore { @Subscribe public void renameProjectBranch(ProjectBranchRenamedEvent event) { final String projectName = event.getProjectName(); final String branchName = event.getBranchName(); final String newBranchName = event.getNewBranchName(); Function<Page, Page> function = new Function<Page, Page>() { @Override public Page apply(Page page) { return page.getProjectName().equals(projectName) && page.getBranchName().equals(branchName) ? new Page(projectName, newBranchName, page.getPath()) : page; } }; try { transformAllSubscriptions(function, "rename branch " + projectName + "/" + branchName + " to " + projectName + "/" + newBranchName, event.getCurrentUser()); } catch (IOException e) { log.error(StringUtils.EMPTY, e); } catch (GitAPIException e) { log.error(StringUtils.EMPTY, e); } }  void subscribe(String projectName, String branchName, String path, User user); void unsubscribe(String projectName, String branchName, String path, User user); boolean isSubscribed(String projectName, String branchName, String path, User user); Set<String> getSubscriberEmails(String projectName, String branchName, String path); @Subscribe void renameProject(ProjectRenamedEvent event); @Subscribe void deleteProject(ProjectDeletedEvent event); @Subscribe void deleteProjectBranch(ProjectBranchDeletedEvent event); @Subscribe void renameProjectBranch(ProjectBranchRenamedEvent event);  }