implemented rest endpoint for repository types

This commit is contained in:
Sebastian Sdorra
2018-08-02 11:56:35 +02:00
parent b1c65a3a3c
commit 99ecc8cba2
28 changed files with 545 additions and 32 deletions

View File

@@ -32,6 +32,7 @@ package sonia.scm.repository;
import com.google.common.base.Stopwatch;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import com.google.inject.Provider;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException;
@@ -109,7 +110,7 @@ public class DefaultRepositoryManagerPerfTest {
*/
@Before
public void setUpObjectUnderTest(){
when(repositoryHandler.getType()).thenReturn(new Type(REPOSITORY_TYPE, REPOSITORY_TYPE));
when(repositoryHandler.getType()).thenReturn(new RepositoryType(REPOSITORY_TYPE, REPOSITORY_TYPE, Sets.newHashSet()));
Set<RepositoryHandler> handlerSet = ImmutableSet.of(repositoryHandler);
RepositoryMatcher repositoryMatcher = new RepositoryMatcher(Collections.<RepositoryPathMatcher>emptySet());
NamespaceStrategy namespaceStrategy = mock(NamespaceStrategy.class);

View File

@@ -36,6 +36,7 @@ import com.github.legman.Subscribe;
import com.github.sdorra.shiro.ShiroRule;
import com.github.sdorra.shiro.SubjectAware;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import org.apache.shiro.authz.UnauthorizedException;
import org.junit.Rule;
import org.junit.Test;
@@ -482,14 +483,14 @@ public class DefaultRepositoryManagerTest extends ManagerTestBase<Repository, Re
handlerSet.add(new DummyRepositoryHandler(factory));
handlerSet.add(new DummyRepositoryHandler(factory) {
@Override
public Type getType() {
return new Type("hg", "Mercurial");
public RepositoryType getType() {
return new RepositoryType("hg", "Mercurial", Sets.newHashSet());
}
});
handlerSet.add(new DummyRepositoryHandler(factory) {
@Override
public Type getType() {
return new Type("git", "Git");
public RepositoryType getType() {
return new RepositoryType("git", "Git", Sets.newHashSet());
}
});