mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 07:25:44 +01:00
added injection support for authentication, group, repository and user listeners
This commit is contained in:
@@ -35,6 +35,8 @@ package sonia.scm.web.security;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import com.google.inject.Provider;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import sonia.scm.AbstractTestBase;
|
||||
@@ -48,6 +50,8 @@ import sonia.scm.util.MockUtil;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -130,8 +134,15 @@ public class ChainAuthenticationManagerTest extends AbstractTestBase
|
||||
trillian.setPassword("trillian123");
|
||||
handlerSet.add(new SingleUserAuthenticaionHandler("trilliansType",
|
||||
trillian));
|
||||
|
||||
Provider<Set<AuthenticationListener>> listenerProvider =
|
||||
mock(Provider.class);
|
||||
|
||||
when(listenerProvider.get()).thenReturn(
|
||||
new HashSet<AuthenticationListener>());
|
||||
manager = new ChainAuthenticatonManager(handlerSet,
|
||||
new MessageDigestEncryptionHandler(), cacheManager);
|
||||
new MessageDigestEncryptionHandler(), cacheManager,
|
||||
listenerProvider);
|
||||
manager.init(contextProvider);
|
||||
request = MockUtil.getHttpServletRequest();
|
||||
response = MockUtil.getHttpServletResponse();
|
||||
|
||||
Reference in New Issue
Block a user