mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
move rename logic to repository manager
This commit is contained in:
@@ -24,14 +24,19 @@
|
|||||||
|
|
||||||
package sonia.scm.repository;
|
package sonia.scm.repository;
|
||||||
|
|
||||||
import sonia.scm.HandlerEventType;
|
import sonia.scm.BadRequestException;
|
||||||
import sonia.scm.event.AbstractHandlerEvent;
|
import sonia.scm.ContextEntry;
|
||||||
import sonia.scm.event.Event;
|
|
||||||
|
|
||||||
@Event
|
public class ChangeNamespaceNotAllowedException extends BadRequestException {
|
||||||
public class RepositoryRenamedEvent extends AbstractHandlerEvent<Repository> {
|
|
||||||
|
|
||||||
public RepositoryRenamedEvent(HandlerEventType eventType, Repository item, Repository oldItem) {
|
public ChangeNamespaceNotAllowedException(Repository repository) {
|
||||||
super(eventType, item, oldItem);
|
super(ContextEntry.ContextBuilder.entity(repository).build(), "change of namespace is not allowed in current namespace strategy");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final String CODE = "ERS2vYb7U1";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCode() {
|
||||||
|
return CODE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sonia.scm.repository;
|
package sonia.scm.repository;
|
||||||
|
|
||||||
//~--- non-JDK imports --------------------------------------------------------
|
//~--- non-JDK imports --------------------------------------------------------
|
||||||
@@ -38,18 +38,15 @@ import java.util.Collection;
|
|||||||
* This class is a singleton and is available via injection.
|
* This class is a singleton and is available via injection.
|
||||||
*
|
*
|
||||||
* @author Sebastian Sdorra
|
* @author Sebastian Sdorra
|
||||||
*
|
|
||||||
* @apiviz.uses sonia.scm.repository.RepositoryHandler
|
* @apiviz.uses sonia.scm.repository.RepositoryHandler
|
||||||
*/
|
*/
|
||||||
public interface RepositoryManager
|
public interface RepositoryManager
|
||||||
extends TypeManager<Repository, RepositoryHandler>
|
extends TypeManager<Repository, RepositoryHandler> {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fire {@link RepositoryHookEvent} to the event bus.
|
* Fire {@link RepositoryHookEvent} to the event bus.
|
||||||
*
|
*
|
||||||
* @param event hook event
|
* @param event hook event
|
||||||
*
|
|
||||||
* @since 2.0.0
|
* @since 2.0.0
|
||||||
*/
|
*/
|
||||||
public void fireHookEvent(RepositoryHookEvent event);
|
public void fireHookEvent(RepositoryHookEvent event);
|
||||||
@@ -58,9 +55,7 @@ public interface RepositoryManager
|
|||||||
* Imports an existing {@link Repository}.
|
* Imports an existing {@link Repository}.
|
||||||
* Note: This method should only be called from a {@link RepositoryHandler}.
|
* Note: This method should only be called from a {@link RepositoryHandler}.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @param repository {@link Repository} to import
|
* @param repository {@link Repository} to import
|
||||||
*
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public void importRepository(Repository repository) throws IOException;
|
public void importRepository(Repository repository) throws IOException;
|
||||||
@@ -71,10 +66,7 @@ public interface RepositoryManager
|
|||||||
* Returns a {@link Repository} by its namespace and name or
|
* Returns a {@link Repository} by its namespace and name or
|
||||||
* null if the {@link Repository} could not be found.
|
* null if the {@link Repository} could not be found.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @param namespaceAndName namespace and name of the {@link Repository}
|
* @param namespaceAndName namespace and name of the {@link Repository}
|
||||||
*
|
|
||||||
*
|
|
||||||
* @return {@link Repository} by its namespace and name or null
|
* @return {@link Repository} by its namespace and name or null
|
||||||
* if the {@link Repository} could not be found
|
* if the {@link Repository} could not be found
|
||||||
*/
|
*/
|
||||||
@@ -83,7 +75,6 @@ public interface RepositoryManager
|
|||||||
/**
|
/**
|
||||||
* Returns all configured repository types.
|
* Returns all configured repository types.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @return all configured repository types
|
* @return all configured repository types
|
||||||
*/
|
*/
|
||||||
public Collection<RepositoryType> getConfiguredTypes();
|
public Collection<RepositoryType> getConfiguredTypes();
|
||||||
@@ -91,11 +82,17 @@ public interface RepositoryManager
|
|||||||
/**
|
/**
|
||||||
* Returns a {@link RepositoryHandler} by the given type (hg, git, svn ...).
|
* Returns a {@link RepositoryHandler} by the given type (hg, git, svn ...).
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @param type the type of the {@link RepositoryHandler}
|
* @param type the type of the {@link RepositoryHandler}
|
||||||
*
|
|
||||||
* @return {@link RepositoryHandler} by the given type
|
* @return {@link RepositoryHandler} by the given type
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public RepositoryHandler getHandler(String type);
|
public RepositoryHandler getHandler(String type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param repository the repository {@link Repository}
|
||||||
|
* @param newNameSpace the new repository namespace
|
||||||
|
* @param newName the new repository name
|
||||||
|
* @return {@link Repository} the renamed repository
|
||||||
|
*/
|
||||||
|
public Repository rename(Repository repository, String newNameSpace, String newName);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sonia.scm.repository;
|
package sonia.scm.repository;
|
||||||
|
|
||||||
//~--- non-JDK imports --------------------------------------------------------
|
//~--- non-JDK imports --------------------------------------------------------
|
||||||
@@ -42,17 +42,14 @@ import java.util.Collection;
|
|||||||
*/
|
*/
|
||||||
public class RepositoryManagerDecorator
|
public class RepositoryManagerDecorator
|
||||||
extends ManagerDecorator<Repository>
|
extends ManagerDecorator<Repository>
|
||||||
implements RepositoryManager
|
implements RepositoryManager {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs ...
|
* Constructs ...
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @param decorated
|
* @param decorated
|
||||||
*/
|
*/
|
||||||
public RepositoryManagerDecorator(RepositoryManager decorated)
|
public RepositoryManagerDecorator(RepositoryManager decorated) {
|
||||||
{
|
|
||||||
super(decorated);
|
super(decorated);
|
||||||
this.decorated = decorated;
|
this.decorated = decorated;
|
||||||
}
|
}
|
||||||
@@ -63,8 +60,7 @@ public class RepositoryManagerDecorator
|
|||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void fireHookEvent(RepositoryHookEvent event)
|
public void fireHookEvent(RepositoryHookEvent event) {
|
||||||
{
|
|
||||||
decorated.fireHookEvent(event);
|
decorated.fireHookEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,65 +75,66 @@ public class RepositoryManagerDecorator
|
|||||||
//~--- get methods ----------------------------------------------------------
|
//~--- get methods ----------------------------------------------------------
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Repository get(NamespaceAndName namespaceAndName)
|
public Repository get(NamespaceAndName namespaceAndName) {
|
||||||
{
|
|
||||||
return decorated.get(namespaceAndName);
|
return decorated.get(namespaceAndName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Collection<RepositoryType> getConfiguredTypes()
|
public Collection<RepositoryType> getConfiguredTypes() {
|
||||||
{
|
|
||||||
return decorated.getConfiguredTypes();
|
return decorated.getConfiguredTypes();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the decorated {@link RepositoryManager}.
|
* Returns the decorated {@link RepositoryManager}.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @return decorated {@link RepositoryManager}
|
* @return decorated {@link RepositoryManager}
|
||||||
*
|
|
||||||
* @since 1.34
|
* @since 1.34
|
||||||
*/
|
*/
|
||||||
public RepositoryManager getDecorated()
|
public RepositoryManager getDecorated() {
|
||||||
{
|
|
||||||
return decorated;
|
return decorated;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @param type
|
* @param type
|
||||||
*
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public RepositoryHandler getHandler(String type)
|
public RepositoryHandler getHandler(String type) {
|
||||||
{
|
|
||||||
return decorated.getHandler(type);
|
return decorated.getHandler(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Collection<Type> getTypes() {
|
||||||
|
return decorated.getTypes();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Collection<Type> getTypes()
|
public Repository rename(Repository repository, String newNamespace, String newName) {
|
||||||
{
|
return decorated.rename(repository, newNamespace, newName);
|
||||||
return decorated.getTypes();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//~--- fields ---------------------------------------------------------------
|
//~--- fields ---------------------------------------------------------------
|
||||||
|
|
||||||
/** Field description */
|
/**
|
||||||
|
* Field description
|
||||||
|
*/
|
||||||
private final RepositoryManager decorated;
|
private final RepositoryManager decorated;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public final class RepositoryModificationEvent extends RepositoryEvent implement
|
|||||||
*/
|
*/
|
||||||
public RepositoryModificationEvent(HandlerEventType eventType, Repository item, Repository itemBeforeModification)
|
public RepositoryModificationEvent(HandlerEventType eventType, Repository item, Repository itemBeforeModification)
|
||||||
{
|
{
|
||||||
super(eventType, item);
|
super(eventType, item, itemBeforeModification);
|
||||||
this.itemBeforeModification = itemBeforeModification;
|
this.itemBeforeModification = itemBeforeModification;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -116,4 +116,4 @@ const mapDispatchToProps = (dispatch: any) => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export default compose(connect(mapStateToProps, mapDispatchToProps))(withRouter(EditRepo));
|
export default compose(connect(mapStateToProps, mapDispatchToProps), withRouter)(EditRepo);
|
||||||
|
|||||||
@@ -24,19 +24,13 @@
|
|||||||
|
|
||||||
package sonia.scm.api.v2.resources;
|
package sonia.scm.api.v2.resources;
|
||||||
|
|
||||||
import com.google.common.base.Strings;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.media.Content;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import sonia.scm.HandlerEventType;
|
|
||||||
import sonia.scm.config.ScmConfiguration;
|
|
||||||
import sonia.scm.event.ScmEventBus;
|
|
||||||
import sonia.scm.repository.NamespaceAndName;
|
import sonia.scm.repository.NamespaceAndName;
|
||||||
import sonia.scm.repository.Repository;
|
import sonia.scm.repository.Repository;
|
||||||
import sonia.scm.repository.RepositoryManager;
|
import sonia.scm.repository.RepositoryManager;
|
||||||
import sonia.scm.repository.RepositoryPermissions;
|
|
||||||
import sonia.scm.repository.RepositoryRenamedEvent;
|
|
||||||
import sonia.scm.web.VndMediaType;
|
import sonia.scm.web.VndMediaType;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@@ -65,22 +59,17 @@ public class RepositoryResource {
|
|||||||
private final RepositoryManager manager;
|
private final RepositoryManager manager;
|
||||||
private final SingleResourceManagerAdapter<Repository, RepositoryDto> adapter;
|
private final SingleResourceManagerAdapter<Repository, RepositoryDto> adapter;
|
||||||
private final RepositoryBasedResourceProvider resourceProvider;
|
private final RepositoryBasedResourceProvider resourceProvider;
|
||||||
private final ScmConfiguration scmConfiguration;
|
|
||||||
private final ScmEventBus scmEventBus;
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public RepositoryResource(
|
public RepositoryResource(
|
||||||
RepositoryToRepositoryDtoMapper repositoryToDtoMapper,
|
RepositoryToRepositoryDtoMapper repositoryToDtoMapper,
|
||||||
RepositoryDtoToRepositoryMapper dtoToRepositoryMapper, RepositoryManager manager,
|
RepositoryDtoToRepositoryMapper dtoToRepositoryMapper, RepositoryManager manager,
|
||||||
RepositoryBasedResourceProvider resourceProvider,
|
RepositoryBasedResourceProvider resourceProvider) {
|
||||||
ScmConfiguration scmConfiguration, ScmEventBus scmEventBus) {
|
|
||||||
this.dtoToRepositoryMapper = dtoToRepositoryMapper;
|
this.dtoToRepositoryMapper = dtoToRepositoryMapper;
|
||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
this.repositoryToDtoMapper = repositoryToDtoMapper;
|
this.repositoryToDtoMapper = repositoryToDtoMapper;
|
||||||
this.adapter = new SingleResourceManagerAdapter<>(manager, Repository.class);
|
this.adapter = new SingleResourceManagerAdapter<>(manager, Repository.class);
|
||||||
this.resourceProvider = resourceProvider;
|
this.resourceProvider = resourceProvider;
|
||||||
this.scmConfiguration = scmConfiguration;
|
|
||||||
this.scmEventBus = scmEventBus;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -210,48 +199,11 @@ public class RepositoryResource {
|
|||||||
))
|
))
|
||||||
@ApiResponse(responseCode = "500", description = "internal server error")
|
@ApiResponse(responseCode = "500", description = "internal server error")
|
||||||
public Response rename(@PathParam("namespace") String namespace, @PathParam("name") String name, @Valid RepositoryRenameDto renameDto) {
|
public Response rename(@PathParam("namespace") String namespace, @PathParam("name") String name, @Valid RepositoryRenameDto renameDto) {
|
||||||
Supplier<Repository> repoSupplier = loadBy(namespace, name);
|
Repository repository = loadBy(namespace, name).get();
|
||||||
Repository unchangedRepo = repoSupplier.get();
|
manager.rename(repository, renameDto.getNamespace(), renameDto.getName());
|
||||||
Repository changedRepo = unchangedRepo.clone();
|
return Response.status(204).build();
|
||||||
|
|
||||||
if (isRenameForbidden(unchangedRepo, renameDto)) {
|
|
||||||
return Response.status(403).build();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hasNamespaceOrNameNotChanged(unchangedRepo, renameDto)) {
|
|
||||||
return Response.status(400).build();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Strings.isNullOrEmpty(renameDto.getName())) {
|
|
||||||
changedRepo.setName(renameDto.getName());
|
|
||||||
}
|
|
||||||
if (!Strings.isNullOrEmpty(renameDto.getNamespace())) {
|
|
||||||
changedRepo.setNamespace(renameDto.getNamespace());
|
|
||||||
}
|
|
||||||
|
|
||||||
return adapter.update(
|
|
||||||
repoSupplier,
|
|
||||||
existing -> {
|
|
||||||
scmEventBus.post(new RepositoryRenamedEvent(HandlerEventType.MODIFY, changedRepo, unchangedRepo));
|
|
||||||
return changedRepo;
|
|
||||||
},
|
|
||||||
changed -> true,
|
|
||||||
r -> r.getNamespaceAndName().logString()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasNamespaceOrNameNotChanged(Repository repo, @Valid RepositoryRenameDto renameDto) {
|
|
||||||
return repo.getName().equals(renameDto.getName())
|
|
||||||
&& repo.getNamespace().equals(renameDto.getNamespace());
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isRenameForbidden(Repository repo, RepositoryRenameDto renameDto) {
|
|
||||||
return !scmConfiguration.getNamespaceStrategy().equals("CustomNamespaceStrategy")
|
|
||||||
&& !repo.getNamespace().equals(renameDto.getNamespace())
|
|
||||||
|| !RepositoryPermissions.rename(repo).isPermitted();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private Repository processUpdate(RepositoryDto repositoryDto, Repository existing) {
|
private Repository processUpdate(RepositoryDto repositoryDto, Repository existing) {
|
||||||
Repository changedRepository = dtoToRepositoryMapper.map(repositoryDto, existing.getId());
|
Repository changedRepository = dtoToRepositoryMapper.map(repositoryDto, existing.getId());
|
||||||
changedRepository.setPermissions(existing.getPermissions());
|
changedRepository.setPermissions(existing.getPermissions());
|
||||||
|
|||||||
@@ -21,10 +21,11 @@
|
|||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sonia.scm.repository;
|
package sonia.scm.repository;
|
||||||
|
|
||||||
import com.github.sdorra.ssp.PermissionActionCheck;
|
import com.github.sdorra.ssp.PermissionActionCheck;
|
||||||
|
import com.google.common.base.Strings;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
@@ -35,6 +36,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
import sonia.scm.ConfigurationException;
|
import sonia.scm.ConfigurationException;
|
||||||
import sonia.scm.HandlerEventType;
|
import sonia.scm.HandlerEventType;
|
||||||
import sonia.scm.ManagerDaoAdapter;
|
import sonia.scm.ManagerDaoAdapter;
|
||||||
|
import sonia.scm.NoChangesMadeException;
|
||||||
import sonia.scm.NotFoundException;
|
import sonia.scm.NotFoundException;
|
||||||
import sonia.scm.SCMContextProvider;
|
import sonia.scm.SCMContextProvider;
|
||||||
import sonia.scm.Type;
|
import sonia.scm.Type;
|
||||||
@@ -83,7 +85,6 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager {
|
|||||||
private final Provider<NamespaceStrategy> namespaceStrategyProvider;
|
private final Provider<NamespaceStrategy> namespaceStrategyProvider;
|
||||||
private final ManagerDaoAdapter<Repository> managerDaoAdapter;
|
private final ManagerDaoAdapter<Repository> managerDaoAdapter;
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public DefaultRepositoryManager(ScmConfiguration configuration,
|
public DefaultRepositoryManager(ScmConfiguration configuration,
|
||||||
SCMContextProvider contextProvider, KeyGenerator keyGenerator,
|
SCMContextProvider contextProvider, KeyGenerator keyGenerator,
|
||||||
@@ -154,7 +155,7 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void delete(Repository repository){
|
public void delete(Repository repository) {
|
||||||
logger.info("delete repository {}/{} of type {}", repository.getNamespace(), repository.getName(), repository.getType());
|
logger.info("delete repository {}/{} of type {}", repository.getNamespace(), repository.getName(), repository.getType());
|
||||||
managerDaoAdapter.delete(
|
managerDaoAdapter.delete(
|
||||||
repository,
|
repository,
|
||||||
@@ -179,7 +180,7 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void modify(Repository repository){
|
public void modify(Repository repository) {
|
||||||
logger.info("modify repository {}/{} of type {}", repository.getNamespace(), repository.getName(), repository.getType());
|
logger.info("modify repository {}/{} of type {}", repository.getNamespace(), repository.getName(), repository.getType());
|
||||||
|
|
||||||
managerDaoAdapter.modify(
|
managerDaoAdapter.modify(
|
||||||
@@ -243,6 +244,40 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager {
|
|||||||
return repository;
|
return repository;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Repository rename(Repository repository, String newNamespace, String newName) {
|
||||||
|
|
||||||
|
if (!configuration.getNamespaceStrategy().equals("CustomNamespaceStrategy")
|
||||||
|
&& !repository.getNamespace().equals(newNamespace)) {
|
||||||
|
throw new ChangeNamespaceNotAllowedException(repository);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasNamespaceOrNameNotChanged(repository, newNamespace, newName)) {
|
||||||
|
throw new NoChangesMadeException(repository);
|
||||||
|
}
|
||||||
|
|
||||||
|
Repository changedRepository = repository.clone();
|
||||||
|
if (!Strings.isNullOrEmpty(newName)) {
|
||||||
|
changedRepository.setName(newName);
|
||||||
|
}
|
||||||
|
if (!Strings.isNullOrEmpty(newNamespace)) {
|
||||||
|
changedRepository.setNamespace(newNamespace);
|
||||||
|
}
|
||||||
|
|
||||||
|
managerDaoAdapter.modify(
|
||||||
|
changedRepository,
|
||||||
|
RepositoryPermissions::rename,
|
||||||
|
notModified -> {
|
||||||
|
},
|
||||||
|
notModified -> fireEvent(HandlerEventType.MODIFY, changedRepository, repository));
|
||||||
|
|
||||||
|
return changedRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean hasNamespaceOrNameNotChanged(Repository repository, String newNamespace, String newName) {
|
||||||
|
return repository.getName().equals(newName)
|
||||||
|
&& repository.getNamespace().equals(newNamespace);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<Repository> getAll(Predicate<Repository> filter, Comparator<Repository> comparator) {
|
public Collection<Repository> getAll(Predicate<Repository> filter, Comparator<Repository> comparator) {
|
||||||
List<Repository> repositories = Lists.newArrayList();
|
List<Repository> repositories = Lists.newArrayList();
|
||||||
@@ -345,8 +380,7 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager {
|
|||||||
types.add(type);
|
types.add(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
private RepositoryHandler getHandler(Repository repository)
|
private RepositoryHandler getHandler(Repository repository) {
|
||||||
{
|
|
||||||
String type = repository.getType();
|
String type = repository.getType();
|
||||||
RepositoryHandler handler = handlerMap.get(type);
|
RepositoryHandler handler = handlerMap.get(type);
|
||||||
|
|
||||||
|
|||||||
@@ -191,6 +191,10 @@
|
|||||||
"displayName": "Es wurden keine Änderungen durchgeführt",
|
"displayName": "Es wurden keine Änderungen durchgeführt",
|
||||||
"description": "Das Repository wurde nicht verändert. Daher konnte kein neuer Commit erzeugt werden. Womöglich werden Änderungen aufgrund einer .ignore-Datei Definition nicht berücksichtigt."
|
"description": "Das Repository wurde nicht verändert. Daher konnte kein neuer Commit erzeugt werden. Womöglich werden Änderungen aufgrund einer .ignore-Datei Definition nicht berücksichtigt."
|
||||||
},
|
},
|
||||||
|
"ERS2vYb7U1": {
|
||||||
|
"displayName": "Änderung des Namespace nicht möglich",
|
||||||
|
"description": "Namespaces dürfen nur mit der Namespace Strategie \"Benutzerdefiniert\" verändert werden."
|
||||||
|
},
|
||||||
"4iRct4avG1": {
|
"4iRct4avG1": {
|
||||||
"displayName": "Die Revisionen haben keinen gemeinsamen Ursprung",
|
"displayName": "Die Revisionen haben keinen gemeinsamen Ursprung",
|
||||||
"description": "Die Historie der Revisionen hat keinen gemeinsamen Urspung und kann somit auch nicht gegen einen solchen verglichen werden."
|
"description": "Die Historie der Revisionen hat keinen gemeinsamen Urspung und kann somit auch nicht gegen einen solchen verglichen werden."
|
||||||
|
|||||||
@@ -197,6 +197,10 @@
|
|||||||
"displayName": "No changes were made",
|
"displayName": "No changes were made",
|
||||||
"description": "No changes were made to the files of the repository. Therefor no new commit could be created. Possibly changes cannot be applied due to an .ignore-File definition."
|
"description": "No changes were made to the files of the repository. Therefor no new commit could be created. Possibly changes cannot be applied due to an .ignore-File definition."
|
||||||
},
|
},
|
||||||
|
"ERS2vYb7U1": {
|
||||||
|
"displayName": "Illegal change of namespace",
|
||||||
|
"description": "Namespaces can only be changed if namespace strategy is \"custom\"."
|
||||||
|
},
|
||||||
"4iRct4avG1": {
|
"4iRct4avG1": {
|
||||||
"displayName": "The revisions have unrelated histories",
|
"displayName": "The revisions have unrelated histories",
|
||||||
"description": "The revisions have unrelated histories. Therefor there is no common commit to compare with."
|
"description": "The revisions have unrelated histories. Therefor there is no common commit to compare with."
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ package sonia.scm.api.v2.resources;
|
|||||||
import com.github.sdorra.shiro.ShiroRule;
|
import com.github.sdorra.shiro.ShiroRule;
|
||||||
import com.github.sdorra.shiro.SubjectAware;
|
import com.github.sdorra.shiro.SubjectAware;
|
||||||
import com.google.common.io.Resources;
|
import com.google.common.io.Resources;
|
||||||
import com.google.inject.util.Providers;
|
|
||||||
import org.apache.shiro.subject.SimplePrincipalCollection;
|
import org.apache.shiro.subject.SimplePrincipalCollection;
|
||||||
import org.apache.shiro.subject.Subject;
|
import org.apache.shiro.subject.Subject;
|
||||||
import org.jboss.resteasy.mock.MockHttpRequest;
|
import org.jboss.resteasy.mock.MockHttpRequest;
|
||||||
@@ -35,19 +34,16 @@ import org.jboss.resteasy.mock.MockHttpResponse;
|
|||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.jupiter.api.Nested;
|
|
||||||
import org.mockito.ArgumentCaptor;
|
import org.mockito.ArgumentCaptor;
|
||||||
import org.mockito.Captor;
|
import org.mockito.Captor;
|
||||||
import org.mockito.InjectMocks;
|
import org.mockito.InjectMocks;
|
||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
import sonia.scm.PageResult;
|
import sonia.scm.PageResult;
|
||||||
import sonia.scm.config.ScmConfiguration;
|
import sonia.scm.config.ScmConfiguration;
|
||||||
import sonia.scm.event.ScmEventBus;
|
|
||||||
import sonia.scm.repository.NamespaceAndName;
|
import sonia.scm.repository.NamespaceAndName;
|
||||||
import sonia.scm.repository.Repository;
|
import sonia.scm.repository.Repository;
|
||||||
import sonia.scm.repository.RepositoryInitializer;
|
import sonia.scm.repository.RepositoryInitializer;
|
||||||
import sonia.scm.repository.RepositoryManager;
|
import sonia.scm.repository.RepositoryManager;
|
||||||
import sonia.scm.repository.RepositoryRenamedEvent;
|
|
||||||
import sonia.scm.repository.api.RepositoryService;
|
import sonia.scm.repository.api.RepositoryService;
|
||||||
import sonia.scm.repository.api.RepositoryServiceFactory;
|
import sonia.scm.repository.api.RepositoryServiceFactory;
|
||||||
import sonia.scm.user.User;
|
import sonia.scm.user.User;
|
||||||
@@ -66,7 +62,6 @@ import static java.util.Collections.singletonList;
|
|||||||
import static java.util.stream.Stream.of;
|
import static java.util.stream.Stream.of;
|
||||||
import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
|
import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
|
||||||
import static javax.servlet.http.HttpServletResponse.SC_CONFLICT;
|
import static javax.servlet.http.HttpServletResponse.SC_CONFLICT;
|
||||||
import static javax.servlet.http.HttpServletResponse.SC_FORBIDDEN;
|
|
||||||
import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND;
|
import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND;
|
||||||
import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT;
|
import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT;
|
||||||
import static javax.servlet.http.HttpServletResponse.SC_OK;
|
import static javax.servlet.http.HttpServletResponse.SC_OK;
|
||||||
@@ -109,9 +104,7 @@ public class RepositoryRootResourceTest extends RepositoryTestBase {
|
|||||||
@Mock
|
@Mock
|
||||||
private RepositoryInitializer repositoryInitializer;
|
private RepositoryInitializer repositoryInitializer;
|
||||||
@Mock
|
@Mock
|
||||||
private ScmConfiguration scmConfiguration;
|
private ScmConfiguration configuration;
|
||||||
@Mock
|
|
||||||
private ScmEventBus scmEventBus;
|
|
||||||
|
|
||||||
@Captor
|
@Captor
|
||||||
private ArgumentCaptor<Predicate<Repository>> filterCaptor;
|
private ArgumentCaptor<Predicate<Repository>> filterCaptor;
|
||||||
@@ -130,14 +123,11 @@ public class RepositoryRootResourceTest extends RepositoryTestBase {
|
|||||||
super.repositoryToDtoMapper = repositoryToDtoMapper;
|
super.repositoryToDtoMapper = repositoryToDtoMapper;
|
||||||
super.dtoToRepositoryMapper = dtoToRepositoryMapper;
|
super.dtoToRepositoryMapper = dtoToRepositoryMapper;
|
||||||
super.manager = repositoryManager;
|
super.manager = repositoryManager;
|
||||||
super.scmConfiguration = scmConfiguration;
|
|
||||||
super.scmEventBus = scmEventBus;
|
|
||||||
RepositoryCollectionToDtoMapper repositoryCollectionToDtoMapper = new RepositoryCollectionToDtoMapper(repositoryToDtoMapper, resourceLinks);
|
RepositoryCollectionToDtoMapper repositoryCollectionToDtoMapper = new RepositoryCollectionToDtoMapper(repositoryToDtoMapper, resourceLinks);
|
||||||
super.repositoryCollectionResource = new RepositoryCollectionResource(repositoryManager, repositoryCollectionToDtoMapper, dtoToRepositoryMapper, resourceLinks, repositoryInitializer);
|
super.repositoryCollectionResource = new RepositoryCollectionResource(repositoryManager, repositoryCollectionToDtoMapper, dtoToRepositoryMapper, resourceLinks, repositoryInitializer);
|
||||||
dispatcher.addSingletonResource(getRepositoryRootResource());
|
dispatcher.addSingletonResource(getRepositoryRootResource());
|
||||||
when(serviceFactory.create(any(Repository.class))).thenReturn(service);
|
when(serviceFactory.create(any(Repository.class))).thenReturn(service);
|
||||||
when(scmPathInfoStore.get()).thenReturn(uriInfo);
|
when(scmPathInfoStore.get()).thenReturn(uriInfo);
|
||||||
when(scmConfiguration.getNamespaceStrategy()).thenReturn("CustomNamespaceStrategy");
|
|
||||||
when(uriInfo.getApiRestUri()).thenReturn(URI.create("/x/y"));
|
when(uriInfo.getApiRestUri()).thenReturn(URI.create("/x/y"));
|
||||||
SimplePrincipalCollection trillian = new SimplePrincipalCollection("trillian", REALM);
|
SimplePrincipalCollection trillian = new SimplePrincipalCollection("trillian", REALM);
|
||||||
trillian.add(new User("trillian"), REALM);
|
trillian.add(new User("trillian"), REALM);
|
||||||
@@ -164,6 +154,7 @@ public class RepositoryRootResourceTest extends RepositoryTestBase {
|
|||||||
@Test
|
@Test
|
||||||
public void shouldFindExistingRepository() throws URISyntaxException, UnsupportedEncodingException {
|
public void shouldFindExistingRepository() throws URISyntaxException, UnsupportedEncodingException {
|
||||||
mockRepository("space", "repo");
|
mockRepository("space", "repo");
|
||||||
|
when(configuration.getNamespaceStrategy()).thenReturn("CustomNamespaceStrategy");
|
||||||
|
|
||||||
MockHttpRequest request = MockHttpRequest.get("/" + RepositoryRootResource.REPOSITORIES_PATH_V2 + "space/repo");
|
MockHttpRequest request = MockHttpRequest.get("/" + RepositoryRootResource.REPOSITORIES_PATH_V2 + "space/repo");
|
||||||
MockHttpResponse response = new MockHttpResponse();
|
MockHttpResponse response = new MockHttpResponse();
|
||||||
@@ -178,6 +169,7 @@ public class RepositoryRootResourceTest extends RepositoryTestBase {
|
|||||||
public void shouldGetAll() throws URISyntaxException, UnsupportedEncodingException {
|
public void shouldGetAll() throws URISyntaxException, UnsupportedEncodingException {
|
||||||
PageResult<Repository> singletonPageResult = createSingletonPageResult(mockRepository("space", "repo"));
|
PageResult<Repository> singletonPageResult = createSingletonPageResult(mockRepository("space", "repo"));
|
||||||
when(repositoryManager.getPage(any(), any(), eq(0), eq(10))).thenReturn(singletonPageResult);
|
when(repositoryManager.getPage(any(), any(), eq(0), eq(10))).thenReturn(singletonPageResult);
|
||||||
|
when(configuration.getNamespaceStrategy()).thenReturn("CustomNamespaceStrategy");
|
||||||
|
|
||||||
MockHttpRequest request = MockHttpRequest.get("/" + RepositoryRootResource.REPOSITORIES_PATH_V2);
|
MockHttpRequest request = MockHttpRequest.get("/" + RepositoryRootResource.REPOSITORIES_PATH_V2);
|
||||||
MockHttpResponse response = new MockHttpResponse();
|
MockHttpResponse response = new MockHttpResponse();
|
||||||
@@ -192,6 +184,7 @@ public class RepositoryRootResourceTest extends RepositoryTestBase {
|
|||||||
public void shouldCreateFilterForSearch() throws URISyntaxException {
|
public void shouldCreateFilterForSearch() throws URISyntaxException {
|
||||||
PageResult<Repository> singletonPageResult = createSingletonPageResult(mockRepository("space", "repo"));
|
PageResult<Repository> singletonPageResult = createSingletonPageResult(mockRepository("space", "repo"));
|
||||||
when(repositoryManager.getPage(filterCaptor.capture(), any(), eq(0), eq(10))).thenReturn(singletonPageResult);
|
when(repositoryManager.getPage(filterCaptor.capture(), any(), eq(0), eq(10))).thenReturn(singletonPageResult);
|
||||||
|
when(configuration.getNamespaceStrategy()).thenReturn("CustomNamespaceStrategy");
|
||||||
|
|
||||||
MockHttpRequest request = MockHttpRequest.get("/" + RepositoryRootResource.REPOSITORIES_PATH_V2 + "?q=Rep");
|
MockHttpRequest request = MockHttpRequest.get("/" + RepositoryRootResource.REPOSITORIES_PATH_V2 + "?q=Rep");
|
||||||
MockHttpResponse response = new MockHttpResponse();
|
MockHttpResponse response = new MockHttpResponse();
|
||||||
@@ -374,6 +367,7 @@ public class RepositoryRootResourceTest extends RepositoryTestBase {
|
|||||||
public void shouldCreateArrayOfProtocolUrls() throws Exception {
|
public void shouldCreateArrayOfProtocolUrls() throws Exception {
|
||||||
mockRepository("space", "repo");
|
mockRepository("space", "repo");
|
||||||
when(service.getSupportedProtocols()).thenReturn(of(new MockScmProtocol("http", "http://"), new MockScmProtocol("ssh", "ssh://")));
|
when(service.getSupportedProtocols()).thenReturn(of(new MockScmProtocol("http", "http://"), new MockScmProtocol("ssh", "ssh://")));
|
||||||
|
when(configuration.getNamespaceStrategy()).thenReturn("CustomNamespaceStrategy");
|
||||||
|
|
||||||
MockHttpRequest request = MockHttpRequest.get("/" + RepositoryRootResource.REPOSITORIES_PATH_V2 + "space/repo");
|
MockHttpRequest request = MockHttpRequest.get("/" + RepositoryRootResource.REPOSITORIES_PATH_V2 + "space/repo");
|
||||||
MockHttpResponse response = new MockHttpResponse();
|
MockHttpResponse response = new MockHttpResponse();
|
||||||
@@ -384,48 +378,12 @@ public class RepositoryRootResourceTest extends RepositoryTestBase {
|
|||||||
assertTrue(response.getContentAsString().contains("\"protocol\":[{\"href\":\"http://\",\"name\":\"http\"},{\"href\":\"ssh://\",\"name\":\"ssh\"}]"));
|
assertTrue(response.getContentAsString().contains("\"protocol\":[{\"href\":\"http://\",\"name\":\"http\"},{\"href\":\"ssh://\",\"name\":\"ssh\"}]"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void shouldNotRenameRepositoryNamespaceIfNamespaceStrategyIsNotCustom() throws Exception {
|
|
||||||
mockRepository("hitchhiker", "heart-of-gold");
|
|
||||||
when(scmConfiguration.getNamespaceStrategy()).thenReturn("UsernameNamespaceStrategy");
|
|
||||||
|
|
||||||
URL url = Resources.getResource("sonia/scm/api/v2/rename-repo.json");
|
|
||||||
byte[] repository = Resources.toByteArray(url);
|
|
||||||
|
|
||||||
MockHttpRequest request = MockHttpRequest
|
|
||||||
.post("/" + RepositoryRootResource.REPOSITORIES_PATH_V2 + "hitchhiker/heart-of-gold/rename")
|
|
||||||
.contentType(VndMediaType.REPOSITORY)
|
|
||||||
.content(repository);
|
|
||||||
MockHttpResponse response = new MockHttpResponse();
|
|
||||||
|
|
||||||
dispatcher.invoke(request, response);
|
|
||||||
|
|
||||||
assertEquals(SC_FORBIDDEN, response.getStatus());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void shouldNotRenameRepositoryIfNamespaceAndNameDidNotChanged() throws Exception {
|
|
||||||
mockRepository("space", "x");
|
|
||||||
when(scmConfiguration.getNamespaceStrategy()).thenReturn("CustomNamespaceStrategy");
|
|
||||||
|
|
||||||
URL url = Resources.getResource("sonia/scm/api/v2/rename-repo.json");
|
|
||||||
byte[] repository = Resources.toByteArray(url);
|
|
||||||
|
|
||||||
MockHttpRequest request = MockHttpRequest
|
|
||||||
.post("/" + RepositoryRootResource.REPOSITORIES_PATH_V2 + "space/x/rename")
|
|
||||||
.contentType(VndMediaType.REPOSITORY)
|
|
||||||
.content(repository);
|
|
||||||
MockHttpResponse response = new MockHttpResponse();
|
|
||||||
|
|
||||||
dispatcher.invoke(request, response);
|
|
||||||
|
|
||||||
assertEquals(SC_BAD_REQUEST, response.getStatus());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void shouldRenameRepository() throws Exception {
|
public void shouldRenameRepository() throws Exception {
|
||||||
mockRepository("space", "repo");
|
String namespace = "space";
|
||||||
when(scmConfiguration.getNamespaceStrategy()).thenReturn("CustomNamespaceStrategy");
|
String name = "repo";
|
||||||
|
Repository repository1 = mockRepository(namespace, name);
|
||||||
|
when(manager.get(new NamespaceAndName(namespace, name))).thenReturn(repository1);
|
||||||
|
|
||||||
URL url = Resources.getResource("sonia/scm/api/v2/rename-repo.json");
|
URL url = Resources.getResource("sonia/scm/api/v2/rename-repo.json");
|
||||||
byte[] repository = Resources.toByteArray(url);
|
byte[] repository = Resources.toByteArray(url);
|
||||||
@@ -439,31 +397,9 @@ public class RepositoryRootResourceTest extends RepositoryTestBase {
|
|||||||
dispatcher.invoke(request, response);
|
dispatcher.invoke(request, response);
|
||||||
|
|
||||||
assertEquals(SC_NO_CONTENT, response.getStatus());
|
assertEquals(SC_NO_CONTENT, response.getStatus());
|
||||||
verify(repositoryManager).modify(any(Repository.class));
|
verify(repositoryManager).rename(repository1, "space", "x");
|
||||||
verify(scmEventBus).post(any(RepositoryRenamedEvent.class));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void shouldRenameRepositoryNameIfNamespaceStrategyNotCustom() throws Exception {
|
|
||||||
mockRepository("space", "repo");
|
|
||||||
when(scmConfiguration.getNamespaceStrategy()).thenReturn("UsernameNamespaceStrategy");
|
|
||||||
|
|
||||||
URL url = Resources.getResource("sonia/scm/api/v2/rename-repo.json");
|
|
||||||
byte[] repository = Resources.toByteArray(url);
|
|
||||||
|
|
||||||
MockHttpRequest request = MockHttpRequest
|
|
||||||
.post("/" + RepositoryRootResource.REPOSITORIES_PATH_V2 + "space/repo/rename")
|
|
||||||
.contentType(VndMediaType.REPOSITORY)
|
|
||||||
.content(repository);
|
|
||||||
MockHttpResponse response = new MockHttpResponse();
|
|
||||||
|
|
||||||
dispatcher.invoke(request, response);
|
|
||||||
|
|
||||||
assertEquals(SC_NO_CONTENT, response.getStatus());
|
|
||||||
verify(repositoryManager).modify(any(Repository.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private PageResult<Repository> createSingletonPageResult(Repository repository) {
|
private PageResult<Repository> createSingletonPageResult(Repository repository) {
|
||||||
return new PageResult<>(singletonList(repository), 0);
|
return new PageResult<>(singletonList(repository), 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,12 +24,9 @@
|
|||||||
|
|
||||||
package sonia.scm.api.v2.resources;
|
package sonia.scm.api.v2.resources;
|
||||||
|
|
||||||
import sonia.scm.config.ScmConfiguration;
|
|
||||||
import sonia.scm.event.ScmEventBus;
|
|
||||||
import sonia.scm.repository.RepositoryManager;
|
import sonia.scm.repository.RepositoryManager;
|
||||||
|
|
||||||
import static com.google.inject.util.Providers.of;
|
import static com.google.inject.util.Providers.of;
|
||||||
import static org.mockito.Mockito.mock;
|
|
||||||
|
|
||||||
abstract class RepositoryTestBase {
|
abstract class RepositoryTestBase {
|
||||||
|
|
||||||
@@ -48,9 +45,6 @@ abstract class RepositoryTestBase {
|
|||||||
IncomingRootResource incomingRootResource;
|
IncomingRootResource incomingRootResource;
|
||||||
RepositoryCollectionResource repositoryCollectionResource;
|
RepositoryCollectionResource repositoryCollectionResource;
|
||||||
AnnotateResource annotateResource;
|
AnnotateResource annotateResource;
|
||||||
ScmConfiguration scmConfiguration;
|
|
||||||
ScmEventBus scmEventBus;
|
|
||||||
|
|
||||||
|
|
||||||
RepositoryRootResource getRepositoryRootResource() {
|
RepositoryRootResource getRepositoryRootResource() {
|
||||||
RepositoryBasedResourceProvider repositoryBasedResourceProvider = new RepositoryBasedResourceProvider(
|
RepositoryBasedResourceProvider repositoryBasedResourceProvider = new RepositoryBasedResourceProvider(
|
||||||
@@ -70,8 +64,7 @@ abstract class RepositoryTestBase {
|
|||||||
repositoryToDtoMapper,
|
repositoryToDtoMapper,
|
||||||
dtoToRepositoryMapper,
|
dtoToRepositoryMapper,
|
||||||
manager,
|
manager,
|
||||||
repositoryBasedResourceProvider,
|
repositoryBasedResourceProvider)),
|
||||||
scmConfiguration, scmEventBus)),
|
|
||||||
of(repositoryCollectionResource));
|
of(repositoryCollectionResource));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user