### Question:
KdcConnection { public TgTicket getTgt( String principal, String password ) throws KerberosException { TgtRequest clientTgtReq = new TgtRequest(); clientTgtReq.setClientPrincipal( principal ); clientTgtReq.setPassword( password ); return getTgt( clientTgtReq ); } KdcConnection( KdcConfig config ); TgTicket getTgt( String principal, String password ); ServiceTicket getServiceTicket( String clientPrincipal, String password, String serverPrincipal ); TgTicket getTgt( TgtRequest clientTgtReq ); ChangePasswordResult changePassword( String clientPrincipal, String oldPassword, String newPassword );  }### Answer:
@Test public void testGettingInitialTicketTcp() throws Exception { TgTicket tgt = conn.getTgt( principalName, userPassword ); assertNotNull( tgt ); assertFalse( tgt.isForwardable() ); }
@Test public void testGettingInitialTicketUdp() throws Exception { KdcConfig config = new KdcConfig(); config.setKdcPort( getUdpPort() ); config.setEncryptionTypes( kdcServer.getConfig().getEncryptionTypes() ); config.setTimeout( Integer.MAX_VALUE ); KdcConnection udpConn = new KdcConnection( config ); TgTicket tgt = udpConn.getTgt( principalName, userPassword ); assertNotNull( tgt ); assertFalse( tgt.isForwardable() ); }
@Test public void testTgtFlags() throws Exception { TgtRequest tgtReq = new TgtRequest(); tgtReq.setClientPrincipal( principalName ); tgtReq.setPassword( userPassword ); tgtReq.setForwardable( true ); TgTicket tgt = conn.getTgt( tgtReq ); assertNotNull( tgt ); assertTrue( tgt.isForwardable() ); }