Factor out client bootstrap and add missing test