When using Shield, the local transport is not supported and we recommend using a transport client to connect to the cluster. Additionally, with Shield you will need to add a user for your tests or provide some configuration around authentication such as LDAP and role mapping depending on what you would like to test.
I would suggest that your test start up a node with the appropriate settings and then you can create a transport client to connect to the node in your test. If you plan to use the esusers realm, you can pre-populate the users and users_roles files and then configure the esusers realm to use those files. Additionally, you will also need a roles.yml file with the role definitions that you wish to use and that location can be configured via the