RpcContext.set(message); return method.invoke(serviceProvider.get(message), (parms != null) ? parms.toArray(new Object[parms.size()]) : new Object[0]);
RpcContext.set(message); return method.invoke(serviceProvider.get(message), (parms != null) ? parms.toArray(new Object[parms.size()]) : new Object[0]);
@Before public void setup() { when(authService.getUser()).thenThrow(new AssertionError("Should not call authentication service")); when(threadMessage.getResource(QueueSession.class, "Session")).thenReturn(threadQueueSession); when(threadQueueSession.getSessionId()).thenReturn(sessionUser.getIdentifier()); RpcContext.set(null); }
@Before public void setup() { when(authService.getUser()).thenThrow(new AssertionError("Should not call authentication service")); when(threadMessage.getResource(QueueSession.class, "Session")).thenReturn(threadQueueSession); when(threadQueueSession.getSessionId()).thenReturn(sessionUser.getIdentifier()); RpcContext.set(null); }
@Test public void returnAuthenticatedUserInSessionThread() { when(userInstance.isAmbiguous()).thenReturn(false); when(userInstance.isUnsatisfied()).thenReturn(false); when(userInstance.get()).thenReturn(defaultUser); reset(authService); when(authService.getUser()).thenReturn(sessionUser); RpcContext.set(threadMessage); SessionInfo sessionInfo = factory.getSessionInfo(authService); assertSame(sessionUser, sessionInfo.getIdentity()); }
@Test public void returnAuthenticatedUserInSessionThread() { when(userInstance.isAmbiguous()).thenReturn(false); when(userInstance.isUnsatisfied()).thenReturn(false); when(userInstance.get()).thenReturn(defaultUser); reset(authService); when(authService.getUser()).thenReturn(sessionUser); RpcContext.set(threadMessage); SessionInfo sessionInfo = factory.getSessionInfo(authService); assertSame(sessionUser, sessionInfo.getIdentity()); }
private void setupRpcContext() { final Message message = MessageBuilder.createMessage("for testing").signalling().done().getMessage(); message.setResource("Session", queueSession); RpcContext.set(message); } }
private void setupRpcContext() { final Message message = MessageBuilder.createMessage("for testing").signalling().done().getMessage(); message.setResource("Session", queueSession); RpcContext.set(message); } }