Add cap setup to unit test