MockServletContext servletContext = new MockServletContext();
ContextFactory.initApplicationContext(servletContext);
@SuppressWarnings("unchecked")
Bean<ExternalTestScopedBean> bean = (Bean<ExternalTestScopedBean>) getBeanManager().getBeans(ExternalTestScopedBean.class,
new DefaultLiteral()).iterator().next();
ExternalTestScopedBean instance = (ExternalTestScopedBean) getBeanManager().getReference(bean, ExternalTestScopedBean.class,
getBeanManager().createCreationalContext(bean));
Assert.assertNotNull(instance);