Add unit test for getData
This should give us some much needed confidence when refactoring getData any further.