Fix method usage to comply with new API.

This cleans up the deprecation warning in the tests right now.