@Override
  public Optional<ScmInfo> getScmInfo(Component component) {
    requireNonNull(component, "Component cannot be null");

    if (component.getType() != Component.Type.FILE) {
      return Optional.empty();
    }

    return scmInfoCache.computeIfAbsent(component, this::getScmInfoForComponent);
  }
@Test
  public void generate_scm_info_when_nothing_in_db_and_report_is_has_no_changesets() {
    when(dbLoader.getScmInfo(FILE)).thenReturn(Optional.empty());
    addFileSourceInReport(3);
    ScmInfo scmInfo = underTest.getScmInfo(FILE).get();
    assertThat(scmInfo.getAllChangesets()).hasSize(3);

    for (int i = 1; i <= 3; i++) {
      assertChangeset(scmInfo.getChangesetForLine(i), null, null, analysisDate.getTime());
    }

    verify(dbLoader).getScmInfo(FILE);
    verifyNoMoreInteractions(dbLoader);
    verifyNoInteractions(fileStatuses);
    verifyNoInteractions(diff);
  }