@Test public void resolveArgumentTest() throws Exception { CallMessage callMessage = new CallMessage(1, "call"); TestPrincipal testPrincipal = new TestPrincipal("testPrincipal"); callMessage.setHeader(WampMessageHeader.PRINCIPAL, testPrincipal); assertThat(this.resolver.resolveArgument(this.principalParameter, callMessage)) .isEqualTo(testPrincipal); }
@Override public Object resolveArgument(MethodParameter parameter, Message<?> message) throws Exception { Principal user = ((WampMessage) message).getPrincipal(); if (user == null) { throw new MessageHandlingException(message, "No \"PRINCIPAL\" header in message"); } return user; }
PrincipalMethodArgumentResolver implements HandlerMethodArgumentResolver { @Override public Object resolveArgument(MethodParameter parameter, Message<?> message) throws Exception { Principal user = ((WampMessage) message).getPrincipal(); if (user == null) { throw new MessageHandlingException(message, "No \"PRINCIPAL\" header in message"); } return user; } }
PrincipalMethodArgumentResolver implements HandlerMethodArgumentResolver { @Override public Object resolveArgument(MethodParameter parameter, Message<?> message) throws Exception { Principal user = ((WampMessage) message).getPrincipal(); if (user == null) { throw new MessageHandlingException(message, "No \"PRINCIPAL\" header in message"); } return user; }  }
PrincipalMethodArgumentResolver implements HandlerMethodArgumentResolver { @Override public Object resolveArgument(MethodParameter parameter, Message<?> message) throws Exception { Principal user = ((WampMessage) message).getPrincipal(); if (user == null) { throw new MessageHandlingException(message, "No \"PRINCIPAL\" header in message"); } return user; }  @Override boolean supportsParameter(MethodParameter parameter); @Override Object resolveArgument(MethodParameter parameter, Message<?> message); }
PrincipalMethodArgumentResolver implements HandlerMethodArgumentResolver { @Override public Object resolveArgument(MethodParameter parameter, Message<?> message) throws Exception { Principal user = ((WampMessage) message).getPrincipal(); if (user == null) { throw new MessageHandlingException(message, "No \"PRINCIPAL\" header in message"); } return user; }  @Override boolean supportsParameter(MethodParameter parameter); @Override Object resolveArgument(MethodParameter parameter, Message<?> message);  }