@Bean("WriteCache")
  public ScannerWriteCache provideWriter(AnalysisCacheEnabled analysisCacheEnabled, ReadCache readCache, BranchConfiguration branchConfiguration, FileStructure fileStructure) {
    if (analysisCacheEnabled.isEnabled() && !branchConfiguration.isPullRequest()) {
      return new WriteCacheImpl(readCache, fileStructure);
    }
    return new NoOpWriteCache();
  }
@Test
  public void provide_noop_writer_cache_if_pr() {
    when(branchConfiguration.isPullRequest()).thenReturn(true);
    when(analysisCacheEnabled.isEnabled()).thenReturn(true);
    var cache = cacheProvider.provideWriter(analysisCacheEnabled, readCache, branchConfiguration, fileStructure);
    assertThat(cache).isInstanceOf(AnalysisCacheProvider.NoOpWriteCache.class);
  }