Remove deprecated API in test code