Fixed unit test to new api