@Before
  public void setup() throws Exception {
    ApplicationConfiguration applicationConfiguration = this.lookup(ApplicationConfiguration.class);

    File repositoryStorageDir =
        applicationConfiguration.getWorkingDirectory("proxy/store/test-repo");

    // adding one hosted
    repository = this.lookup(Repository.class, "maven2");

    CRepository repoConf = new DefaultCRepository();

    repoConf.setProviderRole(Repository.class.getName());
    repoConf.setProviderHint("maven2");
    repoConf.setId("test-repo");

    repoConf.setLocalStorage(new CLocalStorage());
    repoConf.getLocalStorage().setProvider("file");
    repoConf.getLocalStorage().setUrl(repositoryStorageDir.toURI().toURL().toString());

    Xpp3Dom exRepo = new Xpp3Dom("externalConfiguration");
    repoConf.setExternalConfiguration(exRepo);
    M2RepositoryConfiguration exRepoConf = new M2RepositoryConfiguration(exRepo);
    exRepoConf.setRepositoryPolicy(RepositoryPolicy.RELEASE);
    exRepoConf.setChecksumPolicy(ChecksumPolicy.STRICT_IF_EXISTS);

    repository.configure(repoConf);

    applicationConfiguration.getConfigurationModel().addRepository(repoConf);

    this.lookup(RepositoryRegistry.class).addRepository(repository);

    localRepositoryStorageUnderTest = repository.getLocalStorage();

    // write a test file
    File testFile = new File(repositoryStorageDir, testFilePath);
    testFile.getParentFile().mkdirs();
    org.codehaus.plexus.util.FileUtils.fileWrite(testFile, "CONTENT");

    // this test expects "old" behaviour:
    ((DefaultAttributesHandler) repository.getAttributesHandler()).setLastRequestedResolution(0);

    // prime the retrieve
    originalLastAccessTime = primeLastRequestedTimestamp();

    // sleep so we are sure the clock is different when we validate the last update time.
    Thread.sleep(11);
  }
  @Override
  protected CRepositoryCoreConfiguration initCoreConfiguration() {
    CRepository repo = new DefaultCRepository();

    repo.setId("");
    repo.setName("");

    repo.setProviderRole(Repository.class.getName());
    repo.setProviderHint("maven2");

    Xpp3Dom ex = new Xpp3Dom(DefaultCRepository.EXTERNAL_CONFIGURATION_NODE_NAME);
    repo.setExternalConfiguration(ex);

    M2RepositoryConfiguration exConf = new M2RepositoryConfiguration(ex);
    // huh? see initConfig classes
    if (getRepositoryPolicy() != null) {
      exConf.setRepositoryPolicy(getRepositoryPolicy());
    }

    repo.externalConfigurationImple = exConf;

    repo.setWritePolicy(RepositoryWritePolicy.ALLOW_WRITE_ONCE.name());
    repo.setNotFoundCacheTTL(1440);
    repo.setIndexable(true);
    repo.setSearchable(true);

    CRepositoryCoreConfiguration result =
        new CRepositoryCoreConfiguration(
            getTemplateProvider().getApplicationConfiguration(),
            repo,
            new CRepositoryExternalConfigurationHolderFactory<M2RepositoryConfiguration>() {
              public M2RepositoryConfiguration createExternalConfigurationHolder(
                  CRepository config) {
                return new M2RepositoryConfiguration((Xpp3Dom) config.getExternalConfiguration());
              }
            });

    return result;
  }