@Bean("ScmChangedFiles")
  public ScmChangedFiles provide(ScmConfiguration scmConfiguration, BranchConfiguration branchConfiguration, DefaultInputProject project) {
    Path rootBaseDir = project.getBaseDir();
    Set<ChangedFile> changedFiles = loadChangedFilesIfNeeded(scmConfiguration, branchConfiguration, rootBaseDir);

    if (changedFiles != null) {
      validatePaths(getAbsoluteFilePaths(changedFiles));
    }

    return new ScmChangedFiles(changedFiles);
  }
@Test
  public void testReturnChangedFiles() {
    when(branchConfiguration.targetBranchName()).thenReturn("target");
    when(branchConfiguration.isPullRequest()).thenReturn(true);
    when(scmConfiguration.provider()).thenReturn(scmProvider);
    when(scmProvider.branchChangedFiles("target", rootBaseDir)).thenReturn(Collections.singleton(Paths.get("changedFile").toAbsolutePath()));
    ScmChangedFiles scmChangedFiles = provider.provide(scmConfiguration, branchConfiguration, project);

    Path filePath = Paths.get("changedFile").toAbsolutePath();
    ChangedFile changedFile = ChangedFile.of(filePath);
    assertThat(scmChangedFiles.get()).containsOnly(changedFile);
    verify(scmProvider).branchChangedFiles("target", rootBaseDir);
  }