well, that’s the good thing, that integration tests test everything. So either mock a login to bypass it or just don’t put it in your configuration file for testing.
Sounds like you are blending integration tests with unit tests? For an integration test to test functionality hidden behind your membership wall you need to simulate a session so you appear to be an authenticated user. Your basically running the entire application from database to handler and asserting the handler got X back from your service/model and set Y into the PRC scope and finally set the view to Z.
Unit testing is much more targeted. You would mock everything the login handler needed to authenticate a user. Then, you would mock everything for a bad email address. Then you would mock everything for a bad password. Etc… In this case the only thing you would test is the handler. You would even mock the CFCs that handle the database stuff for you.
For those that search and find this issue. I’m not sure this is best practice but given that I couldn’t get it working any other way I unloaded the solitary module at runtime in the integration test by using:
getController().getModuleService().unload(“Solitary”);
which allows me to integration test the parent application without worrying about mocking/testing a third party module as well
Could you post a short example of how to mock a login for an app that uses the “coldbox.system.interceptors.Security” interceptor? I would like to integration test a handler that is behind the security service and can’t quite connect the dots as to how to mock the login.