@Override
  public CiConfiguration loadConfiguration() {
    // https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin#GitHubpullrequestbuilderplugin-EnvironmentVariables
    // https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project
    String revision = system.envVariable("ghprbActualCommit");
    if (StringUtils.isNotBlank(revision)) {
      return new CiConfigurationImpl(revision, getName());
    }

    revision = system.envVariable("GIT_COMMIT");

    if (StringUtils.isNotBlank(revision)) {
      if (StringUtils.isNotBlank(system.envVariable("CHANGE_ID"))) {
        String jenkinsGitPrSha1 = getJenkinsGitPrSha1();
        if (StringUtils.isNotBlank(jenkinsGitPrSha1)) {
          return new CiConfigurationImpl(jenkinsGitPrSha1, getName());
        }
      }
      return new CiConfigurationImpl(revision, getName());
    }

    revision = system.envVariable("SVN_COMMIT");
    return new CiConfigurationImpl(revision, getName());
  }
@Test
  public void loadConfiguration_of_git_repo_with_branch_plugin() throws IOException {
    // prepare fake git clone
    Path baseDir = temp.newFolder().toPath();
    File unzip = ZipUtils.unzip(this.getClass().getResourceAsStream("gitrepo.zip"), baseDir.toFile());
    when(project.getBaseDir()).thenReturn(unzip.toPath().resolve("gitrepo"));

    setEnvVariable("CHANGE_ID", "3");
    setEnvVariable("GIT_BRANCH", "PR-3");
    // this will be ignored
    setEnvVariable("GIT_COMMIT", "abd12fc");

    assertThat(underTest.loadConfiguration().getScmRevision()).hasValue("e6013986eff4f0ce0a85f5d070070e7fdabead48");
  }