mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 07:55:47 +01:00
Set author for svn modify commits
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
package sonia.scm.repository.spi;
|
||||
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import org.apache.shiro.util.ThreadContext;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
@@ -14,6 +17,8 @@ import java.io.IOException;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
public class SvnModifyCommandTest extends AbstractSvnCommandTestBase {
|
||||
|
||||
@@ -31,6 +36,18 @@ public class SvnModifyCommandTest extends AbstractSvnCommandTestBase {
|
||||
svnModifyCommand = new SvnModifyCommand(context, createRepository(), workDirFactory);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void initSecurityManager() {
|
||||
Subject subject = mock(Subject.class);
|
||||
when(subject.getPrincipal()).thenReturn("alThor");
|
||||
ThreadContext.bind(subject);
|
||||
}
|
||||
|
||||
@After
|
||||
public void cleanUpSecurityManager() {
|
||||
ThreadContext.unbindSubject();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldRemoveFiles() {
|
||||
ModifyCommandRequest request = new ModifyCommandRequest();
|
||||
|
||||
Reference in New Issue
Block a user