@Override
      protected void configure() {
        install(new FactoryModuleBuilder().build(UpgradeContextFactory.class));
        install(new FactoryModuleBuilder().build(RoleGraphFactory.class));
        install(new FactoryModuleBuilder().build(ConfigureClusterTaskFactory.class));

        bind(EntityManager.class).toInstance(createMock(EntityManager.class));
        bind(DBAccessor.class).toInstance(createMock(DBAccessor.class));
        bind(ActionDBAccessor.class).toInstance(createMock(ActionDBAccessor.class));
        bind(ExecutionScheduler.class).toInstance(createMock(ExecutionScheduler.class));
        bind(OsFamily.class).toInstance(createMock(OsFamily.class));
        bind(AmbariMetaInfo.class).toInstance(createMock(AmbariMetaInfo.class));
        bind(ActionManager.class).toInstance(createMock(ActionManager.class));
        bind(RequestFactory.class).toInstance(createMock(RequestFactory.class));
        bind(RequestExecutionFactory.class).toInstance(createMock(RequestExecutionFactory.class));
        bind(StageFactory.class).toInstance(createMock(StageFactory.class));
        bind(Clusters.class).toInstance(createMock(Clusters.class));
        bind(AbstractRootServiceResponseFactory.class).toInstance(createMock(AbstractRootServiceResponseFactory.class));
        bind(StackManagerFactory.class).toInstance(createMock(StackManagerFactory.class));
        bind(ConfigFactory.class).toInstance(createMock(ConfigFactory.class));
        bind(ConfigGroupFactory.class).toInstance(createMock(ConfigGroupFactory.class));
        bind(ServiceFactory.class).toInstance(createMock(ServiceFactory.class));
        bind(ServiceComponentFactory.class).toInstance(createMock(ServiceComponentFactory.class));
        bind(ServiceComponentHostFactory.class).toInstance(createMock(ServiceComponentHostFactory.class));
        bind(PasswordEncoder.class).toInstance(createMock(PasswordEncoder.class));
        bind(KerberosHelper.class).toInstance(createMock(KerberosHelper.class));
        bind(AmbariManagementController.class).toInstance(createMock(AmbariManagementController.class));
        bind(RoleCommandOrderProvider.class).to(CachedRoleCommandOrderProvider.class);
        bind(CredentialStoreService.class).to(CredentialStoreServiceImpl.class);
        bind(HostRoleCommandDAO.class).toInstance(createMock(HostRoleCommandDAO.class));
        bind(HookService.class).toInstance(createMock(HookService.class));
        bind(HookContextFactory.class).toInstance(createMock(HookContextFactory.class));
        bind(HostRoleCommandFactory.class).to(HostRoleCommandFactoryImpl.class);
        bind(PersistedState.class).to(PersistedStateImpl.class);
        bind(UserDAO.class).toInstance(createMock(UserDAO.class));

        bind(UserAuthenticationDAO.class).toInstance(createMock(UserAuthenticationDAO.class));
        bind(GroupDAO.class).toInstance(createMock(GroupDAO.class));
        bind(MemberDAO.class).toInstance(createMock(MemberDAO.class));
        bind(PrincipalDAO.class).toInstance(createMock(PrincipalDAO.class));
        bind(PermissionDAO.class).toInstance(createMock(PermissionDAO.class));
        bind(PrivilegeDAO.class).toInstance(createMock(PrivilegeDAO.class));
        bind(ResourceDAO.class).toInstance(createMock(ResourceDAO.class));
        bind(PrincipalTypeDAO.class).toInstance(createMock(PrincipalTypeDAO.class));
        bind(MpackManagerFactory.class).toInstance(createNiceMock(MpackManagerFactory.class));
        bind(AmbariLdapConfigurationProvider.class).toInstance(createMock(AmbariLdapConfigurationProvider.class));

        bind(new TypeLiteral<Encryptor<AgentConfigsUpdateEvent>>() {}).annotatedWith(Names.named("AgentConfigEncryptor")).toInstance(Encryptor.NONE);
        bind(new TypeLiteral<Encryptor<AmbariServerConfiguration>>() {}).annotatedWith(Names.named("AmbariServerConfigurationEncryptor")).toInstance(Encryptor.NONE);
      }
Test give a user Ambari administrative rights by assigning the user to the AMBARI.ADMINISTRATOR role
when creating the account. This is for backward compatibility to maintain the REST API V1 contract.
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UserResourceProviderTest.java