Updating deprecated method calls in the tests