public GeodeComponent getLocator() {
    return (GeodeComponent) webApplicationContext.getServletContext().getAttribute("locator");
  }
this constructor needs to be called in the @Before method of the test since only at that time
the webApplicationContext loaded by the context loader is available.
geode-web-management/src/commonTest/java/org/apache/geode/management/internal/rest/LocatorWebContext.java