@Override
    public TgTicket getTgt(String principal, String password) throws Exception {
      // although it is generally a bad idea to use sleep in a unit test for a
      // timing mechanism, this is being used to simulate a timeout and should be
      // generally safe as we are not relying on this for timing other than expecting
      // that this will block longer than the timeout set on the connection validator
      // which should be set to 1 second when using this implementation.
      // We will only block the full 60 seconds in the case of a specific test failure
      // where the callable doesn't properly set the timeout on the get.
      Thread.sleep(60000);
      return null;
    }
Test implementation which blocks on getTgt() for 60 seconds to facilitate timeout testing.
ambari-server/src/test/java/org/apache/ambari/server/api/rest/KdcServerConnectionVerificationTest.java