@Test public void testAdapt_groupRepository() throws Exception { Repository repository = createRepository(new GroupType()); repository.getConfiguration().attributes("group").set("memberNames", Arrays.asList("a", "b")); SimpleApiGroupRepository groupRepository = (SimpleApiGroupRepository) underTest.adapt(repository); assertRepository(groupRepository, "group", true); }
@Override public AbstractApiRepository adapt(final Repository repository) { boolean online = repository.getConfiguration().isOnline(); String name = repository.getName(); String url = repository.getUrl(); switch (repository.getType().toString()) { case HostedType.NAME: return new MavenHostedApiRepository(name, url, online, getHostedStorageAttributes(repository), getCleanupPolicyAttributes(repository), createMavenAttributes(repository)); case ProxyType.NAME: return new MavenProxyApiRepository(name, url, online, getHostedStorageAttributes(repository), getCleanupPolicyAttributes(repository), getProxyAttributes(repository), getNegativeCacheAttributes(repository), getHttpClientAttributes(repository), getRoutingRuleName(repository), createMavenAttributes(repository)); default: return super.adapt(repository); } }
MavenApiRepositoryAdapter extends SimpleApiRepositoryAdapter { @Override public AbstractApiRepository adapt(final Repository repository) { boolean online = repository.getConfiguration().isOnline(); String name = repository.getName(); String url = repository.getUrl(); switch (repository.getType().toString()) { case HostedType.NAME: return new MavenHostedApiRepository(name, url, online, getHostedStorageAttributes(repository), getCleanupPolicyAttributes(repository), createMavenAttributes(repository)); case ProxyType.NAME: return new MavenProxyApiRepository(name, url, online, getHostedStorageAttributes(repository), getCleanupPolicyAttributes(repository), getProxyAttributes(repository), getNegativeCacheAttributes(repository), getHttpClientAttributes(repository), getRoutingRuleName(repository), createMavenAttributes(repository)); default: return super.adapt(repository); } } }
MavenApiRepositoryAdapter extends SimpleApiRepositoryAdapter { @Override public AbstractApiRepository adapt(final Repository repository) { boolean online = repository.getConfiguration().isOnline(); String name = repository.getName(); String url = repository.getUrl(); switch (repository.getType().toString()) { case HostedType.NAME: return new MavenHostedApiRepository(name, url, online, getHostedStorageAttributes(repository), getCleanupPolicyAttributes(repository), createMavenAttributes(repository)); case ProxyType.NAME: return new MavenProxyApiRepository(name, url, online, getHostedStorageAttributes(repository), getCleanupPolicyAttributes(repository), getProxyAttributes(repository), getNegativeCacheAttributes(repository), getHttpClientAttributes(repository), getRoutingRuleName(repository), createMavenAttributes(repository)); default: return super.adapt(repository); } } @Inject  MavenApiRepositoryAdapter(final RoutingRuleStore routingRuleStore); }
MavenApiRepositoryAdapter extends SimpleApiRepositoryAdapter { @Override public AbstractApiRepository adapt(final Repository repository) { boolean online = repository.getConfiguration().isOnline(); String name = repository.getName(); String url = repository.getUrl(); switch (repository.getType().toString()) { case HostedType.NAME: return new MavenHostedApiRepository(name, url, online, getHostedStorageAttributes(repository), getCleanupPolicyAttributes(repository), createMavenAttributes(repository)); case ProxyType.NAME: return new MavenProxyApiRepository(name, url, online, getHostedStorageAttributes(repository), getCleanupPolicyAttributes(repository), getProxyAttributes(repository), getNegativeCacheAttributes(repository), getHttpClientAttributes(repository), getRoutingRuleName(repository), createMavenAttributes(repository)); default: return super.adapt(repository); } } @Inject  MavenApiRepositoryAdapter(final RoutingRuleStore routingRuleStore); @Override AbstractApiRepository adapt(final Repository repository); }
MavenApiRepositoryAdapter extends SimpleApiRepositoryAdapter { @Override public AbstractApiRepository adapt(final Repository repository) { boolean online = repository.getConfiguration().isOnline(); String name = repository.getName(); String url = repository.getUrl(); switch (repository.getType().toString()) { case HostedType.NAME: return new MavenHostedApiRepository(name, url, online, getHostedStorageAttributes(repository), getCleanupPolicyAttributes(repository), createMavenAttributes(repository)); case ProxyType.NAME: return new MavenProxyApiRepository(name, url, online, getHostedStorageAttributes(repository), getCleanupPolicyAttributes(repository), getProxyAttributes(repository), getNegativeCacheAttributes(repository), getHttpClientAttributes(repository), getRoutingRuleName(repository), createMavenAttributes(repository)); default: return super.adapt(repository); } } @Inject  MavenApiRepositoryAdapter(final RoutingRuleStore routingRuleStore); @Override AbstractApiRepository adapt(final Repository repository);  }