@Override
            protected void configureServlets() {
              nmContext = new NodeManager.NMContext(null);
              nmContext.getNodeId().setHost("testhost.foo.com");
              nmContext.getNodeId().setPort(9999);
              resourceView =
                  new ResourceView() {
                    @Override
                    public long getVmemAllocatedForContainers() {
                      // 15.5G in bytes
                      return new Long("16642998272");
                    }

                    @Override
                    public long getPmemAllocatedForContainers() {
                      // 16G in bytes
                      return new Long("17179869184");
                    }
                  };
              conf.set(YarnConfiguration.NM_LOCAL_DIRS, testRootDir.getAbsolutePath());
              conf.set(YarnConfiguration.NM_LOG_DIRS, testLogDir.getAbsolutePath());
              NodeHealthCheckerService healthChecker = new NodeHealthCheckerService();
              healthChecker.init(conf);
              dirsHandler = healthChecker.getDiskHandler();
              aclsManager = new ApplicationACLsManager(conf);
              nmWebApp = new NMWebApp(resourceView, aclsManager, dirsHandler);
              bind(JAXBContextResolver.class);
              bind(NMWebServices.class);
              bind(GenericExceptionHandler.class);
              bind(Context.class).toInstance(nmContext);
              bind(WebApp.class).toInstance(nmWebApp);
              bind(ResourceView.class).toInstance(resourceView);
              bind(ApplicationACLsManager.class).toInstance(aclsManager);
              bind(LocalDirsHandlerService.class).toInstance(dirsHandler);

              serve("/*").with(GuiceContainer.class);
            }