### Question:
SecurityUtil { @InterfaceAudience.Public @InterfaceStability.Evolving public static void login(final Configuration conf, final String keytabFileKey, final String userNameKey) throws IOException { login(conf, keytabFileKey, userNameKey, getLocalHostName()); }  @InterfaceAudience.Public @InterfaceStability.Evolving static String getServerPrincipal(String principalConfig,
      String hostname); @InterfaceAudience.Public @InterfaceStability.Evolving static String getServerPrincipal(String principalConfig,
      InetAddress addr); @InterfaceAudience.Public @InterfaceStability.Evolving static void login(final Configuration conf,
      final String keytabFileKey, final String userNameKey); @InterfaceAudience.Public @InterfaceStability.Evolving static void login(final Configuration conf,
      final String keytabFileKey, final String userNameKey, String hostname); static String buildDTServiceName(URI uri, int defPort); static String getHostFromPrincipal(String principalName); @InterfaceAudience.Private static void setSecurityInfoProviders(SecurityInfo... providers); static KerberosInfo getKerberosInfo(Class<?> protocol, Configuration conf); static TokenInfo getTokenInfo(Class<?> protocol, Configuration conf); static InetSocketAddress getTokenServiceAddr(Token<?> token); static void setTokenService(Token<?> token, InetSocketAddress addr); static Text buildTokenService(InetSocketAddress addr); static Text buildTokenService(URI uri); static T doAsLoginUserOrFatal(PrivilegedAction<T> action); static T doAsLoginUser(PrivilegedExceptionAction<T> action); static T doAsCurrentUser(PrivilegedExceptionAction<T> action); static URLConnection openSecureHttpConnection(URL url); @InterfaceAudience.Private static InetAddress getByName(String hostname); static final Log LOG; static final String HOSTNAME_PATTERN; }### Answer:
@Test public void testStartsWithIncorrectSettings() throws IOException { Configuration conf = new Configuration(); conf.set( org.apache.hadoop.fs.CommonConfigurationKeys.HADOOP_SECURITY_AUTHENTICATION, "kerberos"); String keyTabKey="key"; conf.set(keyTabKey, ""); UserGroupInformation.setConfiguration(conf); boolean gotException = false; try { SecurityUtil.login(conf, keyTabKey, "", ""); } catch (IOException e) { gotException=true; } assertTrue("Exception for empty keytabfile name was expected", gotException); }