| | |
| | | import com.gitblit.manager.IRuntimeManager; |
| | | import com.gitblit.manager.IUserManager; |
| | | import com.gitblit.models.UserModel; |
| | | import com.gitblit.tests.mock.MemorySettings; |
| | | import com.gitblit.transport.ssh.SshDaemonClient; |
| | | import com.gitblit.transport.ssh.SshKrbAuthenticator; |
| | | |
| | |
| | | //Build an UserManager that can build a UserModel |
| | | IUserManager im = Mockito.mock(IUserManager.class); |
| | | Mockito.doAnswer(new Answer<Object>() { |
| | | @Override |
| | | public Object answer(InvocationOnMock invocation) { |
| | | Object[] args = invocation.getArguments(); |
| | | String user = (String) args[0]; |
| | |
| | | |
| | | AuthenticationManager am = new AuthenticationManager(rm, im); |
| | | |
| | | GSSAuthenticator gssAuthenticator = new SshKrbAuthenticator(am); |
| | | GSSAuthenticator gssAuthenticator = new SshKrbAuthenticator(new MemorySettings(), am); |
| | | |
| | | ServerSession session = Mockito.mock(ServerSession.class); |
| | | |
| | |
| | | SshDaemonClient client = Mockito.mock(SshDaemonClient.class); |
| | | Mockito.when(client.getUser()).thenReturn(umw.um); |
| | | Mockito.doAnswer(new Answer<Object>() { |
| | | @Override |
| | | public Object answer(InvocationOnMock invocation) { |
| | | Object[] args = invocation.getArguments(); |
| | | UserModel um = (UserModel) args[0]; |