Mocking in Integration Tests?

Is it possible to mock a method in a handler for integration tests? In the handler/method under test I have a “getUserID” method that requires login, 2FA, etc. and I’d like to just be able to mock it, but I haven’t been able to find a way to do this in tandem with the ‘execute’ method. If I mock the handler itself, I can mock the method, but the execute method knows nothing of the mocked handler.