use of org.jboss.weld.bean.ManagedBean in project core by weld.
the class BeanIdentifierIndexTest method testIndex.
@Test
public void testIndex() {
BeanIdentifierIndex index = beanManager.getServices().get(BeanIdentifierIndex.class);
// Index is enabled by default
assertTrue(index.isBuilt());
assertFalse(index.isEmpty());
ManagedBean<?> indexedBean = (ManagedBean<?>) beanManager.resolve(beanManager.getBeans(Indexed.class));
assertNotNull(index.getIndex(indexedBean.getIdentifier()));
HttpSessionBean httpSessionBean = (HttpSessionBean) beanManager.resolve(beanManager.getBeans(HttpSession.class));
// Built-in beans are not included
assertNull(index.getIndex(httpSessionBean.getIdentifier()));
}
Aggregations