/**
* @param user The User to act as the authenticator for HMAC communications (could be a Customer)
*/
protected User setUpHmacAuthenticator(User user) {
UserReadService userReadService = mock(UserReadService.class);
when(userReadService.getByApiKey(user.getApiKey())).thenReturn(Optional.of(user));
HmacServerAuthenticator authenticator = new HmacServerAuthenticator();
authenticator.setUserReadService(userReadService);
addSingleton(new HmacServerRestrictedToProvider<User>(authenticator, "REST"));