We have a logical filter in one of our aggregates:
meaning that we get an error if we try to test this:
We could make it so the logic will take place outside of the aggregate, but is there a way to add mocking to the filter input of the aggregates?
Thank you in advance!
It looks like the issue is that your logic is relying on a logged-in user.
During the test, by default there is no logged-in user, but you can do a login for a particular test. I recommend you to create a User record, and then invoke LoginTestingUser. After that, your filter will work and will fetch the name of the user that you have created. After the test finishes, the User record will be rolled back.
Ahh that makes sense and it fixed my issue, I should have realised. Thank you for the quick response!