Buggy code:
@ RunWith ( Arquillian . class ) @ ServerSetup ( { Krb5ConfServerSetupTask . class , SPNEGOLoginModuleTestCase . KerberosSystemPropertiesSetupTask . class , SPNEGOLoginModuleTestCase . KDCServerSetupTask . class , GSSTestServer . class , SPNEGOLoginModuleTestCase . SecurityDomainsSetup . class } ) @ RunAsClient @ Ignore ( "AS7-6796<seq2seq4repair_space>-<seq2seq4repair_space>Undertow<seq2seq4repair_space>SPNEGO" ) public class SPNEGOLoginModuleTestCase { private static Logger LOGGER = Logger . getLogger ( SPNEGOLoginModuleTestCase . class ) ; private static final String WEBAPP_NAME = "kerberos-login-module" ; private static final String WEBAPP_NAME_FALLBACK = "kerberos-test-form-fallback" ; private static final String TRUE = Boolean . TRUE . toString ( ) ; @ ArquillianResource ManagementClient mgmtClient ; @ Deployment ( name = "WEB" ) public static WebArchive deployment ( ) { } @ Deployment ( name = "WEB-FORM" ) public static WebArchive deploymentWebFormFallback ( ) { } @ Deployment ( name = "EJB" ) public static JavaArchive deploymentEjb ( ) throws IOException , IllegalArgumentException { } @ Test @ OperateOnDeployment ( "WEB" ) public void testAuthn ( @ ArquillianResource URL webAppURL ) throws Exception { } @ Test @ OperateOnDeployment ( "WEB" ) public void testUnsuccessfulAuthn ( @ ArquillianResource URL webAppURL ) throws Exception { } @ Test @ OperateOnDeployment ( "WEB" ) public void testUnsuccessfulAuthz ( @ ArquillianResource URL webAppURL ) throws Exception { } @ Test @ OperateOnDeployment ( "WEB" ) public void testUnsecured ( @ ArquillianResource URL webAppURL ) throws Exception { } @ Test @ OperateOnDeployment ( "WEB" ) public void testIdentityPropagation ( @ ArquillianResource URL webAppURL ) throws Exception { } @ Test @ OperateOnDeployment ( "WEB-FORM" ) public void testFormFallback ( @ ArquillianResource URL webAppURL ) throws Exception { } @ Test @ OperateOnDeployment ( "EJB" ) @ Ignore ( "AS7-4874<seq2seq4repair_space>EJB3<seq2seq4repair_space>in<seq2seq4repair_space>AS7<seq2seq4repair_space>doesn't<seq2seq4repair_space>support<seq2seq4repair_space>Kerberos<seq2seq4repair_space>authentication" ) public void testEjbAccess ( ) throws Exception { } private static WebArchive createWebApp ( final String webAppName , final String webXmlFilename , final String securityDomain ) { } private Context getRemoteContext ( ) throws Exception { } private URI getServletURI ( final URL webAppURL , final String servletPath ) throws URISyntaxException { } @ CreateDS ( name = "JBossDS" , partitions = { @ CreatePartition ( name = "jboss" , suffix = "dc=jboss,dc=org" , contextEntry = @ ContextEntry ( entryLdif = "dn:<seq2seq4repair_space>dc=jboss,dc=org\n" + ( ( "dc:<seq2seq4repair_space>jboss\n" + "objectClass:<seq2seq4repair_space>top\n" ) + "objectClass:<seq2seq4repair_space>domain\n\n" ) ) , indexes = { @ CreateIndex ( attribute = "objectClass" ) , @ CreateIndex ( attribute = "dc" ) , @ CreateIndex ( attribute = "ou" ) } ) } , additionalInterceptors = { KeyDerivationInterceptor . class } ) @ CreateKdcServer ( primaryRealm = "JBOSS.ORG" , kdcPrincipal = "krbtgt//JBOSS.ORG@JBOSS.ORG" , searchBaseDn = "dc=jboss,dc=org" , transports = { @ CreateTransport ( protocol = "UDP" , port = 6088 ) } ) static class KDCServerSetupTask implements ServerSetupTask { private DirectoryService directoryService ; private KdcServer kdcServer ; private boolean removeBouncyCastle = false ; public void setup ( ManagementClient managementClient , String containerId ) throws Exception { try { if ( ( Security . getProvider ( PROVIDER_NAME ) ) == null ) { Security . addProvider ( new BouncyCastleProvider ( ) ) ; removeBouncyCastle = true ; } } catch ( SecurityException ex ) { SPNEGOLoginModuleTestCase . LOGGER . warn ( "Cannot<seq2seq4repair_space>register<seq2seq4repair_space>BouncyCastleProvider" , ex ) ; } directoryService = DSAnnotationProcessor . getDirectoryService ( ) ; final String hostname = Utils . getCannonicalHost ( managementClient ) ; final Map < String , String > map = new HashMap < String , String > ( ) ; map . put ( "hostname" , NetworkUtils . formatPossibleIpv6Address ( hostname ) ) ; final String ldifContent = StrSubstitutor . replace ( IOUtils . toString ( SPNEGOLoginModuleTestCase . class . getResourceAsStream ( ( ( SPNEGOLoginModuleTestCase . class . getSimpleName ( ) ) + ".ldif" ) ) , "UTF-8" ) , map ) ; SPNEGOLoginModuleTestCase . LOGGER . info ( ldifContent ) ; final SchemaManager schemaManager = directoryService . getSchemaManager ( ) ; try { for ( LdifEntry ldifEntry : new LdifReader ( IOUtils . toInputStream ( ldifContent ) ) ) { directoryService . getAdminSession ( ) . add ( new org . apache . directory . api . ldap . model . entry . DefaultEntry ( schemaManager , ldifEntry . getEntry ( ) ) ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; throw e ; } <START_BUG> kdcServer = KDCServerAnnotationProcessor . getKdcServer ( directoryService , 1024 , hostname ) ; <END_BUG> } public void tearDown ( ManagementClient managementClient , String containerId ) throws Exception { } } static class SecurityDomainsSetup extends AbstractSecurityDomainsServerSetupTask { @ Override protected SecurityDomain [ ] getSecurityDomains ( ) { } } static class KerberosSystemPropertiesSetupTask extends AbstractSystemPropertiesServerSetupTask { @ Override protected SystemProperty [ ] getSystemProperties ( ) { } } }

Fix:
kdcServer = KDCServerAnnotationProcessor . getKdcServer ( directoryService , 1024 ) ;