Remove deprecated API usage in tests