@Test public void testValid() throws Exception { final Object bean = context.mock(View.class); context.checking(new Expectations() { { allowing(beanFactory).containsBean(BEAN_NAME); will(returnValue(true)); allowing(beanFactory).getBean(BEAN_NAME); will(returnValue(bean)); } }); assertSame(bean, sut.resolveViewName(BEAN_NAME, null)); context.assertIsSatisfied(); }
public View resolveViewName(final String viewName, final java.util.Locale locale) throws Exception { if (beanFactory.containsBean(viewName)) { Object bean = beanFactory.getBean(viewName); if (bean instanceof View) { return (View) bean; } } return null; }
BeanNameViewResolver implements ViewResolver { public View resolveViewName(final String viewName, final java.util.Locale locale) throws Exception { if (beanFactory.containsBean(viewName)) { Object bean = beanFactory.getBean(viewName); if (bean instanceof View) { return (View) bean; } } return null; } }
BeanNameViewResolver implements ViewResolver { public View resolveViewName(final String viewName, final java.util.Locale locale) throws Exception { if (beanFactory.containsBean(viewName)) { Object bean = beanFactory.getBean(viewName); if (bean instanceof View) { return (View) bean; } } return null; } BeanNameViewResolver(final BeanFactory inBeanFactory); }
BeanNameViewResolver implements ViewResolver { public View resolveViewName(final String viewName, final java.util.Locale locale) throws Exception { if (beanFactory.containsBean(viewName)) { Object bean = beanFactory.getBean(viewName); if (bean instanceof View) { return (View) bean; } } return null; } BeanNameViewResolver(final BeanFactory inBeanFactory); View resolveViewName(final String viewName, final java.util.Locale locale); }
BeanNameViewResolver implements ViewResolver { public View resolveViewName(final String viewName, final java.util.Locale locale) throws Exception { if (beanFactory.containsBean(viewName)) { Object bean = beanFactory.getBean(viewName); if (bean instanceof View) { return (View) bean; } } return null; } BeanNameViewResolver(final BeanFactory inBeanFactory); View resolveViewName(final String viewName, final java.util.Locale locale);  }