wac.refresh();
ServletWebRequest webRequest = new ServletWebRequest(new MockHttpServletRequest());
RequestContextHolder.setRequestAttributes(webRequest);
MyBeanClass myBeanClass = wac.getBean("myBeanClass", MyBeanClass.class);
assertNull(myBeanClass);
MyBeanClass myProxiedBeanClass = wac.getBean("myProxiedBeanClass", MyBeanClass.class);
assertNotNull(myProxiedBeanClass);
assertEquals("foo", myProxiedBeanClass.getFoo()); // this will cause NPE
RequestContextHolder.resetRequestAttributes();
}