@Test
public void testRegisterMbean() throws Exception {

    final CentrifugeImpl centrifuge = new CentrifugeImpl(new CentrifugeConfig());
    final String mbeanName = centrifuge.getMbeanName();
    try {
        ManagementFactory.getPlatformMBeanServer().getMBeanInfo(new ObjectName(mbeanName));
        fail();
    } catch (InstanceNotFoundException ignored) {}
    centrifuge.registerMbean();
    assertNotNull(ManagementFactory.getPlatformMBeanServer().getMBeanInfo(new ObjectName(mbeanName)));
}