ContextUtil { public static RequestContext getCurrentRequestContext() { RangerSecurityContext context = RangerContextHolder.getSecurityContext(); if (context != null) { return context.getRequestContext(); } return null; } ContextUtil(); static Long getCurrentUserId(); static String getCurrentUserPublicName(); static UserSessionBase getCurrentUserSession(); static RequestContext getCurrentRequestContext(); static String getCurrentUserLoginId(); static boolean isBulkModeContext();  }
@SuppressWarnings("static-access") @Test public void testCurrentRequestContext(){ RequestContext requestContext = new RequestContext(); context.setRequestContext(requestContext); RequestContext expectedContext = contextUtil.getCurrentRequestContext(); Assert.assertNotNull(expectedContext); }