Improve mocking for post-samples test.