@Test public void testResolveArgument01() { TransactionTokenContextHandlerMethodArgumentResolver resolver = new TransactionTokenContextHandlerMethodArgumentResolver(); MethodParameter parameter = mock(MethodParameter.class); ModelAndViewContainer mavContainer = mock(ModelAndViewContainer.class); NativeWebRequest webRequest = mock(NativeWebRequest.class); WebDataBinderFactory binderFactory = mock(WebDataBinderFactory.class); String str = new String("testResolveArgument01"); when(webRequest.getAttribute( TransactionTokenInterceptor.TOKEN_CONTEXT_REQUEST_ATTRIBUTE_NAME, RequestAttributes.SCOPE_REQUEST)).thenReturn(str); Object result = null; try { result = resolver.resolveArgument(parameter, mavContainer, webRequest, binderFactory); } catch (Exception e) { e.printStackTrace(); } assertThat(result, is(instanceOf(String.class))); }
@Override public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) { return webRequest.getAttribute( TransactionTokenInterceptor.TOKEN_CONTEXT_REQUEST_ATTRIBUTE_NAME, RequestAttributes.SCOPE_REQUEST); }
TransactionTokenContextHandlerMethodArgumentResolver implements
                                                                  HandlerMethodArgumentResolver { @Override public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) { return webRequest.getAttribute( TransactionTokenInterceptor.TOKEN_CONTEXT_REQUEST_ATTRIBUTE_NAME, RequestAttributes.SCOPE_REQUEST); } }
TransactionTokenContextHandlerMethodArgumentResolver implements
                                                                  HandlerMethodArgumentResolver { @Override public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) { return webRequest.getAttribute( TransactionTokenInterceptor.TOKEN_CONTEXT_REQUEST_ATTRIBUTE_NAME, RequestAttributes.SCOPE_REQUEST); }  }
TransactionTokenContextHandlerMethodArgumentResolver implements
                                                                  HandlerMethodArgumentResolver { @Override public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) { return webRequest.getAttribute( TransactionTokenInterceptor.TOKEN_CONTEXT_REQUEST_ATTRIBUTE_NAME, RequestAttributes.SCOPE_REQUEST); }  @Override boolean supportsParameter(final MethodParameter parameter); @Override Object resolveArgument(MethodParameter parameter,
            ModelAndViewContainer mavContainer, NativeWebRequest webRequest,
            WebDataBinderFactory binderFactory); }
TransactionTokenContextHandlerMethodArgumentResolver implements
                                                                  HandlerMethodArgumentResolver { @Override public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) { return webRequest.getAttribute( TransactionTokenInterceptor.TOKEN_CONTEXT_REQUEST_ATTRIBUTE_NAME, RequestAttributes.SCOPE_REQUEST); }  @Override boolean supportsParameter(final MethodParameter parameter); @Override Object resolveArgument(MethodParameter parameter,
            ModelAndViewContainer mavContainer, NativeWebRequest webRequest,
            WebDataBinderFactory binderFactory);  }