Fixed an issue with refactored code. Refactored test with new errorCode