Refactored tests to make use of stateMock