### Question:
AuthorizationUtil { public static String getAppAuthorizingUser(OwnerAdmin ownerAdmin, AuthenticationContext authenticationContext, ApplicationId applicationId, @Nullable KerberosPrincipalId appOwner) throws IOException { KerberosPrincipalId effectiveOwner = SecurityUtil.getEffectiveOwner(ownerAdmin, applicationId.getNamespaceId(), appOwner == null ? null : appOwner.getPrincipal()); String appAuthorizingUser = effectiveOwner != null ? new KerberosName(effectiveOwner.getPrincipal()).getShortName() : authenticationContext.getPrincipal().getName(); LOG.trace("Returning {} as authorizing app user for {}", appAuthorizingUser, applicationId); return appAuthorizingUser; } private  AuthorizationUtil(); static void ensureOnePrivilege(io.cdap.cdap.proto.id.EntityId entityId, Set<Action> actionSet,
                                        AuthorizationEnforcer authorizationEnforcer,
                                        Principal principal); static List<EntityInfo> isVisible(
    Collection<EntityInfo> entityInfo, AuthorizationEnforcer authorizationEnforcer, Principal principal,
    Function<EntityInfo, EntityId> transformer, @Nullable Predicate<EntityInfo> byPassFilter); static void ensureAccess(EntityId entityId, AuthorizationEnforcer authorizationEnforcer,
                                  Principal principal); static boolean isSecurityAuthorizationEnabled(CConfiguration cConf); static T authorizeAs(String userName, Callable<T> callable); static String getAppAuthorizingUser(OwnerAdmin ownerAdmin, AuthenticationContext authenticationContext,
                                             ApplicationId applicationId,
                                             @Nullable KerberosPrincipalId appOwner); @Nullable static String getEffectiveMasterUser(CConfiguration cConf);  }### Answer:
@Test public void testGetAppAuthorizingUse() throws Exception { OwnerAdmin ownerAdmin = getOwnerAdmin(); String principal = username + "/" + InetAddress.getLocalHost().getHostName() + "@REALM.net"; NamespaceMeta nsMeta = new NamespaceMeta.Builder().setName(namespaceId).setPrincipal(principal) .setKeytabURI("doesnotmatter").build(); namespaceClient.create(nsMeta); Assert.assertEquals(username, AuthorizationUtil.getAppAuthorizingUser(ownerAdmin, authenticationContext, applicationId, null)); namespaceClient.delete(namespaceId); principal = username; nsMeta = new NamespaceMeta.Builder().setName(namespaceId).setPrincipal(principal) .setKeytabURI("doesnotmatter").build(); namespaceClient.create(nsMeta); Assert.assertEquals(username, AuthorizationUtil.getAppAuthorizingUser(ownerAdmin, authenticationContext, applicationId, null)); namespaceClient.delete(namespaceId); principal = username + "@REALM.net"; nsMeta = new NamespaceMeta.Builder().setName(namespaceId).setPrincipal(principal) .setKeytabURI("doesnotmatter").build(); namespaceClient.create(nsMeta); Assert.assertEquals(username, AuthorizationUtil.getAppAuthorizingUser(ownerAdmin, authenticationContext, applicationId, null)); namespaceClient.delete(namespaceId); }