Fix deprecated methods used in tests merged from master