mirror of
				https://github.com/scm-manager/scm-manager.git
				synced 2025-10-31 18:46:07 +01:00 
			
		
		
		
	Fix integration tests by delegating to existing servlets
This commit is contained in:
		| @@ -41,6 +41,7 @@ import sonia.scm.repository.Repository; | ||||
| import sonia.scm.repository.SvnRepositoryHandler; | ||||
| import sonia.scm.repository.api.Command; | ||||
| import sonia.scm.repository.api.ScmProtocol; | ||||
| import sonia.scm.web.SvnDAVServlet; | ||||
|  | ||||
| import java.io.IOException; | ||||
| import java.util.Collections; | ||||
| @@ -193,8 +194,7 @@ public class SvnRepositoryServiceProvider extends RepositoryServiceProvider | ||||
|  | ||||
|   @Override | ||||
|   public Set<ScmProtocol> getSupportedProtocols() { | ||||
|     // TODO #9247 | ||||
|     return Collections.emptySet(); | ||||
|     return Collections.singleton(new SvnDAVServlet(null, null, null, null)); | ||||
|   } | ||||
|  | ||||
|   //~--- fields --------------------------------------------------------------- | ||||
|   | ||||
| @@ -45,6 +45,7 @@ import sonia.scm.repository.Repository; | ||||
| import sonia.scm.repository.RepositoryProvider; | ||||
| import sonia.scm.repository.RepositoryRequestListenerUtil; | ||||
| import sonia.scm.repository.SvnRepositoryHandler; | ||||
| import sonia.scm.repository.spi.HttpScmProtocol; | ||||
| import sonia.scm.util.AssertUtil; | ||||
| import sonia.scm.util.HttpUtil; | ||||
|  | ||||
| @@ -52,7 +53,9 @@ import javax.servlet.ServletException; | ||||
| import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletRequestWrapper; | ||||
| import javax.servlet.http.HttpServletResponse; | ||||
| import javax.ws.rs.core.UriInfo; | ||||
| import java.io.IOException; | ||||
| import java.net.URI; | ||||
|  | ||||
| //~--- JDK imports ------------------------------------------------------------ | ||||
|  | ||||
| @@ -61,7 +64,7 @@ import java.io.IOException; | ||||
|  * @author Sebastian Sdorra | ||||
|  */ | ||||
| @Singleton | ||||
| public class SvnDAVServlet extends DAVServlet | ||||
| public class SvnDAVServlet extends DAVServlet implements HttpScmProtocol | ||||
| { | ||||
|  | ||||
|   /** Field description */ | ||||
| @@ -283,6 +286,16 @@ public class SvnDAVServlet extends DAVServlet | ||||
|     private final RepositoryProvider repositoryProvider; | ||||
|   } | ||||
|  | ||||
|   @Override | ||||
|   public void serve(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||||
|     service(request, response); | ||||
|   } | ||||
|  | ||||
|   @Override | ||||
|   public String getUrl(Repository repository, UriInfo uriInfo) { | ||||
|     return uriInfo.getBaseUri().resolve(URI.create("../../svn/" + repository.getNamespace() + "/" + repository.getName())).toASCIIString(); | ||||
|   } | ||||
|  | ||||
|  | ||||
|   //~--- fields --------------------------------------------------------------- | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user