@Test
public void testAntiPatterns() throws Exception {

  KerberosName.setRuleMechanism(KerberosName.MECHANISM_HADOOP);
  checkBadName("owen/owen/owen@FOO.COM");
  checkBadName("owen@foo/bar.com");
  checkBadTranslation("foo@ACME.COM");
  checkBadTranslation("root/joe@FOO.COM");
  KerberosName.setRuleMechanism(KerberosName.MECHANISM_MIT);
  checkTranslation("foo@ACME.COM", "foo@ACME.COM");
  checkTranslation("root/joe@FOO.COM", "root/joe@FOO.COM");
}