@Test
public void testKerberosPrincipal() throws IOException {

  SliderFileSystem sfs = ServiceTestUtils.initMockFs();
  Service app = createValidApplication("comp-a");
  KerberosPrincipal kp = new KerberosPrincipal();
  kp.setKeytab("file:///tmp/a.keytab");
  kp.setPrincipalName("user/_HOST@domain.com");
  app.setKerberosPrincipal(kp);
  // This should succeed
  try {
    ServiceApiUtil.validateKerberosPrincipal(app.getKerberosPrincipal());
  } catch (IllegalArgumentException e) {
    Assert.fail(NO_EXCEPTION_PREFIX + e.getMessage());
  }
  // Keytab with no URI scheme should succeed too
  kp.setKeytab("/some/path");
  try {
    ServiceApiUtil.validateKerberosPrincipal(app.getKerberosPrincipal());
  } catch (IllegalArgumentException e) {
    Assert.fail(NO_EXCEPTION_PREFIX + e.getMessage());
  }
}