KerberosUtils { static int getRenewInterval(Config config) throws KrbException { String configuredLifetime = getKrb5config().getTicketLifetime(); if (config.hasPath(TICKET_RENEW_INTERVAL)) { return new Long(config.getDuration(TICKET_RENEW_INTERVAL, TimeUnit.SECONDS)).intValue(); } else if (configuredLifetime != null) { return parseLifetime(configuredLifetime); } else { return DEFAULT_LIFETIME_SECS; } }  static KerberosLoginContext createKerberosLoginContext(String contextName, Config config); static boolean shouldLoginFromKeytab(Config config); static String getKerberosRealm(Config config); static void loginIfRequired(KerberosLoginContext loginContext, Config config);  }
@Test public void testGetRenewInterval() throws KrbException { Config config = ConfigFactory.empty(); System.setProperty("java.security.krb5.conf", testFolder.getRoot().getAbsolutePath() + File.separator + "krb5.conf"); long renewInterval = KerberosUtils.getRenewInterval(config); assertEquals(10 * 3600, renewInterval); }