@Test public void resolve() throws Exception { request.setAttribute(DeviceUtils.CURRENT_DEVICE_ATTRIBUTE, device, WebRequest.SCOPE_REQUEST); MethodParameter parameter = new MethodParameter(getClass().getMethod("handlerMethod", Device.class), 0); Object resolved = resolver.resolveArgument(parameter, request); assertSame(device, resolved); }
public Object resolveArgument(MethodParameter param, NativeWebRequest request) throws Exception { if (Device.class.isAssignableFrom(param.getParameterType())) { return DeviceUtils.getCurrentDevice(request); } else { return WebArgumentResolver.UNRESOLVED; } }
DeviceWebArgumentResolver implements WebArgumentResolver { public Object resolveArgument(MethodParameter param, NativeWebRequest request) throws Exception { if (Device.class.isAssignableFrom(param.getParameterType())) { return DeviceUtils.getCurrentDevice(request); } else { return WebArgumentResolver.UNRESOLVED; } } }
DeviceWebArgumentResolver implements WebArgumentResolver { public Object resolveArgument(MethodParameter param, NativeWebRequest request) throws Exception { if (Device.class.isAssignableFrom(param.getParameterType())) { return DeviceUtils.getCurrentDevice(request); } else { return WebArgumentResolver.UNRESOLVED; } }  }
DeviceWebArgumentResolver implements WebArgumentResolver { public Object resolveArgument(MethodParameter param, NativeWebRequest request) throws Exception { if (Device.class.isAssignableFrom(param.getParameterType())) { return DeviceUtils.getCurrentDevice(request); } else { return WebArgumentResolver.UNRESOLVED; } }  Object resolveArgument(MethodParameter param, NativeWebRequest request); }
DeviceWebArgumentResolver implements WebArgumentResolver { public Object resolveArgument(MethodParameter param, NativeWebRequest request) throws Exception { if (Device.class.isAssignableFrom(param.getParameterType())) { return DeviceUtils.getCurrentDevice(request); } else { return WebArgumentResolver.UNRESOLVED; } }  Object resolveArgument(MethodParameter param, NativeWebRequest request);  }