Add integrate test and make it pass