Stub resourceCreation more extensibly.

It can either succeed or fail based on a global variable.