Buggy code:
@ RunWith ( Arquillian . class ) @ ServerSetup ( { LdapLoginModuleTestCase . SystemPropertiesSetup . class , LdapLoginModuleTestCase . LDAPServerSetupTask . class , LdapLoginModuleTestCase . SecurityDomainsSetup . class } ) @ RunAsClient @ Category ( CommonCriteria . class ) public class LdapLoginModuleTestCase { private static Logger LOGGER = Logger . getLogger ( LdapLoginModuleTestCase . class ) ; private static final String SECURITY_DOMAIN_LDAP = "test-ldap" ; private static final String SECURITY_DOMAIN_LDAPS = "test-ldaps" ; private static final String KEYSTORE_FILENAME = "ldaps.jks" ; private static final File KEYSTORE_FILE = new File ( LdapLoginModuleTestCase . KEYSTORE_FILENAME ) ; private static final int LDAP_PORT = 10389 ; private static final int LDAPS_PORT = 10636 ; private static final String INITIAL_CONTEXT_FACTORY = "com.sun.jndi.ldap.LdapCtxFactory" ; private static final String SECURITY_AUTHENTICATION = "simple" ; private static final String SECURITY_CREDENTIALS = "secret" ; private static final String SECURITY_PRINCIPAL = "uid=admin,ou=system" ; @ ArquillianResource ManagementClient mgmtClient ; @ Deployment ( name = LdapLoginModuleTestCase . SECURITY_DOMAIN_LDAP ) public static WebArchive deploymentLdap ( ) { } @ Deployment ( name = LdapLoginModuleTestCase . SECURITY_DOMAIN_LDAPS ) public static WebArchive deploymentLdaps ( ) { } @ Test @ OperateOnDeployment ( LdapLoginModuleTestCase . SECURITY_DOMAIN_LDAP ) public void testLdap ( @ ArquillianResource URL webAppURL ) throws Exception { } @ Test @ OperateOnDeployment ( LdapLoginModuleTestCase . SECURITY_DOMAIN_LDAPS ) public void testLdaps ( @ ArquillianResource URL webAppURL ) throws Exception { } private void testAccess ( @ ArquillianResource URL webAppURL ) throws Exception { final URL servletURL = new URL ( ( ( webAppURL . toExternalForm ( ) ) + ( SERVLET_PATH . substring ( 1 ) ) ) ) ; <START_BUG> LdapLoginModuleTestCase . LOGGER . info ( ( "Testing<seq2seq4repair_space>successful<seq2seq4repair_space>authentication<seq2seq4repair_space>-<seq2seq4repair_space>" + servletURL ) ) ; <END_BUG> assertEquals ( "Expected<seq2seq4repair_space>response<seq2seq4repair_space>body<seq2seq4repair_space>doesn't<seq2seq4repair_space>match<seq2seq4repair_space>the<seq2seq4repair_space>returned<seq2seq4repair_space>one." , RESPONSE_BODY , Utils . makeCallWithBasicAuthn ( servletURL , "jduke" , "theduke" , 200 ) ) ; LdapLoginModuleTestCase . LOGGER . info ( ( "Testing<seq2seq4repair_space>failed<seq2seq4repair_space>authentication<seq2seq4repair_space>-<seq2seq4repair_space>" + servletURL ) ) ; Utils . makeCallWithBasicAuthn ( servletURL , "anil" , "theduke" , 401 ) ; Utils . makeCallWithBasicAuthn ( servletURL , "jduke" , "anil" , 401 ) ; Utils . makeCallWithBasicAuthn ( servletURL , "anil" , "anil" , 401 ) ; LdapLoginModuleTestCase . LOGGER . info ( ( "Testing<seq2seq4repair_space>failed<seq2seq4repair_space>authorization<seq2seq4repair_space>-<seq2seq4repair_space>" + servletURL ) ) ; Utils . makeCallWithBasicAuthn ( servletURL , "tester" , "password" , 403 ) ; final URL unprotectedURL = new URL ( ( ( webAppURL . toExternalForm ( ) ) + ( SimpleServlet . SERVLET_PATH . substring ( 1 ) ) ) ) ; LdapLoginModuleTestCase . LOGGER . info ( ( "Testing<seq2seq4repair_space>access<seq2seq4repair_space>to<seq2seq4repair_space>unprotected<seq2seq4repair_space>resource<seq2seq4repair_space>-<seq2seq4repair_space>" + unprotectedURL ) ) ; assertEquals ( "Expected<seq2seq4repair_space>response<seq2seq4repair_space>body<seq2seq4repair_space>doesn't<seq2seq4repair_space>match<seq2seq4repair_space>the<seq2seq4repair_space>returned<seq2seq4repair_space>one." , SimpleServlet . RESPONSE_BODY , Utils . makeCallWithBasicAuthn ( unprotectedURL , null , null , 200 ) ) ; } private static WebArchive createWar ( final String securityDomain ) { } static class SystemPropertiesSetup extends AbstractSystemPropertiesServerSetupTask { @ Override protected SystemProperty [ ] getSystemProperties ( ) { } } static class SecurityDomainsSetup extends AbstractSecurityDomainsServerSetupTask { @ Override protected SecurityDomain [ ] getSecurityDomains ( ) throws Exception { } } @ 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 } ) @ CreateLdapServer ( transports = { @ CreateTransport ( protocol = "LDAP" , port = LdapLoginModuleTestCase . LDAP_PORT , address = "0.0.0.0" ) , @ CreateTransport ( protocol = "LDAPS" , port = LdapLoginModuleTestCase . LDAPS_PORT , address = "0.0.0.0" ) } , certificatePassword = "secret" ) static class LDAPServerSetupTask implements ServerSetupTask { private DirectoryService directoryService ; private LdapServer ldapServer ; public void setup ( ManagementClient managementClient , String containerId ) throws Exception { } public void tearDown ( ManagementClient managementClient , String containerId ) throws Exception { } } }

Fix:
LdapLoginModuleTestCase . LOGGER . info ( ( "Testing<seq2seq4repair_space>successfull<seq2seq4repair_space>authentication<seq2seq4repair_space>-<seq2seq4repair_space>" + servletURL ) ) ;