### Question:
SecurityUtil { public static boolean isSecurityEnabled() { String authenticationType = StartupProperties.get().getProperty( AUTHENTICATION_TYPE, PseudoAuthenticationHandler.TYPE); final boolean useKerberos; if (authenticationType == null || PseudoAuthenticationHandler.TYPE.equals(authenticationType)) { useKerberos = false; } else if (KerberosAuthenticationHandler.TYPE.equals(authenticationType)) { useKerberos = true; } else { throw new IllegalArgumentException("Invalid attribute value for " + AUTHENTICATION_TYPE + " of " + authenticationType); } return useKerberos; } private  SecurityUtil(); static String getAuthenticationType(); static boolean isSecurityEnabled(); static String getLocalHostName(); static boolean isAuthorizationEnabled(); static boolean isCSRFFilterEnabled(); static AuthorizationProvider getAuthorizationProvider(); static void tryProxy(Entity entity, final String doAsUser); static final String AUTHENTICATION_TYPE; static final String NN_PRINCIPAL; static final String RM_PRINCIPAL; static final String HIVE_METASTORE_KERBEROS_PRINCIPAL; static final String METASTORE_USE_THRIFT_SASL; static final String METASTORE_PRINCIPAL; }### Answer:
@Test public void testIsSecurityEnabledByDefault() throws Exception { Assert.assertFalse(SecurityUtil.isSecurityEnabled()); }
@Test public void testIsSecurityEnabled() throws Exception { try { StartupProperties.get().setProperty(SecurityUtil.AUTHENTICATION_TYPE, "kerberos"); Assert.assertTrue(SecurityUtil.isSecurityEnabled()); } finally { StartupProperties.get().setProperty(SecurityUtil.AUTHENTICATION_TYPE, "simple"); } }