Buggy code:
@ RunWith ( Arquillian . class ) @ ServerSetup ( VaultDatasourceTestCase . VaultDatasourceTestCaseSetup . class ) public class VaultDatasourceTestCase { private static Logger LOGGER = Logger . getLogger ( VaultDatasourceTestCase . class ) ; static class VaultDatasourceTestCaseSetup implements ServerSetupTask { private Connection connection ; private Server server ; private VaultHandler vaultHandler ; @ Override public void setup ( ManagementClient managementClient , String containerId ) throws Exception { VaultDatasourceTestCase . LOGGER . info ( ( "RESOURCE_LOCATION=" + ( VaultDatasourceTestCase . RESOURCE_LOCATION ) ) ) ; ModelNode op ; server = Server . createTcpServer ( "-tcpAllowOthers" ) . start ( ) ; Class . forName ( "org.h2.Driver" ) ; connection = DriverManager . getConnection ( "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1" , "sa" , VaultDatasourceTestCase . RIGHT_PASSWORD ) ; <START_BUG> executeUpdate ( connection , "CREATE<seq2seq4repair_space>CMR_TABLE<seq2seq4repair_space>TestPeople(Name<seq2seq4repair_space>Varchar(50),<seq2seq4repair_space>Surname<seq2seq4repair_space>Varchar(50))" ) ; <END_BUG> executeUpdate ( connection , "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>TestPeople<seq2seq4repair_space>VALUES<seq2seq4repair_space>('John','Smith')" ) ; vaultHandler = new VaultHandler ( VaultDatasourceTestCase . RESOURCE_LOCATION ) ; String attributeName = "password" ; String vaultPasswordString = vaultHandler . addSecuredAttribute ( VaultDatasourceTestCase . VAULT_BLOCK , attributeName , VaultDatasourceTestCase . RIGHT_PASSWORD . toCharArray ( ) ) ; String wrongVaultPasswordString = vaultHandler . addSecuredAttribute ( VaultDatasourceTestCase . VAULT_BLOCK_WRONG , attributeName , VaultDatasourceTestCase . WRONG_PASSWORD . toCharArray ( ) ) ; VaultDatasourceTestCase . LOGGER . debug ( ( "vaultPasswordString=" + vaultPasswordString ) ) ; op = new ModelNode ( ) ; op . get ( OP ) . set ( ADD ) ; op . get ( OP_ADDR ) . add ( CORE_SERVICE , VAULT ) ; ModelNode vaultOption = op . get ( VAULT_OPTIONS ) ; vaultOption . get ( "KEYSTORE_URL" ) . set ( vaultHandler . getKeyStore ( ) ) ; vaultOption . get ( "KEYSTORE_PASSWORD" ) . set ( vaultHandler . getMaskedKeyStorePassword ( ) ) ; vaultOption . get ( "KEYSTORE_ALIAS" ) . set ( vaultHandler . getAlias ( ) ) ; vaultOption . get ( "SALT" ) . set ( vaultHandler . getSalt ( ) ) ; vaultOption . get ( "ITERATION_COUNT" ) . set ( vaultHandler . getIterationCountAsString ( ) ) ; vaultOption . get ( "ENC_FILE_DIR" ) . set ( vaultHandler . getEncodedVaultFileDirectory ( ) ) ; managementClient . getControllerClient ( ) . execute ( new org . jboss . as . controller . client . OperationBuilder ( op ) . build ( ) ) ; VaultDatasourceTestCase . LOGGER . debug ( "Vault<seq2seq4repair_space>created<seq2seq4repair_space>in<seq2seq4repair_space>sever<seq2seq4repair_space>configuration" ) ; ModelNode address = new ModelNode ( ) ; address . add ( SUBSYSTEM , "datasources" ) ; address . add ( "data-source" , VaultDatasourceTestCase . VAULT_BLOCK ) ; address . protect ( ) ; op = new ModelNode ( ) ; op . get ( OP ) . set ( ADD ) ; op . get ( OP_ADDR ) . set ( address ) ; op . get ( "jndi-name" ) . set ( ( "java:jboss//datasources//" + ( VaultDatasourceTestCase . VAULT_BLOCK ) ) ) ; op . get ( "driver-name" ) . set ( "h2" ) ; op . get ( "connection-url" ) . set ( ( ( "jdbc:h2:tcp:////" + ( Utils . getSecondaryTestAddress ( managementClient ) ) ) + "//mem:test" ) ) ; op . get ( "user-name" ) . set ( "sa" ) ; op . get ( "password" ) . set ( ( ( "${" + vaultPasswordString ) + "}" ) ) ; op . get ( OPERATION_HEADERS ) . get ( ALLOW_RESOURCE_SERVICE_RESTART ) . set ( true ) ; managementClient . getControllerClient ( ) . execute ( new org . jboss . as . controller . client . OperationBuilder ( op ) . build ( ) ) ; VaultDatasourceTestCase . LOGGER . debug ( ( ( VaultDatasourceTestCase . VAULT_BLOCK ) + "<seq2seq4repair_space>datasource<seq2seq4repair_space>created" ) ) ; address = new ModelNode ( ) ; address . add ( SUBSYSTEM , "datasources" ) ; address . add ( "data-source" , VaultDatasourceTestCase . VAULT_BLOCK_WRONG ) ; address . protect ( ) ; op = new ModelNode ( ) ; op . get ( OP ) . set ( ADD ) ; op . get ( OP_ADDR ) . set ( address ) ; op . get ( "jndi-name" ) . set ( ( "java:jboss//datasources//" + ( VaultDatasourceTestCase . VAULT_BLOCK_WRONG ) ) ) ; op . get ( "driver-name" ) . set ( "h2" ) ; op . get ( "connection-url" ) . set ( ( ( "jdbc:h2:tcp:////" + ( Utils . getSecondaryTestAddress ( managementClient ) ) ) + "//mem:test" ) ) ; op . get ( "user-name" ) . set ( "sa" ) ; op . get ( "password" ) . set ( ( ( "${" + wrongVaultPasswordString ) + "}" ) ) ; op . get ( OPERATION_HEADERS ) . get ( ALLOW_RESOURCE_SERVICE_RESTART ) . set ( true ) ; managementClient . getControllerClient ( ) . execute ( new org . jboss . as . controller . client . OperationBuilder ( op ) . build ( ) ) ; VaultDatasourceTestCase . LOGGER . debug ( ( ( VaultDatasourceTestCase . VAULT_BLOCK_WRONG ) + "<seq2seq4repair_space>datasource<seq2seq4repair_space>created" ) ) ; } @ Override public void tearDown ( ManagementClient managementClient , String containerId ) throws Exception { } private void executeUpdate ( Connection connection , String query ) throws SQLException { } } static final String RESOURCE_LOCATION = ( VaultDatasourceTestCase . class . getProtectionDomain ( ) . getCodeSource ( ) . getLocation ( ) . getFile ( ) ) + "security//ds-vault//" ; static final String VAULT_BLOCK = "ds_TestDS" ; static final String VAULT_BLOCK_WRONG = ( VaultDatasourceTestCase . VAULT_BLOCK ) + "Wrong" ; static final String RIGHT_PASSWORD = "passwordForVault" ; static final String WRONG_PASSWORD = "wrongPasswordForVault" ; @ Test public void testAccessThroughVaultDatasource ( ) throws Exception { } @ Test public void testRejectWrongPasswordThroughVaultDatasource ( ) throws Exception { } @ Deployment public static WebArchive deployment ( ) { } }

Fix:
executeUpdate ( connection , "CREATE<seq2seq4repair_space>TABLE<seq2seq4repair_space>TestPeople(Name<seq2seq4repair_space>Varchar(50),<seq2seq4repair_space>Surname<seq2seq4repair_space>Varchar(50))" ) ;