Rewrite tests to use simplified plugin bootstrap

This reduced the tests execution time from 60 seconds to 8 seconds.
So now we can classify the size as small. Moreover, we don't need
to build and deploy the plugin during test execution and thus the
test can be run hermetically, so that we can remove local tag.

Change-Id: Ibe51dee4fd6185ad04a0cf3b5395a7e95f154e0a
diff --git a/BUILD b/BUILD
index b6ec8b2..1ca5610 100644
--- a/BUILD
+++ b/BUILD
@@ -18,15 +18,12 @@
     resources = glob(["src/main/**/*"]),
 )
 
-# For the reasons, how the plugin tests are implemented
-# they cannot be run hermetically.
 junit_tests(
     name = "cookbook_tests",
-    size = "large",
+    size = "small",
     srcs = glob(["src/test/java/**/*IT.java"]),
     tags = [
         "cookbook-plugin",
-        "local",
     ],
     visibility = ["//visibility:public"],
     deps = [
diff --git a/src/test/java/com/googlesource/gerrit/plugins/cookbook/CookbookIT.java b/src/test/java/com/googlesource/gerrit/plugins/cookbook/CookbookIT.java
index 316c08e..ad38f8e 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/cookbook/CookbookIT.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/cookbook/CookbookIT.java
@@ -16,13 +16,19 @@
 
 import static com.google.common.truth.Truth.assertThat;
 
-import com.google.gerrit.acceptance.PluginDaemonTest;
+import com.google.gerrit.acceptance.LightweightPluginDaemonTest;
 import com.google.gerrit.acceptance.RestResponse;
+import com.google.gerrit.acceptance.TestPlugin;
 
 import org.junit.Test;
 
-public class CookbookIT extends PluginDaemonTest {
-
+@TestPlugin(
+    name = "cookbook",
+    sysModule = "com.googlesource.gerrit.plugins.cookbook.Module",
+    httpModule = "com.googlesource.gerrit.plugins.cookbook.HttpModule",
+    sshModule = "com.googlesource.gerrit.plugins.cookbook.SshModule"
+)
+public class CookbookIT extends LightweightPluginDaemonTest {
   @Test
   public void printTest() throws Exception {
     assertThat(adminSshSession.exec("cookbook print"))