enterpriseBeans.add(sessionBean);
metaData.setEnterpriseBeans(enterpriseBeans);
when(unit.getAttachment(AttachmentNames.PROCESSED_METADATA, JBossMetaData.class)).thenReturn(metaData);
DeploymentUnit component = mock(DeploymentUnit.class);
when(unit.addComponent(JBossEnterpriseBeanMetaData.class.getName() + ".Test")).thenReturn(component);
deployer.deploy(unit);
// make sure the deployer actually looked at the metadata
verify(unit).getAttachment(AttachmentNames.PROCESSED_METADATA, JBossMetaData.class);
// make sure the component got created
verify(unit).addComponent(JBossEnterpriseBeanMetaData.class.getName() + ".Test");