public function authenticate(RMF\Request $request)
{
try {
$this->repository->setCurrentUser($this->repository->getUserService()->loadUser($request->testUser));
} catch (InvalidArgumentException $e) {
throw new RuntimeException('The Integration Test Authenticator requires a test user ID to be set using the HTTP Header X-Test-User.');
}
}