@Test
  public void testLocalCalls() throws Exception {
    MBeanServer server = MBeanJMXAdapter.mbeanServer;
    assertThatThrownBy(
        () -> server.createMBean("FakeClassName", new ObjectName("GemFire", "name", "foo")))
            .isInstanceOf(ReflectionException.class);

    MBeanJMXAdapter adapter = new MBeanJMXAdapter(mock(DistributedMember.class));
    assertThatThrownBy(() -> adapter.registerMBean(mock(DynamicMBean.class),
        new ObjectName("MockDomain", "name", "mock"), false))
            .isInstanceOf(ManagementException.class);
  }
These calls does not go through the MBeanServerWrapper authentication, therefore is not
throwing the SecurityExceptions
geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/MBeanSecurityJUnitTest.java