private void getAttributeFromModel(String expectedAttributeName, MethodParameter param) throws Exception {
Object target = new TestBean();
mavContainer.addAttribute(expectedAttributeName, target);
WebDataBinder dataBinder = new WebRequestDataBinder(target);
WebDataBinderFactory factory = mock(WebDataBinderFactory.class);
given(factory.createBinder(webRequest, target, expectedAttributeName)).willReturn(dataBinder);
processor.resolveArgument(param, mavContainer, webRequest, factory);
verify(factory).createBinder(webRequest, target, expectedAttributeName);