@Test public void forkDate_returns_instant_if_fork_found() throws SVNException { Path rootBaseDir = Paths.get(""); String referenceBranch = "branch"; Instant forkDate = Instant.ofEpochMilli(123456789L); SvnScmProvider provider = new SvnScmProvider(config, new SvnBlameCommand(config), findFork); when(findFork.findDate(rootBaseDir, referenceBranch)).thenReturn(forkDate); assertThat(provider.forkDate(rootBaseDir, referenceBranch)).isEqualTo(forkDate); }
@CheckForNull public Instant forkDate(Path rootBaseDir, String referenceBranch) { try { return findFork.findDate(rootBaseDir, referenceBranch); } catch (SVNException e) { LOG.warn("Unable to find fork date with '" + referenceBranch + "'", e); return null; } }
SvnScmProvider extends ScmProvider { @CheckForNull public Instant forkDate(Path rootBaseDir, String referenceBranch) { try { return findFork.findDate(rootBaseDir, referenceBranch); } catch (SVNException e) { LOG.warn("Unable to find fork date with '" + referenceBranch + "'", e); return null; } } }
SvnScmProvider extends ScmProvider { @CheckForNull public Instant forkDate(Path rootBaseDir, String referenceBranch) { try { return findFork.findDate(rootBaseDir, referenceBranch); } catch (SVNException e) { LOG.warn("Unable to find fork date with '" + referenceBranch + "'", e); return null; } } SvnScmProvider(SvnConfiguration configuration, SvnBlameCommand blameCommand, FindFork findFork); }
SvnScmProvider extends ScmProvider { @CheckForNull public Instant forkDate(Path rootBaseDir, String referenceBranch) { try { return findFork.findDate(rootBaseDir, referenceBranch); } catch (SVNException e) { LOG.warn("Unable to find fork date with '" + referenceBranch + "'", e); return null; } } SvnScmProvider(SvnConfiguration configuration, SvnBlameCommand blameCommand, FindFork findFork); @Override String key(); @Override boolean supports(File baseDir); @Override BlameCommand blameCommand(); @CheckForNull @Override Set<Path> branchChangedFiles(String targetBranchName, Path rootBaseDir); @CheckForNull @Override Map<Path, Set<Integer>> branchChangedLines(String targetBranchName, Path rootBaseDir, Set<Path> changedFiles); @CheckForNull Instant forkDate(Path rootBaseDir, String referenceBranch); }
SvnScmProvider extends ScmProvider { @CheckForNull public Instant forkDate(Path rootBaseDir, String referenceBranch) { try { return findFork.findDate(rootBaseDir, referenceBranch); } catch (SVNException e) { LOG.warn("Unable to find fork date with '" + referenceBranch + "'", e); return null; } } SvnScmProvider(SvnConfiguration configuration, SvnBlameCommand blameCommand, FindFork findFork); @Override String key(); @Override boolean supports(File baseDir); @Override BlameCommand blameCommand(); @CheckForNull @Override Set<Path> branchChangedFiles(String targetBranchName, Path rootBaseDir); @CheckForNull @Override Map<Path, Set<Integer>> branchChangedLines(String targetBranchName, Path rootBaseDir, Set<Path> changedFiles); @CheckForNull Instant forkDate(Path rootBaseDir, String referenceBranch);  }