@BeforeClass
  public static void beforeClass() throws Exception {

    // overriding bindings for testing purposes
    Module testModule = Modules.override(new LdapModule()).with(new AbstractModule() {
      @Override
      protected void configure() {
        // override the configuration instance binding not to access the database
        bind(EntityManager.class).toInstance(createNiceMock(EntityManager.class));
        bind(DBAccessor.class).toInstance(createNiceMock(DBAccessor.class));
        bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
      }
    });

    injector = Guice.createInjector(testModule);
  }
Test for the GUICE LdapModule setup

- checks the module's bindings (can the GUICE context be created properely)
- checks for specific instances in the GUICE context (re they constructed properly, what is the instance' scope)

It's named functional test as it creates a GUICE context. ("Real" unit tests only mock a class' collaborators, and
are more lightweight)

By default the test is ignored, as it connects to external LDAP instances, thus in different environments may fail
ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java