}
public HttpTestClient authenticatedAs(String principal) {
Factory factory = Factory.newInstance();
RestxSessionCookieDescriptor restxSessionCookieDescriptor = factory.getComponent(RestxSessionCookieDescriptor.class);
Signer signer = factory.queryByClass(Signer.class).findOneAsComponent().get();
ImmutableMap.Builder<String, String> cookiesBuilder = ImmutableMap.<String, String>builder().putAll(cookies);
String uuid = factory.getComponent(UUIDGenerator.class).doGenerate();
String expires = DateTime.now().plusHours(1).toString();
String sessionContent = String.format(