mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-12-22 00:09:47 +01:00
Improve committer accuracy
Changes made by the SCM-Manager, like those through the editor and pull requests, now more accurately define the committer on the underlying changeset. Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com> Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
This commit is contained in:
committed by
SCM-Manager
parent
8eb2687e10
commit
7e83d34fc0
@@ -25,6 +25,7 @@
|
||||
package sonia.scm.repository.spi;
|
||||
|
||||
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
|
||||
import org.apache.shiro.subject.PrincipalCollection;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import org.apache.shiro.util.ThreadContext;
|
||||
import org.junit.After;
|
||||
@@ -41,6 +42,7 @@ import sonia.scm.repository.api.FileLockedException;
|
||||
import sonia.scm.repository.work.NoneCachingWorkingCopyPool;
|
||||
import sonia.scm.repository.work.WorkdirProvider;
|
||||
import sonia.scm.repository.work.WorkingCopy;
|
||||
import sonia.scm.user.User;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -75,7 +77,10 @@ public class SvnModifyCommandTest extends AbstractSvnCommandTestBase {
|
||||
@Before
|
||||
public void initSecurityManager() {
|
||||
Subject subject = mock(Subject.class);
|
||||
PrincipalCollection principalCollection = mock(PrincipalCollection.class);
|
||||
when(subject.getPrincipal()).thenReturn("alThor");
|
||||
when(subject.getPrincipals()).thenReturn(principalCollection);
|
||||
when(principalCollection.oneByType(User.class)).thenReturn(new User("galaxy", "quest", "galaxy@quest.com"));
|
||||
ThreadContext.bind(subject);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user