INT-2884: Refactor 'stdout' tests to use mocks