@Test public void testAdapt_proxyRepositoryStorageAttributes() throws Exception { Repository repository = createRepository(new ProxyType()); setStorageAttributes(repository, "default", false, null); SimpleApiProxyRepository proxyRepository = (SimpleApiProxyRepository) underTest.adapt(repository); assertThat(proxyRepository.getStorage().getBlobStoreName(), is("default")); assertThat(proxyRepository.getStorage().getStrictContentTypeValidation(), is(false)); }
@Override public AbstractApiRepository adapt(final Repository repository) { boolean online = repository.getConfiguration().isOnline(); String name = repository.getName(); String format = repository.getFormat().toString(); String url = repository.getUrl(); switch (repository.getType().toString()) { case GroupType.NAME: return new SimpleApiGroupRepository(name, format, url, online, getStorageAttributes(repository), getGroupAttributes(repository)); case HostedType.NAME: return new SimpleApiHostedRepository(name, format, url, online, getHostedStorageAttributes(repository), getCleanupPolicyAttributes(repository)); case ProxyType.NAME: return new SimpleApiProxyRepository(name, format, url, online, getStorageAttributes(repository), getCleanupPolicyAttributes(repository), getProxyAttributes(repository), getNegativeCacheAttributes(repository), getHttpClientAttributes(repository), getRoutingRuleName(repository)); default: return null; } }
SimpleApiRepositoryAdapter implements ApiRepositoryAdapter { @Override public AbstractApiRepository adapt(final Repository repository) { boolean online = repository.getConfiguration().isOnline(); String name = repository.getName(); String format = repository.getFormat().toString(); String url = repository.getUrl(); switch (repository.getType().toString()) { case GroupType.NAME: return new SimpleApiGroupRepository(name, format, url, online, getStorageAttributes(repository), getGroupAttributes(repository)); case HostedType.NAME: return new SimpleApiHostedRepository(name, format, url, online, getHostedStorageAttributes(repository), getCleanupPolicyAttributes(repository)); case ProxyType.NAME: return new SimpleApiProxyRepository(name, format, url, online, getStorageAttributes(repository), getCleanupPolicyAttributes(repository), getProxyAttributes(repository), getNegativeCacheAttributes(repository), getHttpClientAttributes(repository), getRoutingRuleName(repository)); default: return null; } } }
SimpleApiRepositoryAdapter implements ApiRepositoryAdapter { @Override public AbstractApiRepository adapt(final Repository repository) { boolean online = repository.getConfiguration().isOnline(); String name = repository.getName(); String format = repository.getFormat().toString(); String url = repository.getUrl(); switch (repository.getType().toString()) { case GroupType.NAME: return new SimpleApiGroupRepository(name, format, url, online, getStorageAttributes(repository), getGroupAttributes(repository)); case HostedType.NAME: return new SimpleApiHostedRepository(name, format, url, online, getHostedStorageAttributes(repository), getCleanupPolicyAttributes(repository)); case ProxyType.NAME: return new SimpleApiProxyRepository(name, format, url, online, getStorageAttributes(repository), getCleanupPolicyAttributes(repository), getProxyAttributes(repository), getNegativeCacheAttributes(repository), getHttpClientAttributes(repository), getRoutingRuleName(repository)); default: return null; } } @Inject  SimpleApiRepositoryAdapter(final RoutingRuleStore routingRuleStore); }
SimpleApiRepositoryAdapter implements ApiRepositoryAdapter { @Override public AbstractApiRepository adapt(final Repository repository) { boolean online = repository.getConfiguration().isOnline(); String name = repository.getName(); String format = repository.getFormat().toString(); String url = repository.getUrl(); switch (repository.getType().toString()) { case GroupType.NAME: return new SimpleApiGroupRepository(name, format, url, online, getStorageAttributes(repository), getGroupAttributes(repository)); case HostedType.NAME: return new SimpleApiHostedRepository(name, format, url, online, getHostedStorageAttributes(repository), getCleanupPolicyAttributes(repository)); case ProxyType.NAME: return new SimpleApiProxyRepository(name, format, url, online, getStorageAttributes(repository), getCleanupPolicyAttributes(repository), getProxyAttributes(repository), getNegativeCacheAttributes(repository), getHttpClientAttributes(repository), getRoutingRuleName(repository)); default: return null; } } @Inject  SimpleApiRepositoryAdapter(final RoutingRuleStore routingRuleStore); @Override AbstractApiRepository adapt(final Repository repository); }
SimpleApiRepositoryAdapter implements ApiRepositoryAdapter { @Override public AbstractApiRepository adapt(final Repository repository) { boolean online = repository.getConfiguration().isOnline(); String name = repository.getName(); String format = repository.getFormat().toString(); String url = repository.getUrl(); switch (repository.getType().toString()) { case GroupType.NAME: return new SimpleApiGroupRepository(name, format, url, online, getStorageAttributes(repository), getGroupAttributes(repository)); case HostedType.NAME: return new SimpleApiHostedRepository(name, format, url, online, getHostedStorageAttributes(repository), getCleanupPolicyAttributes(repository)); case ProxyType.NAME: return new SimpleApiProxyRepository(name, format, url, online, getStorageAttributes(repository), getCleanupPolicyAttributes(repository), getProxyAttributes(repository), getNegativeCacheAttributes(repository), getHttpClientAttributes(repository), getRoutingRuleName(repository)); default: return null; } } @Inject  SimpleApiRepositoryAdapter(final RoutingRuleStore routingRuleStore); @Override AbstractApiRepository adapt(final Repository repository);  }