Updated test code to new API