[DDC-3719] Refactor test to use a mock