private void beforeTest(Config cfg, boolean memory, boolean enableHttpd) throws Exception {
   server = startServer(cfg, memory, enableHttpd);
   server.getTestInjector().injectMembers(this);
   admin = accounts.admin();
   user = accounts.user();
   adminSession = new RestSession(server, admin);
   userSession = new RestSession(server, user);
   initSsh(admin);
   db = reviewDbProvider.open();
   Context ctx = newRequestContext(admin);
   atrScope.set(ctx);
   sshSession = ctx.getSession();
   project = new Project.NameKey("p");
   createProject(sshSession, project.get());
   git = cloneProject(sshSession.getUrl() + "/" + project.get());
 }
 private void afterTest() throws Exception {
   db.close();
   sshSession.close();
   server.stop();
 }