@Test
public void testUploadButtonIsVisibleToAllWhenGlobalPropertyIsNotSet()
    throws NoSuchFieldException, IllegalAccessException {

  final HttpServletRequest httpServletRequest = mock(HttpServletRequest.class);
  final HttpServletResponse httpServletResponse = mock(HttpServletResponse.class);
  final User user = TestUtils.getTestUser();
  final Session session = new Session("fake-session-id", user, "127.0.0.1");
  final VelocityEngine velocityEngine = new VelocityEngine();
  velocityEngine.init("src/test/resources/velocity.properties");
  final Page page = new Page(httpServletRequest, httpServletResponse, velocityEngine,
      "azkaban/webapp/servlet/velocity/permissionspage.vm");
  final UserManager userManager = TestUtils.createTestXmlUserManager();
  PageUtils.hideUploadButtonWhenNeeded(page, session, userManager, false);
  final Field velocityContextField = Page.class.getDeclaredField("context");
  velocityContextField.setAccessible(true);
  final VelocityContext velocityContext = (VelocityContext) velocityContextField.get(page);
  assertThat(velocityContext.containsKey("hideUploadProject")).isFalse();
}