private void assertRepositoryConfiguration(
     List<RepositoryConfiguration> configurations, String... expectedNames) {
   assertThat(configurations).hasSize(expectedNames.length);
   Set<String> actualNames = new HashSet<String>();
   for (RepositoryConfiguration configuration : configurations) {
     actualNames.add(configuration.getName());
   }
   assertThat(actualNames).containsOnly(expectedNames);
 }
Пример #2
0
  private List<RemoteRepository> createRepositories(
      List<RepositoryConfiguration> repositoryConfigurations) {
    List<RemoteRepository> repositories =
        new ArrayList<RemoteRepository>(repositoryConfigurations.size());
    for (RepositoryConfiguration repositoryConfiguration : repositoryConfigurations) {
      RemoteRepository.Builder builder =
          new RemoteRepository.Builder(
              repositoryConfiguration.getName(),
              "default",
              repositoryConfiguration.getUri().toASCIIString());

      if (!repositoryConfiguration.getSnapshotsEnabled()) {
        builder.setSnapshotPolicy(
            new RepositoryPolicy(
                false,
                RepositoryPolicy.UPDATE_POLICY_NEVER,
                RepositoryPolicy.CHECKSUM_POLICY_IGNORE));
      }
      repositories.add(builder.build());
    }
    return repositories;
  }