mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 01:15:44 +01:00
Fix unit test
This commit is contained in:
@@ -19,7 +19,7 @@ import java.io.IOException;
|
|||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
@SubjectAware(configuration = "classpath:sonia/scm/configuration/shiro.ini")
|
@SubjectAware(configuration = "classpath:sonia/scm/configuration/shiro.ini", username = "admin", password = "secret")
|
||||||
public class GitMergeCommandTest extends AbstractGitCommandTestBase {
|
public class GitMergeCommandTest extends AbstractGitCommandTestBase {
|
||||||
|
|
||||||
private static final String REALM = "AdminRealm";
|
private static final String REALM = "AdminRealm";
|
||||||
@@ -111,11 +111,14 @@ public class GitMergeCommandTest extends AbstractGitCommandTestBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@SubjectAware(username = "admin", password = "secret")
|
|
||||||
public void shouldTakeAuthorFromSubjectIfNotSet() throws IOException, GitAPIException {
|
public void shouldTakeAuthorFromSubjectIfNotSet() throws IOException, GitAPIException {
|
||||||
|
SimplePrincipalCollection principals = new SimplePrincipalCollection();
|
||||||
|
principals.add("admin", REALM);
|
||||||
|
principals.add( new User("dirk", "Dirk Gently", "dirk@holistic.det"), REALM);
|
||||||
shiro.setSubject(
|
shiro.setSubject(
|
||||||
new Subject.Builder()
|
new Subject.Builder()
|
||||||
.principals(new SimplePrincipalCollection(new User("dirk", "Dirk Gently", "dirk@holistic.det"), REALM))
|
.principals(principals)
|
||||||
|
.authenticated(true)
|
||||||
.buildSubject());
|
.buildSubject());
|
||||||
GitMergeCommand command = createCommand();
|
GitMergeCommand command = createCommand();
|
||||||
MergeCommandRequest request = new MergeCommandRequest();
|
MergeCommandRequest request = new MergeCommandRequest();
|
||||||
|
|||||||
Reference in New Issue
Block a user