@SuppressWarnings("static-access") @Test public void testGetCurrentUserPublicName(){ String expectedName = "rangerAdmin"; gjUser.setPublicScreenName("rangerAdmin"); String publicName = contextUtil.getCurrentUserPublicName(); Assert.assertEquals(expectedName, publicName); }
public static String getCurrentUserPublicName() { RangerSecurityContext context = RangerContextHolder.getSecurityContext(); if (context != null) { UserSessionBase userSession = context.getUserSession(); if (userSession != null) { return userSession.getXXPortalUser().getPublicScreenName(); } } return null; }
ContextUtil { public static String getCurrentUserPublicName() { RangerSecurityContext context = RangerContextHolder.getSecurityContext(); if (context != null) { UserSessionBase userSession = context.getUserSession(); if (userSession != null) { return userSession.getXXPortalUser().getPublicScreenName(); } } return null; } }
ContextUtil { public static String getCurrentUserPublicName() { RangerSecurityContext context = RangerContextHolder.getSecurityContext(); if (context != null) { UserSessionBase userSession = context.getUserSession(); if (userSession != null) { return userSession.getXXPortalUser().getPublicScreenName(); } } return null; } ContextUtil(); }
ContextUtil { public static String getCurrentUserPublicName() { RangerSecurityContext context = RangerContextHolder.getSecurityContext(); if (context != null) { UserSessionBase userSession = context.getUserSession(); if (userSession != null) { return userSession.getXXPortalUser().getPublicScreenName(); } } return null; } ContextUtil(); static Long getCurrentUserId(); static String getCurrentUserPublicName(); static UserSessionBase getCurrentUserSession(); static RequestContext getCurrentRequestContext(); static String getCurrentUserLoginId(); static boolean isBulkModeContext(); }
ContextUtil { public static String getCurrentUserPublicName() { RangerSecurityContext context = RangerContextHolder.getSecurityContext(); if (context != null) { UserSessionBase userSession = context.getUserSession(); if (userSession != null) { return userSession.getXXPortalUser().getPublicScreenName(); } } return null; } ContextUtil(); static Long getCurrentUserId(); static String getCurrentUserPublicName(); static UserSessionBase getCurrentUserSession(); static RequestContext getCurrentRequestContext(); static String getCurrentUserLoginId(); static boolean isBulkModeContext();  }